-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Allow configs to override default CSS theme values in theme()
function provided to plugins and configs
#14359
Conversation
[key: string | number]: string | Colors | ||
} | ||
|
||
export function flattenColorPalette(colors: Colors) { |
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.
TODO: We need to expose this to the end user for backwards compatibility. I believe it's tailwindcss/lib/util/flattenColorPalette
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.
Really unfortunate it needs to live at tailwindcss/lib/util/flattenColorPalette
and not tailwindcss/flattenColorPalette
.
Do you think we should do this in this PR or a followup?
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.
Can that be something we configure in our exports config or copy over at build-time or something I wonder?
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 we would still require a separate file to point to, but the paths should be fixable via exports I believe.
I also think that it should be a default export in the final result so that you can do const flattenColorPalette = require('...')
which is what's currently used.
cea86ed
to
14555ea
Compare
Previously, given the following CSS and configuration:
When a config or a plugin asked for the value of
theme(fontSize.base)
like so:We would instead pull the values from the CSS theme even through they're marked with
@theme default
. This would cause the incorrect font size and line height to be used resulting in something like this (in the case of the typography plugin with custom styles):After this change we'll now pull the values from the appropriate place (the config in this case) and the correct font size and line height will be used:
This will work even when some values are overridden in the CSS theme:
which would result in the following CSS: