Skip to content

Commit

Permalink
refactor: add paragon as dev dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoa committed Nov 18, 2024
1 parent cb2f2d7 commit facc073
Show file tree
Hide file tree
Showing 4 changed files with 3,908 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
.vscode
node_modules
21 changes: 13 additions & 8 deletions docs/how-to/design-tokens-support.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ Paragon Design Tokens Compatibility
===================================


From version 23 `Paragon <https://www.notion.so/Write-the-brand-docs-7a60ece8489e40e1a6ca6ac4b79aac82?pvs=21>`_ supports CSS variables and
`design tokens <https://tr.designtokens.org/format/#abstract>`.
From version 23 `Paragon <https://github.com/openedx/paragon/>`_ supports CSS variables and
`design tokens <https://tr.designtokens.org/format/#abstract>_`.

How to structure the brand design tokens
========================================
How to structure the brand design tokens files
==============================================

The file structure in the brand package should be the same as the version of Paragon used as a reference to allow the merge/override during the build time.
To see the tokens directory structure for the version of Paragon you are targeting, navigate to ``https://github.com/openedx/paragon/tree/TARGET_PARAGON_VERSION/tokens``.
For example, if you were workig with Paragon v23.0.0 you would navigate to https://github.com/openedx/paragon/tree/v23.0.0/tokens.

.. code-block::
.
paragon/
└── tokens/
└── src/
├── core/
Expand All @@ -33,6 +35,9 @@ The file structure in the brand package should be the same as the version of Par
Once you have identified the token to override, you can replace ``<name_of_the_folder>`` and ``<name_of_the_file>`` with the right names.

Tokens format
=============

In terms of tokens, Paragon follows the specifications of the `Design Tokens Community Group <https://tr.designtokens.org/format/#abstract>`_.

The structure that follows to define most of the tokens is ``category > item > subitem > property > state``, for example:
Expand Down Expand Up @@ -83,11 +88,11 @@ Build the tokens and generate the CSS variables

To build the tokens you can use Paragon CLI.

#. Install Paragon
#. Install Paragon as a dev dependency

.. code-block:: bash
npm install paragon
npm ci
#. Once the tokens have been created. Go to the ``package.json``, there is a script template:

Expand Down Expand Up @@ -148,4 +153,4 @@ The file must be in the ``dist`` folder and should have:
}
}
The paths must be relative to the ``theme-urls.json``file and contain all the variants that you want to use preload.
The paths must be relative to the ``theme-urls.json`` file and contain all the variants that you want to preload.
Loading

0 comments on commit facc073

Please sign in to comment.