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

Consideration for prefixes #32

Open
davidkpiano opened this issue Nov 19, 2015 · 6 comments
Open

Consideration for prefixes #32

davidkpiano opened this issue Nov 19, 2015 · 6 comments

Comments

@davidkpiano
Copy link

I've been using RSCSS exclusively in my latest projects, with great success. However, instead of using the two-word rule for components, I prefix all of my components, such as .my-button or .foo-modal.

This gives a few benefits:

  • Namespacing - eliminates naming collisions
  • Prefixes help easily identify which styles are "yours" rather than 3rd-party styles
  • No more need to think of a two-name class. Prefixes are the first name.

What do you think? Maybe it's worth mentioning in the docs?

@rstacruz
Copy link
Owner

What was the prefix in those examples? .my-?

@davidkpiano
Copy link
Author

Well, it's on a per-project basis. Typically two- or three-letter prefixes.

@rstacruz
Copy link
Owner

like:

.sg-paragraph
.sg-alert
.sg-message

and so on?

@davidkpiano
Copy link
Author

Yep!

@damsorian
Copy link

+1 prefixes referring to ownership like .myname-componentname

@kminek
Copy link

kminek commented Feb 26, 2018

doing the same, i'm currently using app prefix: .app-button and so on :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants