question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prefix css classes to avoid collisions

See original GitHub issue

Adding 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:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
fritz-ccommented, Aug 7, 2017

@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; }.

0reactions
stephenc222commented, Aug 8, 2017

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found