-
Notifications
You must be signed in to change notification settings - Fork 96
feat: allow color-related props to receive color variable keys in addition to hex values #1885
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. One comment mainly but it's non-blocking.
} | ||
|
||
if ($foregroundColor) { | ||
foregroundColor = $foregroundColor.includes('.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like it might be overkill, but would we benefit from a utility function from the theming package?
const parseColorProp = (value) => value.includes('.') ? getColor({ theme, variable: value }) : value
// in component:
const foregroundColor = parseColorProp($foregroundColor)
} | ||
|
||
return css` | ||
transition: color 0.1s ease-in-out; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done. Big win for our consumers! 🔥 🚀
Description
Updates related prop documentation and sets the following props to be able to receive color variable key strings:
surfaceColor
backgroundColor
foregroundColor
surfaceColor
hue
Detail
Tag
is a description update only as the primaryhue
colors already received intended light/dark treatment.Checklist
design updates will be Garden Designer approved (add the designer as a reviewer)npm start
)renders as expected with reversed (RTL) directionrenders as expected with Bedrock CSS (?bedrock
)tested for WCAG 2.1 AA accessibility compliancetested in Chrome, Firefox, Safari, and Edge