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

[MDCTheme] Theme.Property mixin not correctly using theme keys (primary, secondary, etc.) #6158

Closed
aisgbnok opened this issue Jun 27, 2020 · 2 comments · Fixed by #6161
Closed
Assignees
Labels

Comments

@aisgbnok
Copy link

aisgbnok commented Jun 27, 2020

Bug report

When attempting to use the theme.property mixin with an MDC Theme key (primary, secondary, etc.) the build fails.
However theme.prop which is now deprecated works correctly.

Steps to reproduce

  1. Use theme.property mixin with MDC Theme key (primary, secondary, etc.)
    Example: @include theme.property(border-color, primary);
  2. See error

Actual behavior

The build fails with output:

SassError: Undefined variable.
   ╷
94 │     $custom-prop: custom-properties.create(--mdc-theme-#{$style}, $fallback);
   │                                                          ^^^^^^
   ╵
  node_modules\@material\theme\_mixins.scss 94:58  property()

Expected behavior

theme.property will correctly use MDC Theme keys with output:

border-color: #6200EE;
border-color: var(--mdc-theme-primary, #6200EE);

when using @include theme.property(border-color, primary);

Environment:

Software Version(s)
MDC Web 7.0.0
Browser Chrome 83
Operating System Windows 10 (2004)
@aisgbnok aisgbnok added the bug label Jun 27, 2020
@aisgbnok aisgbnok changed the title [MDCTheme] Theme.Property mixin not correctly using theme variables (primary, secondary, etc.) [MDCTheme] Theme.Property mixin not correctly using theme keys (primary, secondary, etc.) Jun 28, 2020
@allan-chen
Copy link
Collaborator

Hi Anthony,

Thanks for filing the issue - it seems that $style may need to be $value instead - adding @asyncLiz to confirm.

@allan-chen allan-chen assigned allan-chen and asyncLiz and unassigned allan-chen Jun 29, 2020
@asyncLiz
Copy link
Contributor

Confirmed!

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