-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Allow finer-grained control of emitted CSS #4227
Comments
I have spent a week or so on evaluating the possibility to apply MDC Web directly or MDC React in my mobile-first application. My impression is that because of this excessive use of SCSS the entire MDC Web is an implementation of MD mainly for static websites. It is not really OK for highly dynamic mobile applications, because the nature of SCSS. For example, to define the colors, themes or the number of columns for an image list in MDC Web, you can do that only fiddling with SCSS. This is really unacceptable for mobile app development. I think framework should hide the intricacies of SCSS/CSS. So, my question is that are you planning to replace SCSS with a more flexible, runtime, dynamic styling technology? Is this the reason you have ejected thee MDC Web components? |
To expand on what @nemethmik brought up, I'm curious if your team has considered using a CSS-in-JS approach for styles (e.g., JSS)? If not for MDC-Web, what about for MDC-Web-React (e.g., Styled Components)? I'm starting to get the feeling that SASS may not be the strongest overall styling approach these days (and could address some of the points that @nemethmik brought up), but I'd like to hear your thoughts. |
Adds support for style feature targeting to the `slider` package. Relates to material-components#4227.
Adds support for feature targeting to the `mdc-snackbar` styles. Relates to material-components#4227.
Adds support for feature targeting to the mdc-drawer styles. Relates to material-components#4227.
Adds support for feature targeting to the `mdc-drawer` styles. Relates to material-components#4227.
Adds support for feature targeting to the `mdc-snackbar` styles. Relates to material-components#4227.
Adds support for feature targeting to the `mdc-drawer` styles. Relates to material-components#4227.
Adds support for style feature targeting to the `slider` package. Relates to material-components#4227.
Adds support for style feature targeting to the `slider` package. Relates to material-components#4227.
Adds support for feature targeting to the mdc-linear-progress styles. Relates to material-components#4227.
Adds support for feature targeting to the mdc-linear-progress styles. Relates to material-components#4227.
Adds support for feature targeting to the mdc-linear-progress styles. Relates to material-components#4227.
Adds support for feature targeting to the `mdc-floating-label` styles. Relates to material-components#4227.
Adds support for feature targeting to the `mdc-notched-outline` styles. Relates to material-components#4227.
Adds support for feature targeting to the `mdc-notched-outline` styles. Relates to material-components#4227.
Adds support for feature targeting to the `mdc-line-ripple` styles. Relates to material-components#4227.
Adds support for feature targeting to the `mdc-notched-outline` styles. Relates to material-components#4227.
Adds support for feature targeting to the `mdc-floating-label` styles. Relates to material-components#4227.
Adds support for feature targeting to the `mdc-floating-label` styles. Relates to material-components#4227.
Sets up feature targeting for the text field and its related styles. Relates to material-components#4227.
Sets up feature targeting for the text field and its related styles. Relates to material-components#4227.
Sets up feature targeting for the text field and its related styles. Relates to material-components#4227.
Sets up feature targeting for the text field and its related styles. Relates to material-components#4227.
Sets up feature targeting for the text field and its related styles. Relates to material-components#4227.
Sets up feature targeting for the text field and its related styles. Relates to material-components#4227.
Sets up feature targeting for the text field and its related styles. Relates to material-components#4227.
Sets up feature targeting for the text field and its related styles. Relates to material-components#4227.
In the past, we've received requests (such as #3357) for ways to better control what CSS is output by MDC Web. Being able to more granularly control what CSS we output also has the potential to help prospective framework wrappers that also want to govern output styles.
To this end, @mmalerba has worked on a prototype which would allow selectively including MDC Web's styles either all at once or piece-by-piece, with the ability to request the following subsets:
Miles' POC, along with a bit of fine-tuning and infrastructure work, is in #4228.
The end result of this is that existing usage of MDC Web will behave exactly the same - no existing mixin APIs change, nor does the output CSS if you continue to import
@material/foo/mdc-foo
. But you will also have the option of@include mdc-foo(...)
and specifying a query of one or more subsets of the component's styles.Since these changes are intended to be fully backwards-compatible, we can merge these PRs to master one by one. We should also be able to check CSS output on master vs. on the branch and verify that the results are the same (run
npm run build
on each one and move the folder somewhere to be diffed afterwards).The following components have emitted styles that will need to be converted:
mdc-theme-prop
not accepting$query
on purpose; emitted styles in feat(feature-targeting): target top-level styles for elevation, ripple, #4383)As with #4225, it may be best to leave textfield-related things until last:
Bear in mind that some of these may have cross-dependencies, which will require at least partial conversions of other packages as well, so I've attempted to front-load any likely dependencies as possible (I think ripple is really the main one, and that's already been largely tackled as far as it needs to be for other components to use it). The first PR converts button fully, and ripple partially (mostly).
We should skip the following since they're deprecated (and likely to be removed as part of #4225):
The text was updated successfully, but these errors were encountered: