Skip to content
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

ID vs. Class? #1

Closed
ericclemmons opened this issue Mar 7, 2015 · 1 comment
Closed

ID vs. Class? #1

ericclemmons opened this issue Mar 7, 2015 · 1 comment
Assignees

Comments

@ericclemmons
Copy link

Would it be worth adding an option for the output styles to prefix an ID (e.g. #Style-4n412lnmi) instead of a class (.Style-4n412lnmi)?

Scenario being, IDs will absolutely clobber any other specificity, which is normally bad, except in one instance: when you need to sandbox styles for a component.

Right now, to do this, you can either:

  • Wrap your component an in <iframe> & deal with 10x more problems.
  • Prefix your styles with an ID # and using something like normalize.css to reset all child elements.

This way, any existing styles on the page are pretty much guaranteed not to affect your component. This is ideal for when distributing a solution like:

https://stripe.com/docs/checkout

Interesting in your thoughts!

@RickWong
Copy link
Owner

RickWong commented Mar 7, 2015

There's an update here: https://github.com/RickWong/react-isomorphic-starterkit/blob/49e56b2263392b6682696599026de9b3ce8994d7/src/views/Style.jsx

Haven't had the time to update this package. Probably will have to rename it too since there's another package that goes by the same name.

@RickWong RickWong self-assigned this Mar 7, 2015
@RickWong RickWong closed this as completed Mar 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants