Prefix css classes to avoid collisions
See original GitHub issueAdding the lib to an existing project using the bootstrap grid results in name collisions on the row
class. It’s easy to imagine situations where node
and tree
may collide with other libraries as well.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:6 (5 by maintainers)
Top Results From Across the Web
How to prefix Bootstrap 4 classes to avoid css classes conflict
To avoid "ANY INSTANCE or CHANCE" of conflict I want to prefix all Bootstrap CSS classes with - let's say - "year19-" prefix....
Read more >Avoiding conflicts - UIkit
By default, all classes and attributes in UIkit start with the uk- prefix. This avoids name collisions when introducing UIkit to existing projects...
Read more >Prefix CSS classes to avoid conflicts (#64) · Issues · OpenLevelUp ...
Add "olu-" prefix for CSS classes in order to avoid conflicts with other styles that can be used when integrating OpenLevelUp in third-party...
Read more >Recommendations for working with CSS in SharePoint ...
... Use CSS modules to avoid styling conflicts; Wrap your CSS styles in a class named after the component; Handling of CSS vendor...
Read more >CSS | single-spa - JS.ORG
This behavior can be undesirable in a microfrontends architecture because it can result in CSS class name collisions between your microfrontends. To avoid...
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
@jkrentz I checked on my demo site, and I didn’t find any class defined for
.row
, only.rst__row
. Can you give me the link to a repo demonstrating the collision, or an explanation of how to set it up?@buzztone The prefix is baked in whenever the library is built. I think it would be up to the plugin creator to “namespace” their customizations by using a different class for the outermost container, something like
.my-package-tree .rst__node { background: #000; }
.I’m using normal CSS module compilation and your answers are exactly what I knew you would say. This concern I mentioned is only a possible concern for the future, and using multiple CSS class names in essentially guaranteeing the CSS of RST stays unalterable, even if requiring copying over the RST CSS rules to multiple CSS class selector rules, is exactly what I was intending to do. Thanks for response!