This repository was archived by the owner on Sep 5, 2025. It is now read-only.
Add SASS compilation and sync the CSS files#1391
Merged
Ismail-elkorchi merged 1 commit intoAutomattic:masterfrom Apr 9, 2020
Ismail-elkorchi:compiling-sass
Merged
Add SASS compilation and sync the CSS files#1391Ismail-elkorchi merged 1 commit intoAutomattic:masterfrom Ismail-elkorchi:compiling-sass
Ismail-elkorchi merged 1 commit intoAutomattic:masterfrom
Ismail-elkorchi:compiling-sass
Conversation
This was referenced Apr 8, 2020
Closed
This was referenced May 3, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this Pull Request:
In this PR I added the command
compile:cssto package.json to compile SASS files using node-sass. The problem is that node-sass has some weird behavior when it comes to comments and nesting. This is something that is known since the early attempts to automate the compilation of CSS #1168 (comment).To address this issue, I chained
stylelint --fixscript to node-sass incompile:csscommand, but that was not enough, because stylelint didn't fix all the issue in the first pass. So I made thecompile:csscommand run thestylelint --fixtwice :"compile:css": "node-sass sass/style.scss style.css && node-sass sass/woocommerce.scss woocommerce.css && stylelint '*.css' --fix || true && stylelint '*.css' --fix"For the CSS inline comment problem, I borrowed the solution suggested by @m-e-h in the comment mentioned above. And by the way I removed some redundant comments.
The changes made to style.css and woocommerce.css were generated using the
compile:csscommand.Related issue(s):
#1149, #1159, #1168, #1237, #1221, #932