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

How do you differentiate between an object and component in BEM? #243

Open
maoberlehner opened this issue Sep 15, 2016 · 0 comments
Open
Assignees
Labels

Comments

@maoberlehner
Copy link
Member

I get asked this quite a lot, and it is actually quite hard to explain.As a general rule: if a user can identify it, it’s probably a component; if it’s private to developers (e.g. your grid system) it’s probably an object. I think the best way to differentiate is like this:

An object:

  • is purely structural: it only provides structure and scaffolding (e.g. a grid system)
  • has no cosmetics: they can’t have font-sizes, colours, etc. applied to them
  • is ‘invisible’: objects don’t actually look like anything identifiable

A component:

  • actually looks like a thing: users can usually name components (e.g. a button, a carousel).
  • usually encapsulates a piece of functionality (e.g. a date picker).
  • has (structure and) cosmetics: components introduce colours, font styles, etc.
@maoberlehner maoberlehner self-assigned this Oct 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant