Skip to content

Instantly share code, notes, and snippets.

@gazjoy
Last active June 25, 2022 13:53
Show Gist options
  • Save gazjoy/3fd841211ccdbd260df1b6b7f10eb1b1 to your computer and use it in GitHub Desktop.
Save gazjoy/3fd841211ccdbd260df1b6b7f10eb1b1 to your computer and use it in GitHub Desktop.
Good Wholesome Names Used in CSS

Naming classes in CSS can be hard, fortunately BEM helps us to define a convention to adhere to.

https://github.com/getchopchop/chopchop/wiki/Best-Practices#bem

Having a mix of singular/plural can cause confusion between team members so just keep it singular!


Block:

- card
- flag
- header
- footer
- domino
- btn/button
- accordion
- tab
- pocket
- panel
- drawer
- modal
- overlay
- title
- field-group
- logo
- qty/quantity
- swatch
- volume
- slider
- carousel
- tag
- badge
- sorter
- select
- toolbar
- stamp
- tray
- shelf
- slab
- media-unit

Element

- header
- body
- footer
- aside
- main
- sub
- dialog
- action
- image
- media

Modifier

- striped
- labelled
- rounded
- bordered
- condensed
- stacked
- primary
- disabled
- success
- error
- inline
- pills
- space

State

- is-
- has-

Utility

- align-left
- align-right
- align-center
- visually-hidden
- hidden
- separator

AVOID

- box
- inner
- outer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment