Handling names when propagating config from an all-in-one module to individual components
See original GitHub issueMDC Web has an all-in-one package, including an scss file which currently imports all of the individual component packages and emits all their styles.
I suspect this gets far more use via its distributed CSS rather than running it through a preprocessor, but if someone were to @use
this file, IIUC if we were to @forward
each of the individual MDC package imports, it would also forward any with
configuration to all of them?
This raises a potential question in terms of namespacing with
configuration. For example, the names primary
and secondary
make sense when directly consuming @material/theme
(referring to primary and secondary theme colors), but may be ambiguous in the context of the entire material-components-web
library.
This probably seems like an edge case, but has any thought been given to some way to map variable names when @forward
ed?
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
We could probably do
show * as button-*
, yeah. I don’t think we’d need to have an equivalentwith
statement; as long as@forward
forwards/renames variables,with
should just work with the new names.Ah, I think I understand now.
Yeah, that’s right. As far as any users of
material-components-web
are concerned, the theme variable always has the same name whether it’s being accessed, set, or configured usingwith
.