-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix: errors when building theme using CSS variables #15140
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
Conversation
9250ab6
to
f665356
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM on the bazel/gulp stuff.
._demo-css-variables-theme { | ||
$palette: mat-palette($mat-blue-grey); | ||
$theme: mat-dark-theme($palette, $palette, $palette); | ||
@include angular-material-theme(replace-all-values($theme, var(--test-var))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious how things would actually look with the changes you've made, could we make a similar function that stores off the current values in the map (e.g. --test-var-#{n}: $value
) and then updates the map with variables referring to the original value (e.g. var(--test-var-#{n})
). That way we could compare how the app looks with the original theme and with the variable alias theme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to get it to work, but I'd rather get this in first so we don't continue introducing new failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it doesn't make things any worse for users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
$badge-opacity: opacity($badge-color); | ||
background: mix($app-background, rgba($badge-color, 1), (1 - $badge-opacity) * 100%); | ||
|
||
@if (type-of($badge-color) == color and type-of($app-background) == color) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment along the lines:
// If the given color is actually a color *type*, we _____. If the given background is not
// specifically a color (e.g. a css variable), use it directly.
(similar elsewhere)
* Adds an extra theme to the build that will allow us to verify that everything still works if somebody passes in the palette colors as CSS variables. * Fixes a handful of places where Sass would either throw an error or would produce invalid CSS. Fixes angular#15107.
f665356
to
c2c57c8
Compare
* Adds an extra theme to the build that will allow us to verify that everything still works if somebody passes in the palette colors as CSS variables. * Fixes a handful of places where Sass would either throw an error or would produce invalid CSS. Fixes #15107.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fixes #15107.