Skip to content

Instantly share code, notes, and snippets.

@ryankinal
Created December 13, 2011 21:40
Show Gist options
  • Save ryankinal/1474012 to your computer and use it in GitHub Desktop.
Save ryankinal/1474012 to your computer and use it in GitHub Desktop.
Thoughts and points on the "IDs in CSS" issue

The whole ID thing

There is a war going on. In comment threads and chat rooms, we are doing battle.

Here are the arguments against IDs:

  • specificity wars
  • strong coupling
  • code reusability
  • abstraction
  • consistent design/holistic approach

Here are the arguments for IDs:

  • semantics
  • singletons
  • .really-long-arbitrary-name
  • classitis (class="float-right drop-shadow-black bg-red rounded-corner-5 width-narrow")
  • "over-abstraction"
  • "general, abstracted class names based on assumptions about the layout"
  • small site/large site

Here are the arguments for classes:

  • abstraction
  • code reusability
  • consistent design
  • "style guide"
  • ease of specificity?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment