Add variant for @starting-style (#13329)

* Add variant for @starting-style

Co-Authored-By: Han Yeong-woo <han@yeongwoo.dev>

* Update changelog

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Han Yeong-woo <han@yeongwoo.dev>
This commit is contained in:
Adam Wathan 2024-03-22 15:38:06 -04:00 committed by GitHub
parent 3249777383
commit de79455b0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 20 additions and 0 deletions

View File

@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Make `rotate-x/y/z-*` utilities composable ([#13319](https://github.com/tailwindlabs/tailwindcss/pull/13319))
- `@tailwind/vite` applies the Vite CSS plugin to transform Tailwind-generated CSS (e.g. inlining images) ([#13218](https://github.com/tailwindlabs/tailwindcss/pull/13218))
- Add `starting` variant for `@starting-style` ([#13329](https://github.com/tailwindlabs/tailwindcss/pull/13329))
### Fixed

View File

@ -2403,6 +2403,13 @@ exports[`getVariants 1`] = `
"selectors": [Function],
"values": [],
},
{
"hasDash": true,
"isArbitrary": false,
"name": "starting",
"selectors": [Function],
"values": [],
},
{
"hasDash": true,
"isArbitrary": false,

View File

@ -801,6 +801,16 @@ test('dark', () => {
`)
})
test('starting', () => {
expect(run(['starting:opacity-0'])).toMatchInlineSnapshot(`
"@starting-style {
.starting\\:opacity-0 {
opacity: 0;
}
}"
`)
})
test('print', () => {
expect(run(['print:flex'])).toMatchInlineSnapshot(`
"@media print {

View File

@ -695,6 +695,8 @@ export function createVariants(theme: Theme): Variants {
staticVariant('dark', ['@media (prefers-color-scheme: dark)'], { compounds: false })
staticVariant('starting', ['@starting-style'], { compounds: false })
staticVariant('print', ['@media print'], { compounds: false })
staticVariant('forced-colors', ['@media (forced-colors: active)'], { compounds: false })