Skip to content

Conversation

@jessedobbelaere
Copy link

@jessedobbelaere jessedobbelaere commented May 7, 2025

Tailwind CSS v4 was released, which heavily relies on modern Cascade Layers with the @layer property

Sample of a generated css file using Tailwind v4:

/*! tailwindcss v4.1.5 | MIT License | https://tailwindcss.com */
@layer properties {
...
}
@layer theme {
    :root, :host {
        .. all css vars go here
    }
}
@layer base {
...
}
@layer utilities {
    .text-sm {
        font-size: var(--text-sm);
        line-height: var(--tw-leading, var(--text-sm--line-height))
    }
}

This causes the Critical CSS for my Tailwind V4 site to be almost completely empty, because literally everything is wrapped inside the @layer property, which is not part of the safelist of penthouse, so it gets stripped out.

Given the popularity of Tailwind, could we get such fix merged in a reasonable timeframe? 🙏

@khalwat
Copy link

khalwat commented May 7, 2025

Would love to see this merged in

@khalwat
Copy link

khalwat commented May 7, 2025

It's possible we might need to fork the repo and apply the changes, or get some additional maintainers added.

@michtio
Copy link

michtio commented May 7, 2025

@khalwat @jessedobbelaere also willing to help maintaining/forking this if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants