Skip to content

Instantly share code, notes, and snippets.

@MCurran16
Last active February 14, 2019 17:44
Show Gist options
  • Save MCurran16/0325309d5ce2d887b9e0bf6eb817b765 to your computer and use it in GitHub Desktop.
Save MCurran16/0325309d5ce2d887b9e0bf6eb817b765 to your computer and use it in GitHub Desktop.
Css Convention Order
CSS Convention Order
float
position
top
right
bottom
left
width
height
line-height
display
- if display: flex, flex related properties should follow immediately
vertical-align (if inline || inline-block)
margin
padding
box-sizing
border
border-radius
background
overflow
text-align
text-transform
color
font-size
font-weight
font-family
user-select
transition
`my-main-element`: names that have multiple words can be dash delimited or kebab case
`my-main-element__child`: names of nested elements can use the double underscore __ to denote child parent relationship to another class.
`my-main-element__child--left`:
`my-main-element--active`: names of elements that are a permutation can use the double dash -- to denote the permutation. This is a more rare use case but does come in handy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment