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

What's the difference between a modifier and a state? #168

Closed
mubaraqwahab opened this issue Oct 26, 2021 · 2 comments
Closed

What's the difference between a modifier and a state? #168

mubaraqwahab opened this issue Oct 26, 2021 · 2 comments

Comments

@mubaraqwahab
Copy link

I came across SuitCSS recently, and I've been wondering what the difference is between a modifier class and a state class.

There's an example in the docs of .Tweet.is-expanded. Could this be .Tweet--expanded instead? Also, there's .Button--default; could it be .Button.is-default instead?

Thank you.

@simonsmith
Copy link
Member

simonsmith commented Oct 28, 2021

Modifiers are a type of the component, state is when something has happened to change it

I want a button, and it's a primary

Button Button--primary

I clicked the button, now it's open

Button is-open

I clicked the primary button, now that is open too

Button Button--primary is-open

Hope that helps

@mubaraqwahab
Copy link
Author

Yes, I understand now. Thank you!

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

2 participants