Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.

Comments

Add SASS compilation and sync the CSS files#1391

Merged
Ismail-elkorchi merged 1 commit intoAutomattic:masterfrom
Ismail-elkorchi:compiling-sass
Apr 9, 2020
Merged

Add SASS compilation and sync the CSS files#1391
Ismail-elkorchi merged 1 commit intoAutomattic:masterfrom
Ismail-elkorchi:compiling-sass

Conversation

@Ismail-elkorchi
Copy link
Contributor

@Ismail-elkorchi Ismail-elkorchi commented Apr 8, 2020

Changes proposed in this Pull Request:

In this PR I added the command compile:css to 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 --fix script to node-sass in compile:css command, but that was not enough, because stylelint didn't fix all the issue in the first pass. So I made the compile:css command run the stylelint --fix twice :

"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:css command.

Related issue(s):

#1149, #1159, #1168, #1237, #1221, #932

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant