Which TailwindCSS v4 namespace matches a given TailwindCSS v3's theme keys? #19020
-
From TailwindCSS v4 onward, the JS-based configuration is not available by default. However, in the new CSS-first configuration, everything is completely different. The old keys have been removed, and new namespaces have been introduced. There is no concrete mapping showing which old key corresponds to which new namespace. Additionally, the number of documented namespaces is much smaller. In TailwindCSS v3's JS-based configuration (i.e. in
But in the CSS-first documentation, colors can only be declared globally.
I've discovered, however, that these settings are still available, though there's no concrete list of them in the official v4 CSS-first configuration docs: You can use I'm looking for a canonical list that enumerates which namespaces are available by default in TailwindCSS v4's CSS-first configuration. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, a lot is missing from TailwindCSS v4's new CSS-first documentation. You can find the documented ones listed here (such as Many undocumented namespaces - like the Explanation of the table:
Source:
Note: The list does not include the namespaces found in the previous docs-reference, only those missing from it. The motivation behind Philipp Spiess's research:
So you can use the namespaces within |
Beta Was this translation helpful? Give feedback.
Yes, a lot is missing from TailwindCSS v4's new CSS-first documentation. You can find the documented ones listed here (such as
--color-*
):Many undocumented namespaces - like the
--text-color-*
or--background-color-*
you mentioned - don't yet have a dedicated place, so the following table contains the complete list of what's missing.Explanation of the table:
theme.{key}
ortheme.extend.{key}
. Based on the v3 key, you can easily find its v4 counterpart.@theme
. It may also include …