Re: [csswg-drafts] Proposal: Custom CSS Functions & Mixins (#9350)

@DarkWiiPlayer 

> I recently had a discussion under a dev.to post about CSS and the topic of scoping came up again, which reminded me of a problem I've already occasionally faced with custom properties that I expect will only get worse with this new feature and that's name collisions.

It's definitely a good callout, and I feel like `@layer` _could_ provide this kind of scoping, if every layer shared a mixin scope (which Less does for namespaced mixins). Therefore, if you wanted to override a mixin, you could do it within a new referenced `@layer` of the same name. However, that does imply you could only _call_ (or "apply") the mixin within the same layer.

A downside of `@layer`, though, is that if you use `@layer` anywhere on a page, you pretty much have to use `@layer` everywhere, for every bit of imported styles, so on second thought it may not be the best way to namespace / scope things. 🤔 

-- 
GitHub Notification of comment by matthew-dean
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9350#issuecomment-2048629370 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 11 April 2024 00:10:57 UTC