esbuild icon indicating copy to clipboard operation
esbuild copied to clipboard

Child combinator (>) in :has sometimes vanishes when transpiling nested css

Open malte-laukoetter opened this issue 6 months ago • 0 comments

When transpiling the following css using --supported:nesting=false the child combinator within the :has vanishes

.a :has(> .c) {
  .b & {
    background-color: green;
  }
}

result:

.b :is(.a :has(.c)) {
  background-color: green;
}

expected result:

.b :is(.a :has(>.c)) {
  background-color: green;
}

esbuild playground: https://esbuild.github.io/try/#YgAwLjIzLjAALS1zdXBwb3J0ZWQ6bmVzdGluZz1mYWxzZQBlAGVudHJ5LmNzcwAuYSA6aGFzKD4gLmMpIHsKICAuYiAmIHsKICAgIGJhY2tncm91bmQtY29sb3I6IGdyZWVuOwogIH0KfQ

see also: https://github.com/vuejs/core/issues/11613

malte-laukoetter avatar Aug 14 '24 10:08 malte-laukoetter