Skip to content
Browse files

CSS styleguide: Another example of why to avoid IDs

Not doing this via a PR since it's not a new rule, just more info on an existing one.
  • Loading branch information
henrik committed Jan 27, 2020
1 parent 7043d88 commit cca379736312ae07489ebf848054406a4c2edf59
Showing with 2 additions and 0 deletions.
  1. +2 −0 styleguide/css/
@@ -201,6 +201,8 @@ They are ["specificity anomalies"](, making it

They also discourage modular CSS, as they're only intended to be used once per page.

Sometimes, even a "unique" element may be included twice on a page, e.g. if we show different parts at different viewport sizes.

And for JS, we prefer to [use CSS classes with a `js-` prefix](#use-a-js--prefix-for-classes-used-by-js).

0 comments on commit cca3797

Please sign in to comment.
You can’t perform that action at this time.