postcss / postcss-simple-vars

PostCSS plugin for Sass-like variables
MIT License
415 stars 36 forks source link

Add keep option #79

Closed notiv-nt closed 5 years ago

notiv-nt commented 5 years ago

With keep: true

image

Without (by default):

image

notiv-nt commented 5 years ago

Purpose:

Parse media variables before sass, and keep them for next parsing

postcss-inline-media > postcss-simple-vars > sass

$from-sm: (min-width: 320px);

body {
  color: @from-sm red;
}

>

@media (min-width: 320px) {
  body {
    color: red;
  }
}
ai commented 5 years ago

Good idea. I will accept and release it next week.

ai commented 5 years ago

Released in 5.0.2