@import layer and @import supports #18

Closed
dralletje wants to merge 1 commit from import-layer into main
dralletje commented 2025-04-18 17:23:16 +02:00 (Migrated from github.com)

Adds support for https://drafts.csswg.org/css-cascade-5/#layer-declaration

@import "reset.css" layer(base);
@import "components.css" layer screen;
@import url("gridy.css") supports(display: grid) screen;
Adds support for https://drafts.csswg.org/css-cascade-5/#layer-declaration ```css @import "reset.css" layer(base); @import "components.css" layer screen; @import url("gridy.css") supports(display: grid) screen; ```
marijnh commented 2025-04-18 18:35:47 +02:00 (Migrated from github.com)

Attached patch does this in a way that doesn't break use of layer as an identifier throughout the grammar. It doesn't add supports yet, since that still seems to introduce its own whole mini-language, and I'm not sure how stable it is.

Attached patch does this in a way that doesn't break use of `layer` as an identifier throughout the grammar. It doesn't add `supports` yet, since that still seems to introduce its own whole mini-language, and I'm not sure how stable it is.
dralletje commented 2025-04-18 18:50:20 +02:00 (Migrated from github.com)

Sweet!

Wanted to avoid adding a new kind of identifier, but this actually works perfect with the spec!
https://drafts.csswg.org/mediaqueries-4/#typedef-media-type

I don't care for supports much, but I was looking at implementing <general-enclosed> as it could be used in catch alls in other situations as well, would you be interested in that?

Sweet! Wanted to avoid adding a new kind of identifier, but this actually works perfect with the spec! https://drafts.csswg.org/mediaqueries-4/#typedef-media-type I don't care for supports much, but I was looking at implementing [`<general-enclosed>`](https://drafts.csswg.org/mediaqueries-4/#typedef-general-enclosed) as it could be used in catch alls in other situations as well, would you be interested in that?
dralletje commented 2025-04-19 00:49:17 +02:00 (Migrated from github.com)

(Specifically, implementing <any-value>)

(Specifically, implementing [`<any-value>`](https://drafts.csswg.org/css-syntax-3/#typedef-any-value))
marijnh commented 2025-04-19 13:28:40 +02:00 (Migrated from github.com)

You mean just parse any tokens and matched brackets for supports? I guess that would be a clean way to handle that. Can you open a new PR when you get around to this?

You mean just parse any tokens and matched brackets for `supports`? I guess that would be a clean way to handle that. Can you open a new PR when you get around to this?

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lezer/css!18
No description provided.