Skip to content

Commit

Permalink
fix(material/button): Emit fab tokens under mixin root selector
Browse files Browse the repository at this point in the history
  • Loading branch information
amysorto committed Oct 6, 2023
1 parent 73f7a44 commit 6e1922e
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/material/button/_fab-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,32 +51,36 @@
$disabled: rgba($on-surface, 0.12);
$on-disabled: rgba($on-surface, if($is-dark, 0.5, 0.38));

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

@include button-theme-private.apply-disabled-style() {
@include _fab-variant($on-disabled, $disabled);
:disabled, a[disabled='true'] {
@include button-theme-private.apply-disabled-style() {
@include _fab-variant($on-disabled, $disabled);
}
}

&.mat-unthemed {
.mat-unthemed {
@include _fab-variant($on-surface, $surface);
}

&.mat-primary {
.mat-primary {
@include _fab-variant($on-primary, $primary);
}

&.mat-accent {
.mat-accent {
@include _fab-variant($on-accent, $accent);
}

&.mat-warn {
.mat-warn {
@include _fab-variant($on-warn, $warn);
}
}
Expand All @@ -88,7 +92,7 @@
}

$typography-tokens: tokens-mdc-extended-fab.get-typography-tokens($theme);
.mat-mdc-extended-fab {
@include sass-utils.current-selector-or-root() {
@include mdc-extended-fab-theme.theme($typography-tokens);
}
}
Expand Down

0 comments on commit 6e1922e

Please sign in to comment.