Skip to content

Commit 146bc23

Browse files
authored
fix(material/button): Emit fab tokens under mixin root selector (#27806)
1 parent 425bad8 commit 146bc23

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/material/button/_fab-theme.scss

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,32 +51,36 @@
5151
$disabled: rgba($on-surface, 0.12);
5252
$on-disabled: rgba($on-surface, if($is-dark, 0.5, 0.38));
5353

54-
.mat-mdc-fab,
55-
.mat-mdc-mini-fab {
54+
@include sass-utils.current-selector-or-root() {
5655
// TODO(wagnermaciel): The ripple-theme-styles mixin depends heavily on
5756
// being wrapped by using-mdc-theme. This workaround needs to be
5857
// revisited w/ a more holistic solution.
59-
@include mdc-helpers.using-mdc-theme($theme) {
60-
@include button-theme-private.ripple-theme-styles($theme, true);
58+
.mat-mdc-fab,
59+
.mat-mdc-mini-fab {
60+
@include mdc-helpers.using-mdc-theme($theme) {
61+
@include button-theme-private.ripple-theme-styles($theme, true);
62+
}
6163
}
6264

63-
@include button-theme-private.apply-disabled-style() {
64-
@include _fab-variant($on-disabled, $disabled);
65+
:disabled, a[disabled='true'] {
66+
@include button-theme-private.apply-disabled-style() {
67+
@include _fab-variant($on-disabled, $disabled);
68+
}
6569
}
6670

67-
&.mat-unthemed {
71+
.mat-unthemed {
6872
@include _fab-variant($on-surface, $surface);
6973
}
7074

71-
&.mat-primary {
75+
.mat-primary {
7276
@include _fab-variant($on-primary, $primary);
7377
}
7478

75-
&.mat-accent {
79+
.mat-accent {
7680
@include _fab-variant($on-accent, $accent);
7781
}
7882

79-
&.mat-warn {
83+
.mat-warn {
8084
@include _fab-variant($on-warn, $warn);
8185
}
8286
}
@@ -88,7 +92,7 @@
8892
}
8993

9094
$typography-tokens: tokens-mdc-extended-fab.get-typography-tokens($theme);
91-
.mat-mdc-extended-fab {
95+
@include sass-utils.current-selector-or-root() {
9296
@include mdc-extended-fab-theme.theme($typography-tokens);
9397
}
9498
}

0 commit comments

Comments
 (0)