Skip to content

feat: Add style api for token#4346

Open
amanabiy wants to merge 2 commits intomainfrom
dev-v3-amanabiy-token-style-api
Open

feat: Add style api for token#4346
amanabiy wants to merge 2 commits intomainfrom
dev-v3-amanabiy-token-style-api

Conversation

@amanabiy
Copy link
Member

@amanabiy amanabiy commented Mar 11, 2026

Description

Add a style prop to the Token component that allows consumers to customize background, border, color, border-radius, padding, and dismiss button styling.

Tested by:

  • running locally, and through pipeline

Related links, issue #, if available: P391912008

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@amanabiy amanabiy force-pushed the dev-v3-amanabiy-token-style-api branch from 6155d75 to 6670191 Compare March 12, 2026 06:25
@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.44%. Comparing base (f5bcafe) to head (e8ba613).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4346   +/-   ##
=======================================
  Coverage   97.44%   97.44%           
=======================================
  Files         897      898    +1     
  Lines       26376    26420   +44     
  Branches     9523     9544   +21     
=======================================
+ Hits        25702    25746   +44     
+ Misses        668      631   -37     
- Partials        6       43   +37     

☔ 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.

@amanabiy amanabiy marked this pull request as ready for review March 12, 2026 08:35
@amanabiy amanabiy requested a review from a team as a code owner March 12, 2026 08:35
@amanabiy amanabiy requested review from NathanZlion and mxschll and removed request for a team March 12, 2026 08:35
background: {
default: 'light-dark(#eef2ff, #2e1065)',
hover: 'light-dark(#dbeafe, #3b0764)',
disabled: 'light-dark(#f1f5f9, #1e1b2e)',
Copy link
Member

Choose a reason for hiding this comment

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

Should we have readOnly as well?

}),
};

return Object.fromEntries(Object.entries(properties).filter(([, value]) => value !== undefined));
Copy link
Member

Choose a reason for hiding this comment

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

We stopped filtering out undefined props because it costs performance and might sum up over time with many components using style api (reference: #4025 (comment)).

You can just return the style as-is, so instead of

const properties = {...

This

return { ... }

@amanabiy amanabiy requested a review from mxschll March 20, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants