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

Commit bdf9d4a

Browse files
codrcopybara-github
authored andcommitted
refactor(button): remove :not from button-ripple and remove width & height 100%.
PiperOrigin-RevId: 435154556
1 parent 1b6afad commit bdf9d4a

File tree

2 files changed

+17
-30
lines changed

2 files changed

+17
-30
lines changed

packages/mdc-button/_button-outlined-theme.scss

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -227,16 +227,10 @@ $light-theme: (
227227

228228
#{button-ripple.$ripple-target} {
229229
@include feature-targeting.targets($feat-structure) {
230-
@include theme.property(
231-
top,
232-
'calc(-1 * outline-width)',
233-
$replace: (outline-width: $outline-width)
234-
);
235-
@include theme.property(
236-
left,
237-
'calc(-1 * outline-width)',
238-
$replace: (outline-width: $outline-width)
239-
);
230+
@include theme.property(top, -1 * $outline-width-value);
231+
@include theme.property(left, -1 * $outline-width-value);
232+
@include theme.property(bottom, -1 * $outline-width-value);
233+
@include theme.property(right, -1 * $outline-width-value);
240234
@include theme.property(border-width, $outline-width);
241235
}
242236
}

packages/mdc-button/_button-ripple.scss

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,20 @@ $ripple-target: '.mdc-button__ripple';
3939
$query: $query,
4040
$ripple-target: $ripple-target
4141
);
42+
}
4243

43-
#{$ripple-target} {
44-
@include feature-targeting.targets($feat-structure) {
45-
position: absolute;
46-
// Ripple needs content-box as the box sizing and box-sizing: border-box
47-
// is often set as a default, so we override that here.
48-
box-sizing: content-box;
49-
width: 100%;
50-
height: 100%;
51-
overflow: hidden;
52-
z-index: 0;
53-
}
54-
}
55-
56-
// Ripple targets inside outlined buttons set their own `top`/`left`,
57-
// depending on the border width.
58-
&:not(.mdc-button--outlined) #{$ripple-target} {
59-
@include feature-targeting.targets($feat-structure) {
60-
top: 0;
61-
left: 0;
62-
}
44+
#{$ripple-target} {
45+
@include feature-targeting.targets($feat-structure) {
46+
position: absolute;
47+
// Ripple needs content-box as the box sizing and box-sizing: border-box
48+
// is often set as a default, so we override that here.
49+
box-sizing: content-box;
50+
overflow: hidden;
51+
z-index: 0;
52+
top: 0;
53+
left: 0;
54+
bottom: 0;
55+
right: 0;
6356
}
6457
}
6558
}

0 commit comments

Comments
 (0)