fix: ensure Style Dictionary format css/component-button-variant-overrides work for brand packages #3629
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.
Description
When trying to use #3598 within
@edx/elm-theme
to generate the overrides CSS file, no output was seen.This issue was due to the
filter
used on thebuild-tokens.js
script when configuring thecss/component-button-variant-overrides
format, which conditionally filters for source tokens only (i.e., the brand package tokens only, not core Paragon tokens).When this format keys into
dictionary.tokens
with this filter applied, the relevant JSON for theAlert
actions button variant overrides is not found.Removing the
filter
from the format usage inbuild-tokens.js
resolves the issue; alternatively, we could keep thefilter
and rely ondictionary.unfilteredTokens
, too. That said, if we need the unfiltered tokens for this use case, we might as well just remove thefilter
from the format usage inbuild-tokens.js
.The
filter
for this custom format handling the button variant overrides isn't really necessary, given Paragon itself does not define any key/value mapping of button variant overrides (i.e., empty object). Given this, the output overrides CSS file when running thebuild-tokens
CLI command is still only generated when the brand package explicitly provided a key/value mapping of button variant overrides.Deploy Preview
N/A
Merge Checklist
example
app?Post-merge Checklist