-
Notifications
You must be signed in to change notification settings - Fork 222
Naming of Things
Viljami Salminen edited this page Mar 8, 2018
·
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:
- Verb Rather Than Noun: To understand the purpose, focus on what it does rather than what you think it is. This helps us broaden potential use cases as well as define its purpose more accurately.
- 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
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-
orspace-
. If you have subcategories, include them in the naming as well and separate with hyphen, Example:color-primary-
orcolor-secondary-
. - Element, Pattern & Templates: Names don’t have a prefix, but should be multiword or otherwise compatible with existing and future HTML elements.
Vue Design System uses the following convention:
-
Default: The default unit is always called
base
. -
Smaller than default: When you want to define a size that is smaller than
base
it should be named eithersmall
,x-small
,xx-small
and so on. -
Larger than default: When you want to define a size that is larger than
base
we uselarge
,x-large
,xx-large
and so on. A concrete example of this looks like:
font_size_xx_large:
value: "64px"
font_size_x_large:
value: "48px"
font_size_large:
value: "24px"
font_size_base:
value: "16px"
font_size_small:
value: "13px"
font_size_x_small:
value: "11px"
font_size_xx_small:
value: "8px"
Vue Design System uses the following convention:
-
Default: The default base color is always called
color-{name}
. -
Darker than default: When you want to define a shade, use either
color-{name}-dark
,color-{name}-darker
orcolor-{name}-darkest
. -
Lighter than default: When you want to define a tint, use
color-{name}-light
,color-{name}-lighter
,color-{name}-lightest
and so on. A concrete example of this looks like:
color_red_darker:
value: "hsla(7, 83%, 33%, 1)"
color_red_dark:
value: "hsla(7, 83%, 43%, 1)"
color_red:
value: "hsla(7, 83%, 53%, 1)"
color_red_light:
value: "hsla(7, 83%, 63%, 1)"
color_red_lighter:
value: "hsla(7, 83%, 73%, 1)"
Read also Terminology section which is closely tied to “Naming of Things”.
- Getting Started: How to install and run Vue Design System.
- Terminology: Introduction to the system concepts and its hierarchy.
- Naming of Things: Naming is hard, so it’s good to have clear guidelines.
- Directory Structure: What goes where and why.
-
Working with the System: Concrete examples on how to work with
Tokens
,Elements
,Patterns
andTemplates
. - Editing Living Documentation: How to customize the living system documentation.
- Spacing: A framework for creating a predictable and harmonious spacing.
- Component Status: Clear labels that reflect the state of completion.
- Component QA: How to review new components and keep the quality high.
- Contributing: A set of guidelines for contributing to the system.
- Code of Conduct: By participating you agree to abide by its terms.
- Frequently Asked Questions: How to use icons, how to use font-face, etc.
- Changelog: See releases pafge for the full changelog.