Re: [csswg-drafts] [css-selectors][css-namespaces] Lexical Scoping (#4061)

Re: this

> Because there's not just one namespace involved. There's usually an application namespace where things can be unique, but each thirdparty library usually has associated css that really aught to be in its own namespace. If you're using something like bootstrap, all those classes should be in their own namespace. I think the idea of using <button app:class="my application classes" bootstrap:class="btn btn-primary"> is more clear and quite enticing.

That example is a little more clear and makes more sense; however, I would still _only_ expect that to have an effect on that particular element. I think to have a "sub-tree effect", then some kind of namespace identifier is needed. I feel like it's incomplete without it. Meaning:
```html
<button app:class="my application classes"> <!-- This applies to this element -->
  <p>...</p>  <!-- This should receive all <p> global styles and namespace app:p styles -->
</button>
```
....but....
```html
<button cssns="app" class="my application classes"> <!-- now we're scope-limited -->
  <p>...</p>  <!-- This should receive all only namespace app:p styles -->
  <p cssns="none" bootstrap:class="paragraph">...</p>  <!-- turn off inheritance and scope a class -->
</button>
```
What about some kind of blend like that to make it clear when there's a "sub-tree effect", and when I'm specifically applying a namespace'd class?

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

Received on Monday, 26 August 2019 23:44:05 UTC