-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Call color functions when using theme('...')
on all color related sections.
#4533
Conversation
@@ -13,15 +13,14 @@ export default function transformThemeValue(themeSection) { | |||
'transitionTimingFunction', | |||
'backgroundImage', | |||
'backgroundSize', | |||
'backgroundColor', |
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.
I was having a hard time understanding why this was here. I removed it and it didn't break any tests so that's good but I can't help but feel like I'm missing something.
src/util/transformThemeValue.js
Outdated
'cursor', | ||
'animation', | ||
].includes(themeSection) | ||
) { | ||
return (value) => (Array.isArray(value) ? value.join(', ') : value) | ||
} | ||
|
||
if (themeSection === 'colors') { | ||
if (['colors', 'textColor', 'backgroundColor', 'borderColor'].includes(themeSection)) { |
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.
Should we do something less explicit here like themeSection === 'colors' || themeSection.toLowerCase().endsWith('color')
?
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.
I think I would prefer to be explicit personally. We are missing a bunch of things in this list though, like divideColor
, gradientColorStops
, placeholderColor
, ringColor
, ringOffsetColor
, fill
, stroke
, and the brand new caretColor
plugin so will want to get updated for those.
This is probably going to be annoying to maintain so might be worth thinking through a strategy that is more automatic but I don't have any good ideas that immediately come to mind :/
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.
Added the other items for now and alphabetized. Everything I can think of feels either limiting or gross right now. Will think about it a bit more.
Hey! Thank you for your PR! I had to rebase, and made some changes. I didn't have access rights to push directly to your branch, so I create a new PR and started from your commits: #5871 |
We noticed we were able to do:
but we were unable to do:
so this resolves that.
I left a few comments below because I feel like I'll need to adjust a bit.