|
| 1 | +.. _Design Tokens: |
| 2 | + |
| 3 | +Design Tokens |
| 4 | +############# |
| 5 | + |
| 6 | +What are Design Tokens? |
| 7 | +*********************** |
| 8 | + |
| 9 | +Design tokens are all the values needed to build and maintain a design system — |
| 10 | +spacing, color, typography, object styles, etc. They can represent anything |
| 11 | +defined by the design: color as an RGB value, opacity as a number, spacing as a |
| 12 | +REM value. They are used instead of hard-coded values to provide flexibility and |
| 13 | +uniformity across the application. |
| 14 | + |
| 15 | +By defining style properties as tokens, we can transform the styles into various |
| 16 | +implementations compatible with different platforms or formats (e.g., |
| 17 | +transforming tokens to CSS variables, CSS utility classes, and eventually |
| 18 | +mobile). |
| 19 | + |
| 20 | +Paragon uses `style-dictionary <https://github.com/style-dictionary/style-dictionary>`_ to build design tokens into CSS variables. |
| 21 | + |
| 22 | +Background & Motivation |
| 23 | +*********************** |
| 24 | + |
| 25 | +Design tokens debuted as the primary theming mechanism in the Ulmo release (January 2026), and was available for beta testing in the Open edX Teak release (June 2025). |
| 26 | + |
| 27 | +.. warning:: |
| 28 | + |
| 29 | + There will be no overlap between the old SCSS-variable theming system and Design Tokens. Site operators must prepare migration strategies in advance. |
| 30 | + |
| 31 | +**Background reading:** |
| 32 | + |
| 33 | +* `Scaling Paragon's styles architecture with design tokens (Confluence) <https://openedx.atlassian.net/wiki/spaces/BPL/pages/3630923811/Scaling+Paragon+s+styles+architecture+with+design+tokens>`_ |
| 34 | +* `ADR: design tokens implementation in Paragon <https://github.com/openedx/paragon/blob/master/docs/decisions/0019-scaling-styles-with-design-tokens.rst>`_ |
| 35 | +* `November 2024 Open edX meetup presentation slides <https://docs.google.com/presentation/d/1FOSbTUTbbzaBoIDYMa5s32in1uFoYWdoQ-GjKk5IRBo/edit?usp=sharing>`_ |
| 36 | +* `Teak design tokens wiki (includes test branches) <https://openedx.atlassian.net/wiki/spaces/BPL/pages/5050499077/Using+Teak+Design+Tokens+branches>`_ |
| 37 | + |
| 38 | +Reference Links |
| 39 | +*************** |
| 40 | + |
| 41 | +* :ref:`Release note (Ulmo) <Ulmo Design Tokens>` |
| 42 | +* `Paragon tokens source (release-23.x) <https://github.com/openedx/paragon/tree/release-23.x/tokens>`_ |
| 43 | +* `Paragon README: Design Tokens section <https://github.com/openedx/paragon/tree/release-23.x?tab=readme-ov-file#design-tokens>`_ |
| 44 | +* `brand-openedx (interface definition) <https://github.com/openedx/brand-openedx>`_ |
| 45 | +* `brand-openedx: design tokens how-to <https://github.com/openedx/brand-openedx/blob/main/docs/how-to/design-tokens-support.rst>`_ |
| 46 | +* `sample-plugin/brand (purple example) <https://github.com/openedx/sample-plugin/tree/main/brand>`_ |
| 47 | +* `elm-theme (production example) <https://github.com/edx/elm-theme>`_ |
| 48 | +* `tutor-contrib-paragon <https://github.com/openedx/openedx-tutor-plugins/tree/main/plugins/tutor-contrib-paragon>`_ |
| 49 | +* `frontend-platform theming docs <https://github.com/openedx/frontend-platform/blob/master/docs/how_tos/theming.md>`_ |
| 50 | +* :ref:`OEP-0048: Brand Customization <openedx-proposals:OEP-48 Brand Customization>` |
| 51 | +* `style-dictionary docs <https://amzn.github.io/style-dictionary/#/>`_ |
| 52 | +* `W3C Design Tokens Community Group spec <https://tr.designtokens.org/format/#abstract>`_ |
| 53 | +* `Confluence: Background/motivation <https://openedx.atlassian.net/wiki/spaces/BPL/pages/3630923811/Scaling+Paragon+s+styles+architecture+with+design+tokens>`_ |
| 54 | +* `Confluence: Teak test branches <https://openedx.atlassian.net/wiki/spaces/BPL/pages/5050499077/Using+Teak+Design+Tokens+branches>`_ |
| 55 | +* `Paragon design tokens issues <https://github.com/openedx/paragon/issues?q=design+tokens>`_ |
| 56 | +* `Paragon CLI issues <https://github.com/openedx/paragon/issues?q=%5BCLI%5D>`_ |
| 57 | + |
| 58 | + |
| 59 | +**Maintenance chart** |
| 60 | + |
| 61 | ++--------------+-------------------------------+----------------+--------------------------------+ |
| 62 | +| Review Date | Working Group Reviewer | Release |Test situation | |
| 63 | ++--------------+-------------------------------+----------------+--------------------------------+ |
| 64 | +| 2026-03-20 | Frontend WG | Verawood | Pass | |
| 65 | ++--------------+-------------------------------+----------------+--------------------------------+ |
0 commit comments