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 autoprefixing to CSS pipeline #867

Merged
merged 1 commit into from Jul 22, 2018

Conversation

helloworld
Copy link
Contributor

@helloworld helloworld commented Jul 21, 2018

Add autoprefixer as a final build step in the CSS pipeline.

Motivation

Fix #784
Suggestion from #784 to add autoprefixing to the CSS pipeline.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

  • Added autoprefix css unit test in utils.test.js, modeled after the minify css test.
  • Updated test.css to include css rule that triggers autoprefixer. Updated snapshots of the minify css test to include the new css rule.

Related PRs

None.

Add [autoprefixer](https://github.com/postcss/autoprefixer) as a final build step in the CSS pipeline.
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jul 21, 2018
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-preview ready!

Built with commit 8a4fcf8

https://deploy-preview-867--docusaurus-preview.netlify.com

function autoPrefixCss(cssContent) {
return postcss([autoprefixer])
.process(cssContent, {
from: undefined,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this from: undefined, required ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The from option is for defining the source file for source maps, but the current implementation rewrites the source file, so a source map is not possible.

Without the from: undefined, an error is logged to the console asking to include the from: undefined option.

Copy link
Contributor

@endiliey endiliey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the unit test as well.

Will need another approval stamp from @yangshun before merging this.

@endiliey endiliey requested a review from yangshun July 22, 2018 06:55
Copy link
Contributor

@yangshun yangshun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks Sashank!

@yangshun yangshun merged commit d3417b3 into facebook:master Jul 22, 2018
@helloworld helloworld deleted the add-autoprefixer branch July 23, 2018 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add autoprefixer into CSS pipeline
5 participants