Skip to content

Commit bbba6ed

Browse files
lukewarlowphilipp-spiess
authored andcommitted
add scripting variants
1 parent ab9df29 commit bbba6ed

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
{
@@ -9177,5 +9179,19 @@ exports[`getVariants 1`] = `
91779179
"selectors": [Function],
91789180
"values": [],
91799181
},
9182+
{
9183+
"hasDash": true,
9184+
"isArbitrary": false,
9185+
"name": "noscript",
9186+
"selectors": [Function],
9187+
"values": [],
9188+
},
9189+
{
9190+
"hasDash": true,
9191+
"isArbitrary": false,
9192+
"name": "scripting",
9193+
"selectors": [Function],
9194+
"values": [],
9195+
},
91809196
]
91819197
`;

packages/tailwindcss/src/variants.test.ts

+20
Original file line numberDiff line numberDiff line change
@@ -1917,6 +1917,26 @@ test('inverted-colors', async () => {
19171917
`)
19181918
})
19191919

1920+
test('noscript', async () => {
1921+
expect(await run(['noscript:flex'])).toMatchInlineSnapshot(`
1922+
"@media (scripting: none) {
1923+
.noscript\\:flex {
1924+
display: flex;
1925+
}
1926+
}"
1927+
`)
1928+
})
1929+
1930+
test('scripting', async () => {
1931+
expect(await run(['scripting:flex'])).toMatchInlineSnapshot(`
1932+
"@media (scripting: enabled) {
1933+
.scripting\\:flex {
1934+
display: flex;
1935+
}
1936+
}"
1937+
`)
1938+
})
1939+
19201940
test('nth', async () => {
19211941
expect(
19221942
await run([

packages/tailwindcss/src/variants.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,9 @@ export function createVariants(theme: Theme): Variants {
11471147
staticVariant('inverted-colors', ['@media (inverted-colors: inverted)'])
11481148
}
11491149

1150+
staticVariant('noscript', ['@media (scripting: none)'])
1151+
staticVariant('scripting', ['@media (scripting: enabled)'])
1152+
11501153
return variants
11511154
}
11521155

0 commit comments

Comments
 (0)