Skip to content

fix(s2): update button gradients to use static colors #7574

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

Closed
wants to merge 4 commits into from

Conversation

jluyau
Copy link
Member

@jluyau jluyau commented Jan 6, 2025

update Button gradients (genai & premium) to use static colors as to not change for light/dark theme

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@@ -111,8 +113,8 @@ export function colorMix(a: SpectrumColor, b: SpectrumColor, percent: number): `
return `[color-mix(in srgb, ${parseColor(a)}, ${parseColor(b)} ${percent}%)]`;
}

export function linearGradient(angle: string, ...tokens: [SpectrumColor, number][]): string {
return `linear-gradient(${angle}, ${tokens.map(([color, stop]) => `${parseColor(color)} ${stop}%`)})`;
export function linearGradient(angle: string, ...gradientTokens: [(keyof typeof tokens), (keyof typeof tokens)][]): string {
Copy link
Member Author

Choose a reason for hiding this comment

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

unsure if making this function accept only tokens is ok. currently only used by the gradient buttons, but in the case someone else wanted to use it, it might need to accept color token as well?

@jluyau jluyau changed the title update button gradients to use static colors fix(s2): update button gradients to use static colors Jan 6, 2025
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.

2 participants