Background
Coming from T288383: Decide on design tokens architecture for Wikimedia Design System and its shared component library, we've settled on agreements in the Vue.js designer workshop and the sequential task force for our tokens architecture.
This task is about designing and defining a set of "design tokens" for the Wikimedia Design System.
Design tokens are essentially variables that define the various visual aspects of our design system — specifically, they are entities in a scalable nomenclature, that store smallest visual design values. We use them in place of hard-coded values (such as hex values for color or pixel values for spacing) in order to combine them into a scalable and consistent system for UI development.
User stories
- As an engineer, I need design tokens defined for our system so that I can build assets, components and patterns at a sustainable scale (without having to manually define this repeated specs) while securing consistency across our platforms.
- As a designer, I need repeatable design elements (such as UI colors and spacing) defined, so that I can use them in my mockups and communicate how they should be implemented to engineers.
Requirements
These token definitions are for desktop and mobile web platforms, but are also aimed to be used for mobile apps in future.
Acceptance criteria for Done
Design
- Decide on design tokens architecture for Wikimedia Design System and Codex T288383
- T295991: Define and document the visual guidelines for styles/design tokens of the Codex design system in Figma
- Integrate tokens in Components Overview Figma file - all of the token names, values and examples per component/pattern T295606
Development, and dev experience
- Implement Codex tokens sub-package – continuously updated tokens representing the design Figma components overview definitions.
- Implement tokens in Codex (done via Amazon Style dictionary by @Tonina_Zhelyazkova_WMDE and as workspace package in Codex monorepo). Further Codex packaging discussion at T294993
- Add “WikimediaUI theme” choice (global raw value collection) tokens to Codex package T296651
- Provide and clearly mark “legacy” design tokens, possibly as different theme T288110
- Add base tokens representing design decisions to Codex token package T296651
- Use Codex tokens in Codex components code T297765
- Lint against not using tokens in Codex styles T322388
- T322274: [Epic] Publish the design-tokens package in NPM
Tokens capabilities
- T324367: Enable Codex tokens to work with different font sizes (as preface for usage in Vector and MinervaNeue)
Codex hygenie
- T295711: Turn component-specific (SFC) Less variables into Codex design tokens
- T305411: Codex demo CSS should use default theme 'WikimediaUI' design tokens
Usage of Codex tokens beyond Vue component repository (in priority)
- 1. T318016: Provide a way to inject Codex tokens into WikimediaUI Base variables, while later are widely used
- 2. T325237: Enable and document use of Codex design tokens within MediaWiki
- 3. T332541: Replace mediawiki.ui variables with mediawiki.skin.variables
- 4. T334934: [EPIC] Replace WikimediaUI Base variables with Codex design tokens (mediawiki.skin.variables)
Documentation
- Protocol for designing future tokens (aka governance model) T295605
- Documentation for designing tokens – for designers and engineers on definition and usage T295605
- List/visualize design tokens in Codex's demo site T295843
- T297923: Tokens visualization: Show only decision tokens
- T305272: docs: Redesign color tokens demo to show color palette
Testing
The workflow for finding and using a token is tested with designers and engineers. Example feedback was provided at T309050.
TBD - a protocol should be written for a new engineer and designer who are trying to use tokens for the first time in their respective workflow.
Rough structure:
- Follow Figma template in tokens definition
- Ensure that component is applying available tokens and don't define tokens or non-tokenized values in single file components (SFC) itself or use static design values
- Report back gaps or token overrides to Design System designers
- Follow further QA component process