travco / postcss-extend

A PostCSS plugin to minimize the number of repeat-selectors and rules you write
MIT License
114 stars 8 forks source link

Wrong output with postcss-extend loaded before postcss-nested (as suggested by README.md) #39

Open andersk opened 5 years ago

andersk commented 5 years ago

According to README.md:

Public Service Announcement: Because of an issue with postcss-nested, if you are trying to use both postcss-nested and this plugin, you need to use this plugin first.

However, (1) that issue has been closed, and (2) using postcss-extend first as suggested causes a different issue described in (the initial report of) #25:

Test postcss:

%testext { color: blue; }

.testrule
{
    &_subrule { @extend %testext; }
}

resulting css

&_subrule { color: blue; }

expected css

.testrule_subrule { color: blue; }

Putting postcss-nested before postcss-extend results in the expected CSS. (The remaining comments of #25 meander to a different issue that seems to have since been fixed, but this one remains.)

Should the README.md suggestion be reversed, or does this count as another bug in one of the plugins?