Skip to content

fix: ensure Style Dictionary format css/component-button-variant-overrides work for brand packages #3629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

adamstankiewicz
Copy link
Member

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 the build-tokens.js script when configuring the css/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 the Alert actions button variant overrides is not found.

Removing the filter from the format usage in build-tokens.js resolves the issue; alternatively, we could keep the filter and rely on dictionary.unfilteredTokens, too. That said, if we need the unfiltered tokens for this use case, we might as well just remove the filter from the format usage in build-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 the build-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

  • If your update includes visual changes, have they been reviewed by a designer? Send them a link to the Netlify deploy preview, if applicable.
  • Does your change adhere to the documented style conventions?
  • Do any prop types have missing descriptions in the Props API tables in the documentation site (check deploy preview)?
  • Were your changes tested using all available themes (see theme switcher in the header of the deploy preview, under the "Settings" icon)?
  • Were your changes tested in the example app?
  • Is there adequate test coverage for your changes?
  • Consider whether this change needs to reviewed/QA'ed for accessibility (a11y). If so, please request an a11y review for the PR in the #wg-paragon Open edX Slack channel.

Post-merge Checklist

  • Verify your changes were released to NPM at the expected version.
  • If you'd like, share your contribution in #show-and-tell.
  • 🎉 🙌 Celebrate! Thanks for your contribution.

Copy link

netlify bot commented Jun 4, 2025

Deploy Preview for paragon-openedx-v23 ready!

Name Link
🔨 Latest commit 8d167dd
🔍 Latest deploy log https://app.netlify.com/projects/paragon-openedx-v23/deploys/684046107fbbd800084dbb4e
😎 Deploy Preview https://deploy-preview-3629--paragon-openedx-v23.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

codecov bot commented Jun 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.50%. Comparing base (908fe82) to head (8d167dd).
Report is 3 commits behind head on release-23.x.

Additional details and impacted files
@@              Coverage Diff              @@
##           release-23.x    #3629   +/-   ##
=============================================
  Coverage         93.50%   93.50%           
=============================================
  Files               232      232           
  Lines              4016     4016           
  Branches            923      953   +30     
=============================================
  Hits               3755     3755           
+ Misses              257      253    -4     
- Partials              4        8    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@brian-smith-tcril brian-smith-tcril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the detailed PR description this makes sense to me!

:shipit:

@adamstankiewicz adamstankiewicz merged commit b814695 into release-23.x Jun 4, 2025
10 checks passed
@adamstankiewicz adamstankiewicz deleted the ags/sd-component-button-variant-overrides-fix branch June 4, 2025 14:28
@openedx-semantic-release-bot

🎉 This PR is included in version 23.10.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants