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

> I mean, not only does the namespace prop get hairy

@matthew-dean  I agree. I think better syntax and behavior around concatenated stylesheets could be arrived at.

> but the xml-style namespacing is extremely limited

I don't see how it's limited. You indicated that this is more flexible:

```html
<div scope="all and (foo, bar)">
```

But my proposal could allow this by declaring that the existing `:scope` selector matches the namespaced class attribute with an empty/non-present value of `""`. For example:

```css
@namespace local(button) {
  :scope { 
    /* styles for the button element */
  }
}
```

```html
<button buttons:class>
```

More complex scoping of descendant elements could accomplish this by combinating with `:scope`.

> and this form doesn't allow multiple inheritance (or exclusions).

We can certainly add syntax for importing and extending namespaces within CSS.

> It also clashes with xml namespacing, does it not?

It doesn't clash with xml namespacing... it is using xml namespacing. That's why I think my proposal is "simple"... it builds on existing primitives already in browsers.

I don't see how your proposed syntax avoids namespace collisions, which is a major goal of this proposal.

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

Received on Monday, 26 August 2019 18:56:10 UTC