From 808ac89aea2c0e978f71b12ca29bea35603cf57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Wed, 12 Apr 2023 16:48:15 +0200 Subject: [PATCH 01/11] Workflows: improve `node-sass` error message when Sass vars are found --- .github/workflows/node-sass.yml | 7 +++++-- scss/_button-group.scss | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node-sass.yml b/.github/workflows/node-sass.yml index d83e3e70f710..562a448d65eb 100644 --- a/.github/workflows/node-sass.yml +++ b/.github/workflows/node-sass.yml @@ -39,10 +39,13 @@ jobs: - name: Check built CSS files shell: bash run: | - if [[ $(find dist-sass/css/ -name "*.css" | xargs grep -F "\$" | wc -l | bc) -eq 0 ]]; then + SASS_VARS_FOUND=`find dist-sass/css/ -name "*.css" | xargs grep -F "\$"` + + if [ -z "$SASS_VARS_FOUND" ]; then echo "All good, no Sass variables found" exit 0 else - echo "Found Sass variables!" + echo "Found $(echo "$SASS_VARS_FOUND" | wc -l | bc) Sass variables:" + echo "$SASS_VARS_FOUND" exit 1 fi diff --git a/scss/_button-group.scss b/scss/_button-group.scss index 55ae3f65d255..eb7969a2d1fa 100644 --- a/scss/_button-group.scss +++ b/scss/_button-group.scss @@ -39,7 +39,7 @@ // Prevent double borders when buttons are next to each other > :not(.btn-check:first-child) + .btn, > .btn-group:not(:first-child) { - margin-left: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list + margin-left: calc($btn-border-width * -1); // stylelint-disable-line function-disallowed-list } // Reset rounded corners @@ -126,7 +126,7 @@ > .btn:not(:first-child), > .btn-group:not(:first-child) { - margin-top: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list + margin-top: calc($btn-border-width * -1); // stylelint-disable-line function-disallowed-list } // Reset rounded corners From 6fb9a227abe5bf2fe24d921c856084349646131c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Wed, 12 Apr 2023 16:55:17 +0200 Subject: [PATCH 02/11] Reintroduce the right fix --- scss/_button-group.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scss/_button-group.scss b/scss/_button-group.scss index eb7969a2d1fa..55ae3f65d255 100644 --- a/scss/_button-group.scss +++ b/scss/_button-group.scss @@ -39,7 +39,7 @@ // Prevent double borders when buttons are next to each other > :not(.btn-check:first-child) + .btn, > .btn-group:not(:first-child) { - margin-left: calc($btn-border-width * -1); // stylelint-disable-line function-disallowed-list + margin-left: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list } // Reset rounded corners @@ -126,7 +126,7 @@ > .btn:not(:first-child), > .btn-group:not(:first-child) { - margin-top: calc($btn-border-width * -1); // stylelint-disable-line function-disallowed-list + margin-top: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list } // Reset rounded corners From c091ab10176827f10341fb72beb3da258c511b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Wed, 12 Apr 2023 17:14:47 +0200 Subject: [PATCH 03/11] Fix passing workflow? --- .github/workflows/node-sass.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/node-sass.yml b/.github/workflows/node-sass.yml index 562a448d65eb..98df3bff5165 100644 --- a/.github/workflows/node-sass.yml +++ b/.github/workflows/node-sass.yml @@ -39,8 +39,7 @@ jobs: - name: Check built CSS files shell: bash run: | - SASS_VARS_FOUND=`find dist-sass/css/ -name "*.css" | xargs grep -F "\$"` - + SASS_VARS_FOUND=$(find dist-sass/css/ -name "*.css" | xargs grep -F "\$") if [ -z "$SASS_VARS_FOUND" ]; then echo "All good, no Sass variables found" exit 0 From 282378e31ba546d507b0b14f9f9aa9159540aaec Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 12 Apr 2023 18:38:27 +0300 Subject: [PATCH 04/11] Update node-sass.yml --- .github/workflows/node-sass.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-sass.yml b/.github/workflows/node-sass.yml index 98df3bff5165..e7adba6938ee 100644 --- a/.github/workflows/node-sass.yml +++ b/.github/workflows/node-sass.yml @@ -39,7 +39,7 @@ jobs: - name: Check built CSS files shell: bash run: | - SASS_VARS_FOUND=$(find dist-sass/css/ -name "*.css" | xargs grep -F "\$") + SASS_VARS_FOUND=$(find dist-sass/css/ -name "*.css" -print0 | xargs -0 grep -F "\$") if [ -z "$SASS_VARS_FOUND" ]; then echo "All good, no Sass variables found" exit 0 From a988275d36392a55918e305fcfa4db91ece1ab85 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 12 Apr 2023 18:41:36 +0300 Subject: [PATCH 05/11] Update node-sass.yml --- .github/workflows/node-sass.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-sass.yml b/.github/workflows/node-sass.yml index e7adba6938ee..98df3bff5165 100644 --- a/.github/workflows/node-sass.yml +++ b/.github/workflows/node-sass.yml @@ -39,7 +39,7 @@ jobs: - name: Check built CSS files shell: bash run: | - SASS_VARS_FOUND=$(find dist-sass/css/ -name "*.css" -print0 | xargs -0 grep -F "\$") + SASS_VARS_FOUND=$(find dist-sass/css/ -name "*.css" | xargs grep -F "\$") if [ -z "$SASS_VARS_FOUND" ]; then echo "All good, no Sass variables found" exit 0 From 4b13439465db46309db2f0e1b8022877c177a394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Wed, 12 Apr 2023 18:12:06 +0200 Subject: [PATCH 06/11] Fix running --- .github/workflows/node-sass.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-sass.yml b/.github/workflows/node-sass.yml index 98df3bff5165..e3ec4b0530fa 100644 --- a/.github/workflows/node-sass.yml +++ b/.github/workflows/node-sass.yml @@ -37,7 +37,7 @@ jobs: # Check that there are no Sass variables (`$`) - name: Check built CSS files - shell: bash + shell: bash {0} run: | SASS_VARS_FOUND=$(find dist-sass/css/ -name "*.css" | xargs grep -F "\$") if [ -z "$SASS_VARS_FOUND" ]; then From b1bf24e3793a01c80d1ce669ece0bf7a23436fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20D=C3=A9ramond?= Date: Wed, 12 Apr 2023 18:25:16 +0200 Subject: [PATCH 07/11] Reintroduce `-print0`/`-0` syntax --- .github/workflows/node-sass.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node-sass.yml b/.github/workflows/node-sass.yml index e3ec4b0530fa..1f54d96b66fc 100644 --- a/.github/workflows/node-sass.yml +++ b/.github/workflows/node-sass.yml @@ -39,7 +39,7 @@ jobs: - name: Check built CSS files shell: bash {0} run: | - SASS_VARS_FOUND=$(find dist-sass/css/ -name "*.css" | xargs grep -F "\$") + SASS_VARS_FOUND=$(find dist-sass/css/ -name "*.css" -print0 | xargs -0 grep -F "\$") if [ -z "$SASS_VARS_FOUND" ]; then echo "All good, no Sass variables found" exit 0 From e3c56fd58d893a7740b055aa89db74c8cf17bc13 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 13 Apr 2023 09:22:01 +0300 Subject: [PATCH 08/11] Ignore dist-sass folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2215d636addf..0c9b6f55651c 100644 --- a/.gitignore +++ b/.gitignore @@ -38,5 +38,6 @@ Thumbs.db *.komodoproject # Folders to ignore +/dist-sass/ /js/coverage/ /node_modules/ From 8035fe24da37ae505a0ca83304b9af9864d0954a Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 13 Apr 2023 08:52:29 +0300 Subject: [PATCH 09/11] Update node-sass.yml --- .github/workflows/node-sass.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/node-sass.yml b/.github/workflows/node-sass.yml index 1f54d96b66fc..c558e447af58 100644 --- a/.github/workflows/node-sass.yml +++ b/.github/workflows/node-sass.yml @@ -35,13 +35,12 @@ jobs: npx --package node-sass@latest node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 scss/ -o dist-sass/css/ ls -Al dist-sass/css - # Check that there are no Sass variables (`$`) - - name: Check built CSS files - shell: bash {0} + - name: Check built CSS files for Sass variables + shell: bash run: | - SASS_VARS_FOUND=$(find dist-sass/css/ -name "*.css" -print0 | xargs -0 grep -F "\$") - if [ -z "$SASS_VARS_FOUND" ]; then - echo "All good, no Sass variables found" + SASS_VARS_FOUND=$(find "dist-sass/css/" -type f -name "*.css" -print0 | xargs -0 --no-run-if-empty grep -F "\$" || true) + if [[ -z "$SASS_VARS_FOUND" ]]; then + echo "All good, no Sass variables found!" exit 0 else echo "Found $(echo "$SASS_VARS_FOUND" | wc -l | bc) Sass variables:" From b54c6d6de7947ea417c1c424a40ed8a2a8058038 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 13 Apr 2023 09:43:12 +0300 Subject: [PATCH 10/11] Revert "Reintroduce the right fix" This reverts commit 6fb9a227abe5bf2fe24d921c856084349646131c. --- scss/_button-group.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scss/_button-group.scss b/scss/_button-group.scss index 55ae3f65d255..eb7969a2d1fa 100644 --- a/scss/_button-group.scss +++ b/scss/_button-group.scss @@ -39,7 +39,7 @@ // Prevent double borders when buttons are next to each other > :not(.btn-check:first-child) + .btn, > .btn-group:not(:first-child) { - margin-left: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list + margin-left: calc($btn-border-width * -1); // stylelint-disable-line function-disallowed-list } // Reset rounded corners @@ -126,7 +126,7 @@ > .btn:not(:first-child), > .btn-group:not(:first-child) { - margin-top: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list + margin-top: calc($btn-border-width * -1); // stylelint-disable-line function-disallowed-list } // Reset rounded corners From 44d821c30a5ade921c8dc0a3eb35eb94d50a7e08 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 13 Apr 2023 09:44:08 +0300 Subject: [PATCH 11/11] Revert "Revert "Reintroduce the right fix"" This reverts commit b54c6d6de7947ea417c1c424a40ed8a2a8058038. --- scss/_button-group.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scss/_button-group.scss b/scss/_button-group.scss index eb7969a2d1fa..55ae3f65d255 100644 --- a/scss/_button-group.scss +++ b/scss/_button-group.scss @@ -39,7 +39,7 @@ // Prevent double borders when buttons are next to each other > :not(.btn-check:first-child) + .btn, > .btn-group:not(:first-child) { - margin-left: calc($btn-border-width * -1); // stylelint-disable-line function-disallowed-list + margin-left: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list } // Reset rounded corners @@ -126,7 +126,7 @@ > .btn:not(:first-child), > .btn-group:not(:first-child) { - margin-top: calc($btn-border-width * -1); // stylelint-disable-line function-disallowed-list + margin-top: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list } // Reset rounded corners