W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2020

[csswg-drafts] [css-cascade] Should un-named cascade layers be allowed? (#5792)

From: Miriam Suzanne via GitHub <sysbot+gh@w3.org>
Date: Mon, 14 Dec 2020 23:08:58 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-767005426-1607987337-sysbot+gh@w3.org>
mirisuzanne has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-cascade] Should un-named cascade layers be allowed? ==
The draft Cascade 5 specification allows [anonymous/unnamed cascade layers](https://drafts.csswg.org/css-cascade-5/#unnamed-layers). 

While these layers behave exactly like named layers in every way, they do not provide a "hook" for merging or re-ordering `@layer` rules. In most use-cases this would only be syntax-sugar for brevity -- relying on well-organized source-order rather than any explicit names. However, it could be used by teams as a way to "force" an organizing convention (all layer code must be defined in one place), or by libraries wanting to merge & hide a set of internal "private" layers that they don't want exposed to author manipulation:

```css
/* bootstrap-base.css */
/* unnamed wrapper layers around each sub-file */
@layer url(base-forms.css);
@layer url(base-links.css);
@layer url(base-headings.css);

/* bootstrap.css */
/* the intrnal names are hidden from access, subsumed in "base" */
@layer base url(bootstrap-base.css);

/* author.css */
/* author has access to bootstrap.base layer, but not into unnamed layers */
@layer bootstrap url(bootstrap.css);
```

I think that's a useful feature for providing more control to authors, but others have raised issues that it might be misused.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5792 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 14 December 2020 23:09:03 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:37 UTC