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

add postcss-preset-env, remove autoprefixer #4716

Merged
merged 2 commits into from Sep 25, 2018

Conversation

heygrady
Copy link
Contributor

@heygrady heygrady commented Jul 1, 2018

https://github.com/csstools/postcss-preset-env

There is now a postcss plugin that attempts to do for CSS what babel-preset-env does for js. It reads the same browserlist as babel-preset-env. This makes it possible to write advanced CSS and have it compiled for your target browsers.

This PR removes autoprefixer because postcss-preset-env includes it. The end result is the exact same output as before but with more functionality. The big difference is that you can now do something crazy like use css vars with fallbacks for older browsers. (Using CSS vars instead of using SCSS has some real world advantages, like the ability to manipulate those vars with JS.)

:root {
  --background: #282c34;
}

.App-header {
  background-color: var(--background);
}

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@Timer
Copy link
Contributor

Timer commented Sep 25, 2018

Can you update this please? :-)

@Timer
Copy link
Contributor

Timer commented Sep 25, 2018

Can we limit this to stage 4 only? We don't want to turn on anything stage 3 or less.

@Timer
Copy link
Contributor

Timer commented Sep 25, 2018

Awesome! Thanks for this. 😄

@Timer Timer added this to the 2.0.0 milestone Sep 25, 2018
@Timer Timer merged commit fb6e6f7 into facebook:next Sep 25, 2018
zmitry pushed a commit to zmitry/create-react-app that referenced this pull request Sep 30, 2018
* add postcss-preset-env, remove autoprefixer

* limit to stage 4
@lock lock bot locked and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants