-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Conversation
Add [autoprefixer](https://github.com/postcss/autoprefixer) as a final build step in the CSS pipeline.
Deploy preview for docusaurus-preview ready! Built with commit 8a4fcf8 |
function autoPrefixCss(cssContent) { | ||
return postcss([autoprefixer]) | ||
.process(cssContent, { | ||
from: undefined, |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
There was a problem hiding this 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!
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
autoprefix css
unit test inutils.test.js
, modeled after theminify css
test.test.css
to include css rule that triggers autoprefixer. Updated snapshots of theminify css
test to include the new css rule.Related PRs
None.