-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat(material-experimental/mdc-dialog): switch to new theming api #23620
Conversation
6bc712d
to
1e153e2
Compare
// Theme map with values for variables that will be overriden in the theme. | ||
// MDC's theming system requires non-null values for the slots to be inserted | ||
// and included as default values. | ||
$dialog-initial-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.
Do we actually need this? For the other components MDC provided a $light-theme
with some default values that I used outside for the theme-styles
mixin.
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.
Also if we do end up keeping this variable, the name should be with an underscore so that it isn't exported by Sass.
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.
Unfortunately yes - their variable contains the keys but with null values, which means their theme mixin skips inserting the slots. They plan to eventually provide a variable with filled values, but not until at least a couple quarters from now.
Changed variable name to underscore-prefix - thanks for catching that
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.
Here's their variable definition - https://github.com/material-components/material-components-web/blob/master/packages/mdc-dialog/_dialog-theme.scss#L36
They say that null (or any other falsy) values don't insert slots for backwards compatibility reasons. I wish that wasn't the case
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.
Hmm, that is unfortunate and a little fragile since we won't have a way of knowing when they introduce a new variable.
1e153e2
to
2a6a53b
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
// Theme map with values for variables that will be overriden in the theme. | ||
// MDC's theming system requires non-null values for the slots to be inserted | ||
// and included as default values. | ||
$_dialog-initial-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.
How much of this can we extract into a common location shared between multiple components? E.g. container-color
and supporting-text-color
seem like they'd be the common surface and on-surface colors for a lot of components.
… api (angular#23620)" This reverts commit 353a548.
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. |
Applied the values for the theming by isolating the theme color/typography styles included in the current mixin. Should match the existing styles, and I'll run an internal presubmit to double-check this is a no-op