PHP-CSS-Parser icon indicating copy to clipboard operation
PHP-CSS-Parser copied to clipboard

Add support for CSS Nesting

Open jonaskohl opened this issue 1 year ago • 0 comments

Current browsers support the CSS Nesting Module (see spec). This package currently does not support it.

Given the input

.nesting {
  color: hotpink;

  > .is {
    color: rebeccapurple;

    > .awesome {
      color: deeppink;
    }
  }
}

the current output is

.nesting {
        color: hotpink;
        color: rebeccapurple;
        color: deeppink;
}

whereas it should remain unchanged or at least be transformed to something like this:

.nesting {
  color: hotpink;
}

.nesting > .is {
  color: rebeccapurple;
}

.nesting > .is > .awesome {
  color: deeppink;
}

jonaskohl avatar Mar 12 '24 09:03 jonaskohl