Preprocessor to allow token overrides within one token definition mainly for component tokens#1092
Merged
lukasoppermann merged 1 commit intomainfrom Dec 5, 2024
Merged
Preprocessor to allow token overrides within one token definition mainly for component tokens#1092lukasoppermann merged 1 commit intomainfrom
lukasoppermann merged 1 commit intomainfrom
Conversation
🦋 Changeset detectedLatest commit: e5d5522 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
630dd10 to
9326e3b
Compare
faa6456 to
da8d159
Compare
05efbd2 to
cff2cf7
Compare
Contributor
Design Token Diff (Figma)
|
0cb917b to
13c0189
Compare
13c0189 to
dae7eab
Compare
9d87039 to
ce4d3a4
Compare
ce4d3a4 to
22d95da
Compare
9850353 to
bedde36
Compare
bedde36 to
e5d5522
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Using a pre-processor allows us to define value overwrites on a token using the
$extensions['org.primer.overrides']property.Schema
When building the tokens we need to provide a
themeto thePlatformConfigoptions property, e.g.:If a value with this theme is defined on the token, it will be used, otherwise the "default"
$valuewill be used.The benefit of using a pre-processor to other solutions is, that the token can still be transformed normally in the transformation flow. No custom code is required, contributors don't need to understand preprocessors or how this works, to add contributions to other parts.
List of notable changes: