pascalduez / postcss-apply

PostCSS plugin enabling custom properties sets references
The Unlicense
164 stars 12 forks source link

The @apply rule can only be declared inside Rule type nodes? #32

Closed jonathantneal closed 7 years ago

jonathantneal commented 7 years ago

previously valid usage alongside css nesting:

.excerpt-of-my-component {
    background-color: var(--mono-97);

    @media (--screen-ml) {
        @apply --submenu-styles;

        display: flex;
        flex-wrap: wrap;
        padding-top: 48px;
    }
}

I now get the error:

The @apply rule can only be declared inside Rule type nodes.

Another (made-up) but very possible example

.excerpt-of-my-component {
    @nest [dir="rtl"] & {
        @apply --rtl-behavior-styles;
    }
}

Could this plugin search for an ancestor rule rather than a parent rule?

pascalduez commented 7 years ago

Available as of postcss-apply@0.8.0