Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-layer] What is the priority in this case? #7541

Closed
joekingTheThird3 opened this issue Jul 28, 2022 · 1 comment
Closed

[css-layer] What is the priority in this case? #7541

joekingTheThird3 opened this issue Jul 28, 2022 · 1 comment
Labels
Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. css-cascade-5

Comments

@joekingTheThird3
Copy link

joekingTheThird3 commented Jul 28, 2022

  • please tag the issue title with the spec's shortname, like [css-foo]
    (this is the name from the spec URL, without a level number unless the issue is specific to that level).
    If you're proposing a new feature that doesn't obviously fit in an existing spec, skip this part — don't make something up.

  • please be specific (in the title and issue) about what you want to change:
    “make it better” means different things to different people!

  • please link to the spec section you're talking about, or at least the spec



<!-- layer statement   - we have an unused layer, but 2 following layers are used  (lgreen, lblue)-->

<!-- it looks like the @layer lred at rule is the winner but it is declared earliest , shouldn't the last win? lblue should win? -->

@layer l, lgreen, lblue;

.box{

width:100px;
height: 100px;
border: solid 1px #f00;

}
@layer lred{
.top{
background: red;
}

}

@layer lgreen{
.top{
background: green;
}

}

@layer lblue{
.top{
background: blue;
}

}

<!-- html -->
<div class="box top">
</div>

Why is the box red? firefox 103 and google chrome.

@Loirooriol
Copy link
Contributor

lred is actually declared last, since @layer l, lgreen, lblue; declares these first.

See https://drafts.csswg.org/css-cascade-5/#layer-ordering

Cascade layers are sorted by the order in which they first are declared

@Loirooriol Loirooriol closed this as not planned Won't fix, can't repro, duplicate, stale Jul 29, 2022
@Loirooriol Loirooriol added Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. css-cascade-5 labels Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. css-cascade-5
Projects
None yet
Development

No branches or pull requests

2 participants