* move `cli` to its own package `@tailwindcss/cli`
* minify builds when using `tsup`
* prefer tsup cli flag over tsup.config.ts file
* add `--clean`, to make sure `dist/` folders are cleaned before building
* make CLI esm only
* use version of `tailwindcss` instead of the version of `@tailwindcss/cli`
* only output `@property foo` once instead of N times
* compute the indent once
* improve performance by using strings and for-loops
* drop unnecessary new line
The pretty printing is fairly basic, but it adds some space between
properties `color: red;`, adds newlines after `;`, `{`, and `}`.
Last but not least, it indents nested CSS based on depth with 2 spaces.
This way we can re-use the workflow that already exists on the `master`
branch and it will allow us to trigger manual releases from the `next`
branch without making changes to the `master` branch.
* feat: add contain utilities
* chore: lint
* Support mulptiple contain properites
Support multiple contain properties, such as "contain-size contain-layout". Drop contain-unset as we haven't added -unset variants for other utilities.
* Update Vite; fix test regex
Vite is generating files like "index--T9oO-MP.css", which required relaxing the regex used in tests.
---------
Co-authored-by: Alexander <github@lichter.io>
* Ensure max specificity of 001 in all Preflight rules
* Update changelog
* Update changelog
---------
Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
* Reduce specificity of `rtl`, `ltr`, and `dark` variants
Reduce specificity of `rtl`, `ltr`, and `dark` variants (when using `darkMode: 'class'`) to make them the same as other variants. This also sorts the LTR/RTL and dark variants later in the variant plugin list to ensure that the reduced specificity doesn't cause them to start "losing" to other variants to keep things as backwards compatible as possible.
Resolves a long-standing issue where `darkMode: 'media'` and `darkMode: 'class'` had different specificity, which meant switching your dark mode strategy could break your site.
* Update changelog
---------
Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
* add `*` as child variant
* add `*` as allowed variant character
* update test to reflect Lightning CSS output
* add `childVariant` test
* Update changelog
---------
Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
Co-authored-by: Gregor Kaczmarczyk <github@aggreggator.de>
* feat(preflight): simplify sans-serif font stack
`-apple-system` and `BlinkMacSystemFont` were historically needed for
IE11 and chakra-based Edge (The one that wasn't chromium-based).
https://caniuse.com/font-family-system-ui has more details around it.
* further simplify `font-family`
* update tests
* update changelog
---------
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
* Add forced-colors variant
Also add a contrast-custom variant to match custom contrast preferences
* use `toMatchSnapshot` instead of `toMatchFormattedCss`
More info: https://github.com/tailwindlabs/tailwindcss/pull/12170
* remove `contrast-custom` variant
* move `forcedColorsVariants` next to `prefersContrastVariants`
* update changelog
---------
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
* Add forced-colors-adjust utilities
* Update forcedColorsAdjust.test.js
* use `toMatchSnapshot` instead of `toMatchFormattedCss`
More info: https://github.com/tailwindlabs/tailwindcss/pull/12170
* rename `forced-colors-adjust` -> `forced-color-adjust`
Dropped the `s` in `colors`.
* update changelog
* fix typo
* use full `forced-color-adjust-auto` and `forced-color-adjust-none` names
---------
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
* Extend current preflight `html` styles to support other root/host scopes
Supports SVG root scope, ShadowDOM, and presumably other root scopes
* Replace `:root` with `html`
* Update tests
* Update changelog
---------
Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
* Extend opacity scale to include all steps of 5
* Update changelog
---------
Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
* Add `has-*` variants for `:has(...)` pseudo-class
* Update changelog
* Fix mistake in test
---------
Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>