No description
This PR adds support for the [`theme()` function](https://tailwindcss.com/docs/plugins#dynamic-utilities) from the v3 plugin API, used for configuring which values functional utilities support: ```js plugin(function({ matchUtilities, theme }) { matchUtilities( { tab: (value) => ({ tabSize: value }), }, { values: theme('tabSize') } ) }) ``` Things this handles: - "Upgrading" theme keys to their v4 names, so if you do `theme('colors')` that will correctly retrieve all the colors from the `--color-*` namespace with the new CSS variable based configuration - Polyfilling dependent keys, so `theme('backgroundColor')` will still pull everything in `--color-*` even though there is no values in the `backgroundColor` namespace in v4 by default - Polyfilling theme values that are now handled by "bare values" internally, so even though there is no `flexShrink` theme values in v4, `theme('flexShrink')` will still configure your plugin to properly support any value that the built-in `shrink-*` utilities support Things that aren't handled: - Theme values that have been replaced by static utilities can't be retrieved yet, so for example `theme('cursor')` returns nothing right now because there are no values for the `cursor-*` utilities in the theme anymore, they are all just baked in to the framework. This will be handled in a future PR. --------- Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com> Co-authored-by: Jordan Pittman <jordan@cryptica.me> Co-authored-by: Robin Malfait <malfait.robin@gmail.com> |
||
|---|---|---|
| .github | ||
| crates | ||
| integrations | ||
| packages | ||
| playgrounds | ||
| scripts | ||
| .gitignore | ||
| .npmrc | ||
| .prettierignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CHANGELOG.md | ||
| LICENSE | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
| turbo.json | ||
| vitest.workspace.ts | ||
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 chatting 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.