Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Document all feature names and warn on unrecognized features #156

Closed
ghost opened this issue Dec 5, 2019 · 2 comments · Fixed by csstools/postcss-plugins#313
Closed

Comments

@ghost
Copy link

ghost commented Dec 5, 2019

Hey there, just wasted a good chunk of the day trying to debug why custom media queries weren't being transpiled. It turns out I was trying to use the feature custom-media in my config, when in fact the feature is named custom-media-queries.

That might sound like a foolish mistake... except the name of the feature is simply not documented anywhere that I can tell:

  • It's not in README.md or any other documentation in the repo

  • If I check https://preset-env.cssdb.org/features#custom-media-queries, I can see that the feature exists, but not how to activate it:

    image

    (If I hit the "plugin" link above, the plugin that preset-env wraps is in fact named "postcss-custom-media" -- not "postcss-custom-media-queries"! -- misleading me further.)

postcss-preset-env also happily accepts non-existent feature names in its config without raising a warning, which exacerbates the issue. If it had refused to run or raised a warning when I tried to activate the nonexistent custom-media feature, that would've at least saved me some debugging time!

@skrhlm
Copy link

skrhlm commented Dec 18, 2019

Thank you so much for creating this issue. This saved my day.

I was going crazy over why custom media queries was being skipped. This helped me figure out that it actually ( seems very clear now in retrospect ) does not polyfill them since it's only in stage 1 and the default for postcss-preset-env is {stage: 2}.

@Antonio-Laguna
Copy link
Member

This repository is getting archived. If this issue keeps happening please re-open on @csstools/postcss-plugins and we'll do our best to fix it!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants