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
To override an option in the default theme, create a theme section in your tailwind.config.js file and add the key you'd like to override.
This will completely replace Tailwind's default configuration for that key, so in the example above none of the default opacity utilities would be generated.
Any keys you do not provide will be inherited from the default theme, so in the above example, the default theme configuration for things like colors, spacing, border radius, background position, etc. would be preserved.
From my brief experimentation (below), I concluded:
I'm not sure if it's correct to say that the section would “completely replace” the default.
It was not clear how to override default values that one wants undefined.
Here's what I did. I added the @tailwindcss/typography plugin and the following:
I thought the a object would completely replace the .prose a style. But I discovered that .prose a still had text-decoration: underline, which I did not want. First, I tried adding textDecoration: undefined, to the a in the tailwind.config.js above, but that didn't change anything. Then, I added textDecoration: null,, and that seems to have removed the text-decoration.
In conclusion, would you mind updating the documentation with at least some clarifying text on the following?
How are the default values are combined with the overrides in the tailwind.config.js?
What is the recommended way to undefine a default value?
Thanks!
The text was updated successfully, but these errors were encountered:
The "overriding the default theme" section you mention is describing how the core Tailwind theme is customised. For properties like spacing, borderRadius etc, defining an object inside your themewill completely replace all the available options for that property.
Your documentation is great! I'm just a bit confused on how to override certain parts of a default theme.
The section Overriding the default theme currently has this:
From my brief experimentation (below), I concluded:
Here's what I did. I added the
@tailwindcss/typography
plugin and the following:I thought the
a
object would completely replace the.prose a
style. But I discovered that.prose a
still hadtext-decoration: underline
, which I did not want. First, I tried addingtextDecoration: undefined,
to thea
in thetailwind.config.js
above, but that didn't change anything. Then, I addedtextDecoration: null,
, and that seems to have removed thetext-decoration
.In conclusion, would you mind updating the documentation with at least some clarifying text on the following?
tailwind.config.js
?Thanks!
The text was updated successfully, but these errors were encountered: