Skip to content

Commit

Permalink
fix(sass): remove usage of slash as division
Browse files Browse the repository at this point in the history
  • Loading branch information
jfiala-cz committed May 9, 2024
1 parent c27f04d commit aaf140d
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 19 deletions.
5 changes: 3 additions & 2 deletions src/scss/grommet-core/_base.grommet-only.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
@use "sass:math";

.grommet,
.brand-font {
Expand All @@ -23,8 +24,8 @@
// 5. Fonts on OSX will look more consistent with other systems that do not
// render text using sub-pixel anti-aliasing.

font-size: ($inuit-base-font-size / 16px) * 1em;
line-height: $inuit-base-line-height / $inuit-base-font-size;
font-size: math.div($inuit-base-font-size, 16px) * 1em;
line-height: math.div($inuit-base-line-height, $inuit-base-font-size);
background-color: $background-color;
color: $text-color;
// overflow-y: scroll; // [2]
Expand Down
3 changes: 2 additions & 1 deletion src/scss/grommet-core/_objects.legend.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
@use "sass:math";

.#{$grommet-namespace}legend {
text-align: left;
Expand Down Expand Up @@ -106,7 +107,7 @@

.#{$grommet-namespace}legend--large {
font-size: $paragraph-large-font-size;
line-height: $paragraph-large-font-size + round($inuit-base-spacing-unit / 3);
line-height: $paragraph-large-font-size + round(math.div($inuit-base-spacing-unit, 3));

.#{$grommet-namespace}legend__item {
margin-bottom: quarter($inuit-base-spacing-unit);
Expand Down
5 changes: 3 additions & 2 deletions src/scss/grommet-core/_objects.map.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
@use "sass:math";

$map-stroke-width: round($inuit-base-spacing-unit / 12);
$map-active-stroke-width: round($inuit-base-spacing-unit / 4);
$map-stroke-width: round(math.div($inuit-base-spacing-unit, 12));
$map-active-stroke-width: round(math.div($inuit-base-spacing-unit, 4));

.#{$grommet-namespace}map {
position: relative;
Expand Down
13 changes: 7 additions & 6 deletions src/scss/grommet-core/_objects.meter-bar.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
@use "sass:math";

// BAR

// For each size of meter, we calculate the proportional cross dimension
$meter-bar-cross-xsmall:
round($inuit-base-spacing-unit * ($size-xsmall / $size-small));
round($inuit-base-spacing-unit * math.div($size-xsmall, $size-small));
$meter-bar-cross-small:
round($inuit-base-spacing-unit * ($size-small / $size-small));
round($inuit-base-spacing-unit * math.div($size-small, $size-small));
$meter-bar-cross-medium:
round($inuit-base-spacing-unit * ($size-medium / $size-small));
round($inuit-base-spacing-unit * math.div($size-medium, $size-small));
$meter-bar-cross-large:
round($inuit-base-spacing-unit * ($size-large / $size-small));
round($inuit-base-spacing-unit * math.div($size-large, $size-small));
$meter-bar-cross-xlarge:
round($inuit-base-spacing-unit * ($size-xlarge / $size-small));
round($inuit-base-spacing-unit * math.div($size-xlarge, $size-small));
$meter-bar-cross-default:
round($inuit-base-spacing-unit * ($meter-size-default / $size-small));
round($inuit-base-spacing-unit * math.div($meter-size-default, $size-small));

@include keyframes(draw-meter-bar-small) {
0% {
Expand Down
7 changes: 4 additions & 3 deletions src/scss/grommet-core/_objects.meter.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
@use "sass:math";

$meter-size-default: $size-small;

$meter-slice-width: round($inuit-base-spacing-unit / 6);
$meter-slice-active-width: round($inuit-base-spacing-unit / 2);
$meter-slice-width: round(math.div($inuit-base-spacing-unit, 6));
$meter-slice-active-width: round(math.div($inuit-base-spacing-unit, 2));
$meter-threshold-slice-width: $meter-slice-width;
$meter-indicator-width: round($inuit-base-spacing-unit / 6);
$meter-indicator-width: round(math.div($inuit-base-spacing-unit, 6));

$meter-label-width: double($inuit-base-spacing-unit);
$meter-active-offset: round($inuit-base-spacing-unit * 1.5);
Expand Down
4 changes: 3 additions & 1 deletion src/scss/grommet-core/_objects.pulse.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
@use "sass:math";

$base-size: double($inuit-base-spacing-unit);

@mixin scale-up-fade-out($duration, $delay) {
Expand Down Expand Up @@ -56,7 +58,7 @@ $base-size: double($inuit-base-spacing-unit);
width: $base-size;
height: $base-size;
border-radius: $base-size;
padding: $inuit-base-spacing-unit / 2;
padding: math.div($inuit-base-spacing-unit, 2);
background-color: nth($brand-accent-colors, 1);
stroke: nth($brand-grey-colors, 1);
}
Expand Down
3 changes: 2 additions & 1 deletion src/scss/grommet-core/_objects.sun-burst.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// (C) Copyright 2016 Hewlett Packard Enterprise Development LP
@use "sass:math";

$sun-burst-slice-width: round($inuit-base-spacing-unit);
$sun-burst-small-slice-width: round($inuit-base-spacing-unit / 2);
$sun-burst-small-slice-width: round(math.div($inuit-base-spacing-unit, 2));
$sun-burst-large-slice-width: round($inuit-base-spacing-unit * 1.5);
$sun-burst-xlarge-slice-width: round($inuit-base-spacing-unit * 3);

Expand Down
5 changes: 3 additions & 2 deletions src/scss/grommet-core/_objects.topology.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
@use "sass:math";

$outer-pad: round($inuit-base-spacing-unit * 2);
$inner-pad: round($inuit-base-spacing-unit * 0.25);
$topology-stroke-width: round($inuit-base-spacing-unit / 12);
$topology-active-stroke-width: round($inuit-base-spacing-unit / 4);
$topology-stroke-width: round(math.div($inuit-base-spacing-unit, 12));
$topology-active-stroke-width: round(math.div($inuit-base-spacing-unit, 4));

.#{$grommet-namespace}topology {
position: relative;
Expand Down
3 changes: 2 additions & 1 deletion src/scss/grommet-core/_tools.input.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// (C) Copyright 2014-2018 Hewlett Packard Enterprise Development LP
@use "sass:math";

// We use mixins for some text styles to make it easier to modularize the
// CSS. For example `.grommet p` uses the same styles as
Expand Down Expand Up @@ -50,7 +51,7 @@
}

$button-vertical-padding:
round($inuit-base-spacing-unit / 3) - $button-border-width;
round(math.div($inuit-base-spacing-unit, 3)) - $button-border-width;
$button-horizontal-padding:
round($inuit-base-spacing-unit) - $button-border-width;

Expand Down

0 comments on commit aaf140d

Please sign in to comment.