Setting up design-tokens from style-dictionary #207
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to open-formulieren/open-forms#1603
This PR moves (some of the) CSS variables to a dedicated design-tokens repository and integrates it in our build/development toolchain.
The design-tokens repository is included as git submodule so we have a consistent and predictable path. This lets us use
yarn
workspaces (npm
has them too) which automatically deals with theyarn link
behaviour for local development, letting us use the local source code as if it was a package installed from npm. Changes in the resulting stylesheet are picked up by webpack, which re-compiles when needed.The build and start scripts also ensure that a build of the submodule is created so that the resulting CSS files can be included.
TODO
index.css
with theme class name rather thanroot.css
which emits tokens under the:root {...}
pseudo-selectorprivate: true
, which prevents us from building and publishing the package to npm. This may actually be a good thing so we properly divide thesrc
up into local-development tooling vs. what is actually needed in production - we now switch entrypoints betweenindex.js
andsdk.js
instead.