8000 Handle placeholders in selector pseudos more semantically · Issue #2228 · sass/sass · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Handle placeholders in selector pseudos more semantically #2228
Closed
@nex3

Description

@nex3

Right now, no complex selectors containing un-extended placeholders in any context are rendered. This makes sense in most cases, but for selector pseudos it doesn't always. We generally treat placeholder selectors as though they're selectors that match no elements, and our current scheme doesn't always respect those semantics.

In general, if a selector pseudo contains a selector list, its complex parent should be hidden if and only if the entire selector list in the selector pseudo would be hidden.

The :not() pseudo is a special case. If its entire selector list would be hidden, it doesn't hide its parent; instead, it's treated as though it matched every element. This means it's stripped from its compound selector, and if that selector would be empty it's replaced with the universal selector *.

For example:

a:matches(%b) {x: y}
a:matches(%b, c) {x: y}
a:not(%b) {x: y}
a:not(%b, c) {x: y}
:not(%b) {x: y}

would compile to:

a:matches(c) {
  x: y;
}

a {
  x: y;
}

a:not(c) {
  x: y;
}

* {
  x: y;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0