Skip to content

Commit

Permalink
[NO-TICKET] Make Sass syntax compatible with node-sass compiler (#1958)
Browse files Browse the repository at this point in the history
* Revert Sass updates that are incompatible with `node-sass`

There are still a couple warnings in dart `sass` about the `percentage()` calculations, but it doesn't break the build

* Fix warning that division needs to be used in calc

We can use `calc` (compatible with node-sass) instead of `math.div` (dart sass only) if we convert it to a percentage in a different way
  • Loading branch information
pwolfert committed Jul 12, 2022
1 parent 1112585 commit ff7579c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions packages/design-system/src/styles/components/_UsaBanner.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// @TODO: deprecate usage of these when modification of these in
// consuming systems is either not done or easily resolved
@use 'sass:math';

$usa-banner-mobile-close-size: 48px;
$usa-caret-icon-size: 10px;
$usa-banner-font-family: $font-sans;
Expand Down Expand Up @@ -163,7 +161,7 @@ $usa-banner-font-family: $font-sans;
.ds-c-usa-banner__lock-image {
height: 1.5ex;
vertical-align: inherit;
width: math.div(1.5ex * 52, 64);
width: calc(1.5ex * 52 / 64);

path {
fill: currentColor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@use 'sass:math';

@mixin clearfix {
&::before {
content: '';
Expand All @@ -14,8 +12,8 @@
}

@mixin flexbox-col($size) {
flex: 0 0 percentage(math.div($size, $grid-columns));
max-width: percentage(math.div($size, $grid-columns)); // IE10+ and Firefox
flex: 0 0 calc($size / $grid-columns) * 100%;
max-width: calc($size / $grid-columns) * 100%; // IE10+ and Firefox
}

@mixin equal-width-flexbox-col() {
Expand Down
2 changes: 0 additions & 2 deletions packages/design-system/src/styles/utilities/_grid.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@use 'sass:math';

@import '../settings/index.scss';

// TODO: Update class namespace to utilities
Expand Down

0 comments on commit ff7579c

Please sign in to comment.