Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit fb79393

Browse files
EstebanG23copybara-github
authored andcommitted
refactor(tab): Update ripple sass logic
PiperOrigin-RevId: 355267584
1 parent 637d15d commit fb79393

File tree

2 files changed

+34
-16
lines changed

2 files changed

+34
-16
lines changed

packages/mdc-tab/_mixins.scss

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@
112112
@mixin ripple($query: feature-targeting.all()) {
113113
@include ripple.common($query); // COPYBARA_COMMENT_THIS_LINE
114114

115-
.mdc-tab__ripple {
116-
@include ripple_($query);
117-
}
115+
@include ripple_($query);
118116
}
119117

120118
@mixin horizontal-padding($padding, $query: feature-targeting.all()) {
@@ -149,9 +147,11 @@
149147
}
150148

151149
@mixin states-color($color, $query: feature-targeting.all()) {
152-
.mdc-tab__ripple {
153-
@include ripple-theme.states($color, $query: $query);
154-
}
150+
@include ripple-theme.states(
151+
$color,
152+
$query: $query,
153+
$ripple-target: variables.$ripple-target
154+
);
155155
}
156156

157157
@mixin ink-color($color, $query: feature-targeting.all()) {
@@ -276,17 +276,34 @@
276276
@mixin ripple_($query: feature-targeting.all()) {
277277
$feat-structure: feature-targeting.create-target($query, structure);
278278

279-
@include ripple.surface($query);
280-
@include ripple.radius-bounded($query: $query);
281-
@include ripple-theme.states($color: primary, $query: $query);
279+
.mdc-tab {
280+
@include ripple.surface(
281+
$query,
282+
$ripple-target: variables.$ripple-target,
283+
$include-will-change: false
284+
);
285+
@include ripple.radius-bounded(
286+
$query: $query,
287+
$ripple-target: variables.$ripple-target
288+
);
289+
@include ripple-theme.states(
290+
$color: primary,
291+
$query: $query,
292+
$ripple-target: variables.$ripple-target
293+
);
294+
}
282295

283-
@include feature-targeting.targets($feat-structure) {
284-
position: absolute;
285-
top: 0;
286-
left: 0;
287-
width: 100%;
288-
height: 100%;
289-
overflow: hidden;
296+
#{variables.$ripple-target} {
297+
@include feature-targeting.targets($feat-structure) {
298+
position: absolute;
299+
top: 0;
300+
left: 0;
301+
width: 100%;
302+
height: 100%;
303+
overflow: hidden;
304+
// TODO(b/151931961): Remove the following line once resolved
305+
will-change: transform, opacity;
306+
}
290307
}
291308
}
292309

packages/mdc-tab/_variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ $icon-color-default: rgba(
3939
) !default;
4040
$text-label-color-active: primary !default;
4141
$icon-color-active: primary !default;
42+
$ripple-target: '.mdc-tab__ripple';

0 commit comments

Comments
 (0)