Hi. I'm a starter theme called _s, or underscores, if you like. I'm a theme meant for hacking so don't use me as a Parent Theme. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for.
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 https://github.com/Automattic/_s/pull/1168#issuecomment-314131813.
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 :
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.
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 https://github.com/Automattic/_s/pull/1168#issuecomment-314131813.To address this issue, I chained
stylelint --fix
script to node-sass incompile:css
command, but that was not enough, because stylelint didn't fix all the issue in the first pass. So I made thecompile:css
command run thestylelint --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):
https://github.com/Automattic/_s/issues/1149, https://github.com/Automattic/_s/pull/1159, https://github.com/Automattic/_s/pull/1168, https://github.com/Automattic/_s/pull/1237, https://github.com/Automattic/_s/pull/1221, https://github.com/Automattic/_s/pull/932