Rewrite to RSCSS
See original GitHub issueBEM 💩 👎
<div class="mdc-layout-grid">
<div class="mdc-layout-grid__cell mdc-layout-grid__cell--span-6 mdc-layout-grid__cell--span-8-tablet"></div>
</div>
RSCSS 👀 👍
<div class="mdc-grid">
<div class="cell -span-6 -span-8-tablet"></div>
</div>
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Rewrite assets paths in CSS/SASS/SCSS in webpack
I tried using resolve-url-loader but it doesn't do anything. How do I get urls to be rewritten to the right path? css ·...
Read more >Frontend recipes RSCSS | Mashup Garage Playbook
Good thing we follow a great CSS practice called RSCSS. ... They are usually used to change the look and behaviour of the...
Read more >CSS URL Rewriting | Laravel Mix Documentation
One key concept to understand is that Mix and webpack will rewrite any url() s ... mix.sass('src/app.scss', 'dist', { // Rewrite CSS urls...
Read more >broken scss url rewrites with scss variables #5337 - vitejs/vite
Describe the bug When an imported scss file has variable url($foo) links, they get badly rewritten: scss-import-test/index.scss: $default-image-1: ...
Read more >Sass, SCSS, and Less | WebStorm Documentation - JetBrains
Compiling SCSS into CSS: creating a File Watcher ... Let's change grid.scss, for example, replace margin-left: 0; at line 31 with ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As @Garbee explained, this was a conscious design decision by the material-components-web team. While BEM classnames are admittedly more verbose, they greatly reduce the chance of conflict when used together with other third-party libraries as well as your own styles, and also promote lower specificity selectors in general.
In contrast, using the RSCSS example above, it’d be very easy for multiple libraries or your own code to coincidentally define styles for the same selector (e.g.,
.cell
) and end up in conflict with each other. It also seems to advocate nesting selectors to a higher degree, which has the potential to cause additional difficulties when the need arises to override styles.Avoiding conflicts and difficulties with other code is crucial for a library like MDC Web, which is designed to be usable regardless of what other JS or CSS frameworks you may also be using. We appreciate the suggestion, but in this particular case, we have strong reasons for having chosen BEM.
RSCSS due to having non-namespaced classes internally can lead to collisions with external code that could be pulled in. BEM was a specific design choice for the API since it namespaces everything provided into isolated components that have the least chance for external collisions.
If you’d like to use an RSCSS setup in your app, you have Sass available to write your own API layer.