Skip to content

[css-cascade] A way to escape the current cascade layer and render styles in the parent layer (@layer ..) #11010

Closed
@benface

Description

@benface

My use case is a framework that lets you generate styles in a particular layer. For instance, Tailwind CSS v4 generates all the utility classes in a utilities layer (which I can customize). If I want some utilities to have lower precedence than others, I can wrap them in another layer since unlayered styles beat layered styles. But if I want some utilities to have higher precedence than others, I am forced to resort to specificity hacks (e.g. :is(#a, .my-actual-selector)). It would be nice if I could wrap them in @layer ..overrides and they would win because I would define overrides after utilities.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.css-cascade-5

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions