No description
use `lightningcss` and `prettier` for `toMatchFormattedCss`
Lightning CSS applies some optimizations and prettier ensures that the
output is always formatted in the same way.
In a future version, we will be using Lightning CSS to apply
optimizations like handling the nesting, optimizing selectors, sorting
declarations, simplifying colors and so on.
To guarantee that we have the same output in both the normal version and
OXIDE version, we can apply lightningcss in our tests so that it always
produces correct results in both version with the same optimizations
applied.
This also aliases `toMatchCss` to `toMatchFormattedCss` so that we can
guarantee the same output. This has a small caveat where `lightningcss`
is pretty strict. It will complain about `@media screen(md) {}` for
example. This is correct because it is not valid CSS, but we eventually
take care of it.
In this case, we will catch the error and use prettier instead (since
this should only happen in tests that doesn't use end-to-end tests, but
uses a more specialized test instead). If prettier still finds an error,
we will ensure to throw the original error.
Eventually, all the "lower" level tests, should probably become higher
level end-to-end tests. But let's do everything step by step!
|
||
|---|---|---|
| .github | ||
| integrations | ||
| jest | ||
| nesting | ||
| oxide | ||
| perf | ||
| scripts | ||
| src | ||
| standalone-cli | ||
| stubs | ||
| tests | ||
| types | ||
| .editorconfig | ||
| .eslintignore | ||
| .eslintrc.json | ||
| .gitignore | ||
| .swcrc | ||
| base.css | ||
| CHANGELOG.md | ||
| colors.d.ts | ||
| colors.js | ||
| components.css | ||
| defaultConfig.d.ts | ||
| defaultConfig.js | ||
| defaultTheme.d.ts | ||
| defaultTheme.js | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| plugin.d.ts | ||
| plugin.js | ||
| prettier.config.js | ||
| README.md | ||
| resolveConfig.d.ts | ||
| resolveConfig.js | ||
| screens.css | ||
| tailwind.css | ||
| utilities.css | ||
| variants.css | ||
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.