W3C home > Mailing lists > Public > public-css-archive@w3.org > March 2019

Re: [csswg-drafts] [css-selectors] Reference selectors (#3714)

From: Matthew Phillips via GitHub <sysbot+gh@w3.org>
Date: Mon, 18 Mar 2019 22:10:05 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-474120940-1552947004-sysbot+gh@w3.org>
> References may not be combined with other selectors

Why not? I would think `$foo > .thing` would be a useful thing to do. It seems the only alternative is to create another reference.  Does `$foo > $bar` work?  It sounds like it would not. So how do you mimic the child combinator (or sibling combinator or many other such useful CSS selector types)?  I can only imagine that you need to imperatively add the $bar reference in JavaScript (only on immediate children of $foo).

I don't think CSS should adopt features that render other useful CSS features to be disabled. If selectors are a problem then we should improve selectors while still keeping them around. I agree with some of the others that `import` might be a better way of achieving a similar thing. It would allow you to use another stylesheet and mix it in without having its selectors applied globally.

GitHub Notification of comment by matthewp
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3714#issuecomment-474120940 using your GitHub account
Received on Monday, 18 March 2019 22:10:06 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 2 July 2022 03:21:17 UTC