Skip to content

Commit

Permalink
fix(material-experimental/mdc-button): narrow down overly-broad selec…
Browse files Browse the repository at this point in the history
…tor (#20969)

Fixes a selector that was targeting all icons on the page, rather than ones inside a button.

(cherry picked from commit 92bb1c8)
  • Loading branch information
crisbeto authored and annieyw committed Nov 7, 2020
1 parent d868717 commit 17ef700
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/material-experimental/mdc-button/fab.scss
Expand Up @@ -16,16 +16,17 @@
background: transparent;
opacity: 1;
}
}

// MDC expects the fab icon to contain this HTML content:
// ```html
// <span class="mdc-fab__icon material-icons">favorite</span>
// ```
// However, Angular Material expects a `mat-icon` instead. The following
// will extend the `mdc-fab__icon` styling to the mat icon. Note that
// the extended styles inherently only match icons that nest themselves in
// a parent `mdc-fab`.
.mat-icon {
@extend .mdc-fab__icon;
// MDC expects the fab icon to contain this HTML content:
// ```html
// <span class="mdc-fab__icon material-icons">favorite</span>
// ```
// However, Angular Material expects a `mat-icon` instead. The following
// will extend the `mdc-fab__icon` styling to the mat icon. Note that
// the extended styles inherently only match icons that nest themselves in
// a parent `mdc-fab`.
.mat-icon {
@extend .mdc-fab__icon;
}
}

0 comments on commit 17ef700

Please sign in to comment.