Skip to content

Instantly share code, notes, and snippets.

@alexilyaev
Last active November 5, 2015 22:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexilyaev/af8341d32cb5fdd58ddb to your computer and use it in GitHub Desktop.
Save alexilyaev/af8341d32cb5fdd58ddb to your computer and use it in GitHub Desktop.
Naming Conventions

CSS

Use dash-cased class names

  • It's consistent with CSS property naming convention
.some-class-name {}

Do not use ID's for styling

  • ID's are not modular and quickly run into specifity issues
  • It's better to leave them for JS identifiers, and only use class names for styling

Namespace all class names to avoid collisions

  • Usually company initials
.ns-sidebar {}

Namespace with module prefix

.ns-admin-sidebar {}

Use HTML hierarchy when possible

.ns-admin-sidebar > header {}

No cascading (?)

No overriding (?)

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