Page MenuHomePhabricator

Illustrate tokens
Closed, ResolvedPublic

Description

Create storybook pages to show tokens.

Grouping (in this order) of all Storybook parts should look like this:

(global tokens are marked with an asterisk)

  • Visual Guide
    • Colors (we know it’s technically redundant but it’s good for consistency) - they are basically the WMF color palette
    • Typography
    • Spacing
    • Iconography
  • Components
    • Button
    • Dropdown
    • ...
  • Design Tokens
    • *Colors - all global colors (base); providing hex is enough; having rgba can be done in the future if we see a benefit
    • *Opacity (T?)
    • Background colors
    • Borders T257057
      • Border style (contains: *border style, border widths and border radius)
      • Border colors
    • Text colors
    • Font family (contains: *global font-family (T256852), font family per text style)
    • Font weight (contains: *global font-weight (T256852), font weight per text style)
    • Font size (contains: *global font sizes (T256852), font sizes per text style)
    • Line height (contains: *global font sizes (T256855), font sizes per text style)
    • Dimensions
      • *Static sizes (T256854)
      • Paddings (contains: padding + internal paddings)
      • Heights and widths (contains: min-heights and predefined widths)
    • *Width breakpoints (T256856)
    • *Shadows (T256858)
    • *Transitions (contains: duration, property) (T256859)
    • *Z-index (T256860)
    • *Cursors (T256861)
    • Icons
      • Icon sizes
      • Icon colors

Visualizing the connection between tokens (if any):

NameSourceExample
$token-name$source-token-nameillustrated value (if possible) + the css value

Table with columns: Name, Source, Example (holds the value and visual example, e.g. color square)
where
Name is the name of the token
Source is the tokens the alias refers to ( e.g. global tokens)
Example - a visual representation of the token (if possible) and under it the actual css value
Making the source a link to the actual token is not a hard requirement. It’s more of an improvement if we find it’s easy to achieve.

Acceptance criteria:

    • The tokens are grouped as visualized in the list above. The order of pages is also as it is shown in the list, e.g. Font Family comes before Font Weight.
    • The connection between tokens is expressed as visualized in the table above
      • The source token being a link is not a hard requirement, because the value of the token is visible. It is a nice to have if it is easily achievable
    • Visualize the token value as an element if possible: colors can be filled squares, font can be letters (Aa), spacing can be black squares. E.g. https://www.lightningdesignsystem.com/design-tokens/
  • Component level tokens are not visualized in the Design System Tokens pages. They will be later shown as part of the comopnent stories, or not at all. TBD.

Open questions:

Related Objects

Event Timeline

Tonina_Zhelyazkova_WMDE renamed this task from Illustrate tokens: type "color" to Illustrate tokens.Jun 24 2020, 2:55 PM
Tonina_Zhelyazkova_WMDE updated the task description. (Show Details)

Hello, @Tonina_Zhelyazkova_WMDE, @Jakob_WMDE and @Pablo-WMDE

While checking T257065, I detected three (apparently small) corrections related to token visualization. I'll list them here, so me can decide how/where/when to tackle them:

  1. All titles should be capitalized

Screenshot 2020-07-13 at 12.33.32.png (112×272 px, 8 KB)

  1. There's an extra dash in the token names of font style aliases, which should be "font-xxx-style-hn ". Unless the tokens file has been modified, the original object structure is (e.g.) font.weight.style.h1

Screenshot 2020-07-13 at 12.34.27.png (35×183 px, 6 KB)

  1. Now that alias tokens have been added to the Font>Family page, the longitude of the value of sans families is affecting readability of these longer alias names (global token names are shorter, so they didn't fit that bad within the constrained column). Is it possible to insert a line break to the text value of all the sans families? Not sure whether Storybook allows. In case it does, I'd say it could go after 'Roboto'. This way, the token names' column would not be so tight, making them readable again.

Screenshot 2020-07-13 at 12.43.00.png (285×1 px, 44 KB)

Thanks!