No description
I noticed a lot more backwards compatibility concerns had started leaking into core, especially around the `theme` function, so did a bit of work to try and pull that stuff out and into the compatibility layer. Now the core version of `theme` only handles CSS variables (like `--color-red-500`) and has no knowledge of the dot notation or how to upgrade it. Instead, we unconditionally override that function in the compatibility layer with a light version that _does_ know how to do the dot notation upgrade, and override that again with the very heavy/slow version that handles JS config objects only if plugins/JS configs are actually used. I've also renamed `registerPlugins` to `applyCompatibilityHooks` because the name was definitely a bit out of date given how much work it's doing now, and now call it unconditionally from core, leaving that function to do any conditional optimizations itself internally. Next steps I think would be to split up `plugin-api.ts` a bit and maybe make `applyCompatibilityHooks` its own file, and move both of those files into the `compat` folder so everything is truly isolated there. My goal with this stuff is that if/when we ever decide to drop backwards compatibility with these features in the future (maybe v5), that all we have to do is delete the one line of code that calls `applyCompatibilityHooks` in `index.ts`, and delete the `compat` folder and we're done. I could be convinced that this isn't a worthwhile goal if we feel it's making the codebase needlessly complex, so open to that discussion as well. --------- Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com> Co-authored-by: Robin Malfait <malfait.robin@gmail.com> |
||
|---|---|---|
| .github | ||
| crates | ||
| integrations | ||
| packages | ||
| patches | ||
| playgrounds | ||
| scripts | ||
| .gitattributes | ||
| .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.