Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostCSS @custom-media not being generated #92

Open
roycifer opened this issue May 14, 2020 · 5 comments
Open

PostCSS @custom-media not being generated #92

roycifer opened this issue May 14, 2020 · 5 comments

Comments

@roycifer
Copy link

roycifer commented May 14, 2020

I have a fresh install of Slater where @custom-media is not being generated by PostCSS. The CSS source still has invalid media queries like (--800) which are defined in src/styles/global/var.css. Any ideas why and how to fix (or what I might be doing incorrectly)?

@iamkevingreen
Copy link
Member

@roycifer so this seems to be something that's changed in the postCSS spec?, I am actually trying to add custom media to simple starter (unrelated to slater). Might need to adopt another pattern here but I am investigating.

@seandogg
Copy link
Contributor

seandogg commented Jun 24, 2020

I ran npm update and npm install in my project, which brought me here.

After that (not sure if it's related), each @media (--1200) style of media query in my css stopped working. I ended up adopting this way of writing media queries because it's short and I'm lazy so I liked writing MQs like that.

I ran a find+replace in my project and easily updated them to traditional style MQs. But thought I'd holler here just to let you all know that this postCSS update may be breaking the starter theme

@iamkevingreen
Copy link
Member

@seandogg I've actually not been able to get custom-media queries to work on any of my postCSS sites so still trying to figure that out, if you've seen any tickets/core or plugin related feel free to link. I've also updated my process to slightly more traditional media queries, I will leave this open until I either update the theme or find a solve for the postCSS issue.

@dav11d
Copy link

dav11d commented Aug 19, 2020

is this related?

#csstools/postcss-preset-env#175 (comment) #

@artshostak
Copy link

Can anyone help with the slater.config.js code structure to add @dav11d's previously mentioned fix?

postcssPresetEnv({
  features: {
    'custom-media-queries': true
  }
  ...
})

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

No branches or pull requests

5 participants