Skip to content

Commit 5c399b4

Browse files
lukewarlowphilipp-spiess
authored andcommitted
add scripting variants
1 parent 124b82b commit 5c399b4

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

packages/tailwindcss/src/__snapshots__/intellisense.test.ts.snap

+16
Original file line numberDiff line numberDiff line change
@@ -8449,6 +8449,8 @@ exports[`getVariants 1`] = `
84498449
"print",
84508450
"forced-colors",
84518451
"inverted-colors",
8452+
"noscript",
8453+
"scripting",
84528454
],
84538455
},
84548456
{
@@ -9184,5 +9186,19 @@ exports[`getVariants 1`] = `
91849186
"selectors": [Function],
91859187
"values": [],
91869188
},
9189+
{
9190+
"hasDash": true,
9191+
"isArbitrary": false,
9192+
"name": "noscript",
9193+
"selectors": [Function],
9194+
"values": [],
9195+
},
9196+
{
9197+
"hasDash": true,
9198+
"isArbitrary": false,
9199+
"name": "scripting",
9200+
"selectors": [Function],
9201+
"values": [],
9202+
},
91879203
]
91889204
`;

packages/tailwindcss/src/variants.test.ts

+20
Original file line numberDiff line numberDiff line change
@@ -1926,6 +1926,26 @@ test('inverted-colors', async () => {
19261926
`)
19271927
})
19281928

1929+
test('noscript', async () => {
1930+
expect(await run(['noscript:flex'])).toMatchInlineSnapshot(`
1931+
"@media (scripting: none) {
1932+
.noscript\\:flex {
1933+
display: flex;
1934+
}
1935+
}"
1936+
`)
1937+
})
1938+
1939+
test('scripting', async () => {
1940+
expect(await run(['scripting:flex'])).toMatchInlineSnapshot(`
1941+
"@media (scripting: enabled) {
1942+
.scripting\\:flex {
1943+
display: flex;
1944+
}
1945+
}"
1946+
`)
1947+
})
1948+
19291949
test('nth', async () => {
19301950
expect(
19311951
await run([

packages/tailwindcss/src/variants.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,9 @@ export function createVariants(theme: Theme): Variants {
11501150
staticVariant('inverted-colors', ['@media (inverted-colors: inverted)'])
11511151
}
11521152

1153+
staticVariant('noscript', ['@media (scripting: none)'])
1154+
staticVariant('scripting', ['@media (scripting: enabled)'])
1155+
11531156
return variants
11541157
}
11551158

0 commit comments

Comments
 (0)