angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.18k stars 6.68k forks source link

bug(mat-button-toggle): button-toggle-color variants missing #28860

Closed pgg closed 2 months ago

pgg commented 2 months ago

Is this a regression?

The previous version in which this bug was not present was

No response

Description

no supported color variants

Reproduction

StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-eggtza?file=src%2Fstyles.scss Steps to reproduce:

  1. should not compile. uncomment in styles.scss: @include mat.button-toggle-color($theme, $color-variant: secondary);

Expected Behavior

a mat-button-toggle with color applied or errors similar to the fab example when passing an unsupported variant showing which variants are supported i.e:

✘ [ERROR] Invalid color variant: error. Supported color variants are: primary, secondary, tertiary.
    ╷
172 │     $mdc-extended-fab-tokens: token-utils.get-tokens-for(
    │ ┌─────────────────────────────^
173 │ │       $tokens, tokens-mdc-extended-fab.$prefix, $options...);
    │ └────────────────────────────────────────────────────────────^
    ╵
  node_modules/@angular/material/button/_fab-theme.scss 172:29  -theme-from-tokens()
  node_modules/@angular/material/button/_fab-theme.scss 72:5    color()

Actual Behavior

✘ [ERROR] () isn't a valid CSS value.
    ╷
204 │       _supported-color-variants($tokens, $prefix)
    │       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ╵
  node_modules/@angular/material/core/tokens/_token-utils.scss 204:7            get-tokens-for()
  node_modules/@angular/material/button-toggle/_button-toggle-theme.scss 111:7  -theme-from-tokens()
  node_modules/@angular/material/button-toggle/_button-toggle-theme.scss 38:5   color()

Environment

Angular CLI: 17.3.3
Node: 18.18.0
Package Manager: npm 10.2.3
OS: linux x64

Angular: 17.3.4
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, router

Package                          Version
----------------------------------------------------------
@angular-devkit/architect        0.1703.3
@angular-devkit/build-angular    17.3.3
@angular-devkit/core             17.3.3
@angular-devkit/schematics       17.3.3
@angular/cdk                     17.3.3
@angular/cli                     17.3.3
@angular/material                17.3.3
@angular/material-experimental   17.3.3
@schematics/angular              17.3.3
rxjs                             7.8.1
typescript                       5.3.3
zone.js                          0.14.4
angular-automatic-lock-bot[bot] commented 1 month ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.