Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symmetric API for the Angular Material Icon Button #8105

Open
fireflysemantics opened this issue May 18, 2023 · 1 comment
Open

Symmetric API for the Angular Material Icon Button #8105

fireflysemantics opened this issue May 18, 2023 · 1 comment

Comments

@fireflysemantics
Copy link

For all the buttons in Angular Material we can delegate to the helper mixins in MCW, except for the icon button.

It has a helper function, but the API is not symmetric with respect to the API offered for the other button types. Created a separate issue for this within the Angular Material repository that elaborates further..

Ideally we would be able to delegate to @material/icon-button/icon-button-theme for color extension mixins like this one:

/**
 * The MDC API is not symmetric with respect to the other button theme helper mixins
 */
//@use '@material/icon-button/icon-button-theme' as mdc-icon-button-theme;
@use './el-x-icon-button-theme' as el-x-icon-button-theme; 
@use '../common/' as *;

@mixin icon-variant($color-class, $color) {
  &.#{ $color-class } {
    @include el-x-icon-button-theme.theme((
      icon-color: $color
    ));
    color: var(--mdc-icon-button-icon-color);
    @include ripple-color($color);
  }
}
@fireflysemantics
Copy link
Author

Wrote an article illustrating the approach I'm using to extend the Angular Material button components. I'm hoping in the future I'll be able to delegate the work done by the ripple-color mixin and the el-x-icon-button-theme mixin to corresponding mixins in Material Components Web.

https://fireflysemantics.medium.com/theming-pattern-for-extending-angular-material-components-f0c61b8d355

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant