Skip to content
Merged
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
Update packages/tailwindcss/src/ast.ts
Co-authored-by: Jordan Pittman <[email protected]>
  • Loading branch information
RobinMalfait and thecrypticace committed Jan 31, 2025
commit f7f38a84b5b57497763912d887e59e0692a194d5
3 changes: 2 additions & 1 deletion packages/tailwindcss/src/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ export function optimizeAst(ast: AstNode[]) {
copy.nodes.length > 0 ||
copy.name === '@layer' ||
copy.name === '@charset' ||
copy.name === '@custom-media'
copy.name === '@custom-media' ||
copy.name === '@namespace'
Copy link
Member

@philipp-spiess philipp-spiess Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this just be all at-rules? 🤔 Nevermind me here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@media (foo) {}

Should be removed imo

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i noticed this too, you just responded before i could update my comment heh

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe, I think in theory we could invert the condition and don't touch everything but the @media (but then we need to check for @suspports as well.

In a perfect world @layer foo {} is also removed, (because you should use @layer foo; but we don't make that distinction.

) {
parent.push(copy)
}
Expand Down