Skip to content

Commit

Permalink
Add a check for interpolation variables to node-sass workflow (#38283)
Browse files Browse the repository at this point in the history
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
  • Loading branch information
julien-deramond and XhmikosR authored Mar 27, 2023
1 parent cad38ef commit 92f9dda
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/node-sass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,15 @@ jobs:
npx --package node-sass@latest node-sass --version
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
run: |
if [[ $(find dist-sass/css/ -name "*.css" | xargs grep -F "\$" | wc -l | bc) -eq 0 ]]; then
echo "All good, no Sass variables found"
exit 0
else
echo "Found Sass variables!"
exit 1
fi
4 changes: 2 additions & 2 deletions scss/_button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scss/_pagination.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
margin-left: $pagination-margin-start;
}

@if $pagination-margin-start == calc($pagination-border-width * -1) {
@if $pagination-margin-start == calc(#{$pagination-border-width} * -1) {
&:first-child {
.page-link {
@include border-start-radius(var(--#{$prefix}pagination-border-radius));
Expand Down
2 changes: 1 addition & 1 deletion scss/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
}

.table-group-divider {
border-top: calc($table-border-width * 2) solid $table-group-separator-color; // stylelint-disable-line function-disallowed-list
border-top: calc(#{$table-border-width} * 2) solid $table-group-separator-color; // stylelint-disable-line function-disallowed-list
}

//
Expand Down
8 changes: 4 additions & 4 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ $input-focus-box-shadow: $input-btn-focus-box-shadow !default;
$input-placeholder-color: var(--#{$prefix}secondary-color) !default;
$input-plaintext-color: var(--#{$prefix}body-color) !default;

$input-height-border: calc($input-border-width * 2) !default; // stylelint-disable-line function-disallowed-list
$input-height-border: calc(#{$input-border-width} * 2) !default; // stylelint-disable-line function-disallowed-list

$input-height-inner: add($input-line-height * 1em, $input-padding-y * 2) !default;
$input-height-inner-half: add($input-line-height * .5em, $input-padding-y) !default;
Expand Down Expand Up @@ -1238,7 +1238,7 @@ $dropdown-bg: var(--#{$prefix}body-bg) !default;
$dropdown-border-color: var(--#{$prefix}border-color-translucent) !default;
$dropdown-border-radius: var(--#{$prefix}border-radius) !default;
$dropdown-border-width: var(--#{$prefix}border-width) !default;
$dropdown-inner-border-radius: calc($dropdown-border-radius - $dropdown-border-width) !default; // stylelint-disable-line function-disallowed-list
$dropdown-inner-border-radius: calc(#{$dropdown-border-radius} - #{$dropdown-border-width}) !default; // stylelint-disable-line function-disallowed-list
$dropdown-divider-bg: $dropdown-border-color !default;
$dropdown-divider-margin-y: $spacer * .5 !default;
$dropdown-box-shadow: $box-shadow !default;
Expand Down Expand Up @@ -1295,7 +1295,7 @@ $pagination-color: var(--#{$prefix}link-color) !default;
$pagination-bg: var(--#{$prefix}body-bg) !default;
$pagination-border-radius: var(--#{$prefix}border-radius) !default;
$pagination-border-width: var(--#{$prefix}border-width) !default;
$pagination-margin-start: calc($pagination-border-width * -1) !default; // stylelint-disable-line function-disallowed-list
$pagination-margin-start: calc(#{$pagination-border-width} * -1) !default; // stylelint-disable-line function-disallowed-list
$pagination-border-color: var(--#{$prefix}border-color) !default;

$pagination-focus-color: var(--#{$prefix}link-hover-color) !default;
Expand Down Expand Up @@ -1429,7 +1429,7 @@ $popover-max-width: 276px !default;
$popover-border-width: var(--#{$prefix}border-width) !default;
$popover-border-color: var(--#{$prefix}border-color-translucent) !default;
$popover-border-radius: var(--#{$prefix}border-radius-lg) !default;
$popover-inner-border-radius: calc($popover-border-radius - $popover-border-width) !default; // stylelint-disable-line function-disallowed-list
$popover-inner-border-radius: calc(#{$popover-border-radius} - #{$popover-border-width}) !default; // stylelint-disable-line function-disallowed-list
$popover-box-shadow: $box-shadow !default;

$popover-header-font-size: $font-size-base !default;
Expand Down
2 changes: 1 addition & 1 deletion scss/forms/_input-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
}

> :not(:first-child):not(.dropdown-menu)#{$validation-messages} {
margin-left: calc($input-border-width * -1); // stylelint-disable-line function-disallowed-list
margin-left: calc(#{$input-border-width} * -1); // stylelint-disable-line function-disallowed-list
@include border-start-radius(0);
}

Expand Down

0 comments on commit 92f9dda

Please sign in to comment.