Skip to content

Naming of Things

Viljami Salminen edited this page Nov 4, 2017 · 17 revisions

We use the names to communicate about Tokens, Elements, Patterns and Templates. Hence, they must be short, meaningful and pronounceable. Each name must be:

  • Multiword: Names should be most of the time multi-word, except for root App component: This prevents conflicts with existing and future HTML elements, since all HTML elements are a single word.
  • Meaningful: Not over specific, not overly abstract.
  • Short: Maximum of 2 or 3 words.
  • Pronounceable: We want to be able talk about them.
  • Custom element spec compliant: Don’t use reserved names. Reserved names include:
 * annotation-xml      * color-profile
 * font-face           * font-face-src
 * font-face-uri       * font-face-format
 * font-face-name      * missing-glyph

Prefixing Names

There are a few rules around prefixing things, that you’ll want to follow to keep the system consistent:

  • Tokens: Token names always start with a category name and a hyphen. For example color- or space-. If you have subcategories, include them in the naming as well and separate with hyphen, Example: color-primary- or color-secondary-.
  • Element, Pattern & Templates: Names don’t have a prefix, but should be multiword or otherwise compatible with existing and future HTML elements.
Clone this wiki locally