mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
The only reason the config() helper function existed was to access your design tokens in your CSS, like:
```css
.foo {
color: config('colors.blue')
}
```
Now that design tokens are nested in the new `theme` section, using the `config()` function is a bit more verbose:
```css
.foo {
color: config('theme.colors.blue')
}
```
This PR removes the `config()` function in favor of a new `theme()` function that is already scoped to the `theme` section of the config:
```css
.foo {
color: theme('colors.blue')
}
```
I can't think of any reason at all why you would need to access the non-theme values in your config from your CSS (like enabled variants, or your list of plugins), and the word `theme` is much more expressive than `config`, so I think this is a worthwhile change.
A utility-first CSS framework for rapidly building custom user interfaces.
Documentation
For full documentation, visit tailwindcss.com.
Community
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
Discuss Tailwind CSS on GitHub
For casual chit-chat with others using the framework:
Join the Tailwind CSS Discord Server
Contributing
If you're interested in contributing to Tailwind CSS, please read our contributing docs before submitting a pull request.
Description
Languages
JavaScript
90.6%
CSS
7.6%
HTML
1.7%