- From: Keith Grant via GitHub <sysbot+gh@w3.org>
- Date: Wed, 01 Mar 2023 20:03:05 +0000
- To: public-css-archive@w3.org
FWIW, I generally anticipate my approach with scope to be: first, setting up layers along the lines of `@layer reset, base, components, layout, utilities;`, and then on the `components` layer, *everything* will be a scoped component. When the component has a "slot" to nest more components, I will make heavy use of donut scoping to prevent the styles from reaching into other components. This prevents one component from styling another unless I explicitly need it to. I've essentially opted-in to strong scoping behavior. At this point, it's rare that I write styles in two components that might target the same element. But if I did, I would want weak scoping: When an outer scope doesn't use donut scoping, and targets elements of an inner scope, specificity becomes my only means of controlling which selector takes precedence; with strong scoping, I have no way to give the outer scope precedence. If I try to define this control using nested layers instead, scope X styles will _always_ override scope Y styles, and I can't make informed decisions on an element-by-element basis. Maybe I'm missing something, but I'm not sure nesting makes much of a difference to me, as I would nest very similarly from component to component. And I can always use an id or `:where()` to manipulate specificity up and down regardless of nesting. -- GitHub Notification of comment by keithjgrant Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6790#issuecomment-1450775387 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 1 March 2023 20:03:07 UTC