Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the POSTCSS equivalent for the Ampersand(&) commonly used in LESS, SASS and STYLUS?

Tags:

sass

less

postcss

So with less I could do & to do a combination.

eg:

.baa {
  &.foo {
    opacity: 1;
  }
}

which would generate a rule .baa.foo

What plugins and syntax do we need for postcss to do the same thing?

like image 954
Nikos Avatar asked Nov 04 '25 15:11

Nikos


1 Answers

For posterity,

we need this postcss plugin:

https://github.com/postcss/postcss-nested

like image 86
Nikos Avatar answered Nov 07 '25 05:11

Nikos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!