postcss / postcss-custom-properties

Use Custom Properties in CSS

Home Page:https://postcss.github.io/postcss-custom-properties

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Resolve variables in media queries

hgl opened this issue · comments

As mentioned in https://gist.github.com/hgl/77f0141eea04817ee0af

I would like to make this plugin also resolve variables used in media queries (including custom media queries).

But I need your opinion on the breaking change to the preserve property I proposed in that gist (tl;dr enabling it doesn't fallback to specified values for resolvable values).

This is invalid according to custom props specs so I won't add that into this module. I will close this issue when I will add a note about that in the Readme.

Is it because media queries don't inherit from the :root element?

OK, here is a workaround (not in @custom-media so far)
https://github.com/WolfgangKluge/postcss-media-variables

You should use postcss-custom-media instead to stay in the future of CSS.

commented

I'm so happy about this!

You should use postcss-custom-media instead to stay in the future of CSS.

It's 2021 now, and this plugin hasn't been updated in 4 years and doesn't support PostCSS 7 or newer. Has anyone found a workaround or just decided to downgrade to PostCSS 6?

commented

i feel old

You should use postcss-custom-media instead to stay in the future of CSS.

It's 2021 now, and this plugin hasn't been updated in 4 years and doesn't support PostCSS 7 or newer. Has anyone found a workaround or just decided to downgrade to PostCSS 6?

v8.0.0 supports PostCSS 8