This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat(theme): Add support for CSS vars with fallback #4470
feat(theme): Add support for CSS vars with fallback #4470
Changes from 11 commits
5d49c5a
7d985e2
fd51863
195bcba
7c1cd33
a43e2ff
bdebc93
45161a9
f5dfc59
ef5d84f
a0293a0
65a61b0
e58979e
5643f95
b92a208
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Returning the new style type as is causes an issue to other mixins that uses
mdc-theme-prop-value()
function. For example,mdc-card-outline
uses this function to set border-color. mdc-card/_mixins.scss:L303There 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.
Can we update that line to be as follows?
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.
List divider uses the approach described above. I'll include that update in this PR.
material-components-web/packages/mdc-list/_mixins.scss
Line 360 in b9c5fc6
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 confused though, what issue was this causing? Do we need to be concerned for existing valid cases of mdc-theme-prop-value being used?
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.
It is still an issue if component needs to mix colors or apply opacity using
rgba()
sass function.For example, dialog uses
rgba()
to apply opacity to color.dialog/_mixins.scss:
Where,
mdc-theme-prop-value
returns new color format which rgba function doesn't support.This is another advanced use case where text field uses
mix()
function two mix two colors:textfield/_variables.scss:
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.
@kfranqueiro It shouldn't break existing valid usage. This is an issue only for users who send new color format to component's mixins.
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.
mdc-theme-prop-value
has been updated to always return the fallback value.material-components-web/packages/mdc-theme/_variables.scss
Lines 131 to 138 in e58979e