You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new inherit color option in the default Tailwind color palette, which will use the color: inherit CSS rule.
This will allow for better modularization of color definitions in components, like separately inheriting the text and background colors from a parent node, while still having the option to override them in a component. (More on this later on.)
Current Workarounds
At the moment, you could manually add this option to your tailwind configuration file:
The drawback to this is that you need to "override" the whole color palette to insert the inherit one before every other color, but I think it may be handy to have it between transparent and current.
Similar implementation
As I mentioned previously, there's a current color definition available, but this CSS variable will carry the text color to all other properties, like border or background.
If you think about it, having a current color is useful when dealing with "normalization" stuff, but not with inheritance between the different types of properties.
Having a inherit option will allow us to make implementations like this one, while keeping things like background color or border colors out of the scope.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Introduction
Create a new
inherit
color option in the default Tailwind color palette, which will use thecolor: inherit
CSS rule.This will allow for better modularization of color definitions in components, like separately inheriting the text and background colors from a parent node, while still having the option to override them in a component. (More on this later on.)
Current Workarounds
At the moment, you could manually add this option to your tailwind configuration file:
The drawback to this is that you need to "override" the whole color palette to insert the
inherit
one before every other color, but I think it may be handy to have it betweentransparent
andcurrent
.Similar implementation
As I mentioned previously, there's a
current
color definition available, but this CSS variable will carry the text color to all other properties, like border or background.If you think about it, having a
current
color is useful when dealing with "normalization" stuff, but not with inheritance between the different types of properties.Having a
inherit
option will allow us to make implementations like this one, while keeping things like background color or border colors out of the scope.Beta Was this translation helpful? Give feedback.
All reactions