Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Handle lists
  • Loading branch information
philipp-spiess committed Nov 18, 2024
commit 7efb0725057e1a369a7da386bd0ed4c73d0176a7
13 changes: 12 additions & 1 deletion packages/tailwindcss/src/compat/plugin-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2885,6 +2885,9 @@ describe('addUtilities()', () => {
'.h~.i': {
color: 'red',
},
'.j.j': {
color: 'red',
},
})
},
}
Expand All @@ -2893,7 +2896,7 @@ describe('addUtilities()', () => {
)

expect(
compiled.build(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']).trim(),
compiled.build(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']).trim(),
).toMatchInlineSnapshot(
`
"@layer utilities {
Expand Down Expand Up @@ -2937,6 +2940,14 @@ describe('addUtilities()', () => {
color: red;
}
}
.j {
&.j {
color: red;
}
.j& {
color: red;
}
}
}"
`,
)
Expand Down
6 changes: 1 addition & 5 deletions packages/tailwindcss/src/compat/plugin-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,9 @@ export function buildPluginApi(
continue
}

if (name[0] === '.' && IS_VALID_UTILITY_NAME.test(name.slice(1))) {
utils.get(name.slice(1)).push(...objectToAst(css))
continue
}

let selectorAst = SelectorParser.parse(name)
let foundValidUtility = false

SelectorParser.walk(selectorAst, (node) => {
if (
node.kind === 'selector' &&
Expand Down
Loading