Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d141afa
Add function for depth-first AST traversal
thecrypticace Oct 17, 2024
aa5fc87
Fix intellisense variant selector calculation
thecrypticace Oct 14, 2024
f8143a6
Add Intellisense API benchmark
thecrypticace Oct 21, 2024
12b9fae
Use single rule for parallel variants when possible
thecrypticace Oct 17, 2024
5b5bfc9
Add path information to `visit`
thecrypticace Oct 17, 2024
bc391bc
Simplify nesting checks in compound variants
thecrypticace Oct 17, 2024
22673e5
Filter the kinds of rules compound variants support
thecrypticace Oct 21, 2024
6a03a06
Register compound variants with the kinds of rules they support
thecrypticace Oct 21, 2024
8dc719c
Let `not-*` variant handle simple conditional at rules
thecrypticace Oct 21, 2024
cc3e774
Update tests
thecrypticace Oct 21, 2024
414bc16
Update changelog
thecrypticace Oct 21, 2024
22e5614
Use bitfield enum
thecrypticace Oct 22, 2024
9f1a7d3
Compute compounds when using staticVariant
thecrypticace Oct 22, 2024
92e8d31
Add tests
thecrypticace Oct 22, 2024
fa3effb
Refactor
thecrypticace Oct 23, 2024
9e365df
Compute compunds for arbitrary variants
thecrypticace Oct 23, 2024
5b7e104
Compute compounds for `@variant`
thecrypticace Oct 23, 2024
4cc3f16
Compute compounds for `addVariant`
thecrypticace Oct 23, 2024
fb0eabf
Add tests
thecrypticace Oct 23, 2024
a1ab176
Update CHANGELOG.md
thecrypticace Oct 23, 2024
6ac6829
Apply suggestions from code review
thecrypticace Oct 23, 2024
a8ee1fb
Merge branch 'next' into feat/v4-not-tweaks
thecrypticace Oct 24, 2024
48139ad
Update changelog
thecrypticace Oct 24, 2024
ba33ae0
Merge branch 'next' into feat/v4-not-tweaks
thecrypticace Oct 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests
  • Loading branch information
thecrypticace authored and RobinMalfait committed Oct 24, 2024
commit 92e8d31796d4b69978863391ec1dbbf1eb845778
31 changes: 31 additions & 0 deletions packages/tailwindcss/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2212,6 +2212,37 @@ describe('@variant', () => {
}"
`)
})

test('style-rules and at-rules', async () => {
let { build } = await compile(css`
@variant cant-hover (&:not(:hover), &:not(:active), @media not (any-hover: hover), @media not (pointer: fine));

@layer utilities {
@tailwind utilities;
}
`)
let compiled = build(['cant-hover:focus:underline'])

expect(optimizeCss(compiled).trim()).toMatchInlineSnapshot(`
"@layer utilities {
:is(.cant-hover\\:focus\\:underline:not(:hover), .cant-hover\\:focus\\:underline:not(:active)):focus {
text-decoration-line: underline;
}

@media not (any-hover: hover) {
.cant-hover\\:focus\\:underline:focus {
text-decoration-line: underline;
}
}

@media not (pointer: fine) {
.cant-hover\\:focus\\:underline:focus {
text-decoration-line: underline;
}
}
}"
`)
})
})

describe('body with @slot syntax', () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/tailwindcss/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ async function parseCss(
let styleRuleSelectors: string[] = []

for (let selector of selectors) {
selector = selector.trim()

if (selector.startsWith('@')) {
atRuleSelectors.push(selector)
} else {
Expand Down