Skip to content
Snippets Groups Projects
Unverified Commit d5dfb5c9 authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #2465 from HyphaApp/maintenance/sass-slash-for-division-fix

Using / for division is deprecated and will be removed in Dart Sass 2.0.0
parents 067de347 a42ca795
No related branches found
Tags v1.64.0
No related merge requests found
@use 'sass:math';
// Strip the unit from the given value and return the value // Strip the unit from the given value and return the value
@function strip-unit($value) { @function strip-unit($value) {
@return $value / ($value * 0 + 1); @return math.div($value, ($value * 0 + 1));
} }
// Return an em unit based on the pixel value and context // Return an em unit based on the pixel value and context
@function rem($px, $context: $base-font-size) { @function rem($px, $context: $base-font-size) {
@return #{strip-unit($px / strip-unit($context))}rem; @return #{strip-unit(math.div($px, strip-unit($context)))}rem;
} }
// Returns the opposite direction of each direction in a list // Returns the opposite direction of each direction in a list
......
@use 'sass:math';
// Media queries // Media queries
@mixin media-query($queries...) { @mixin media-query($queries...) {
@each $query in $queries { @each $query in $queries {
...@@ -120,17 +122,17 @@ ...@@ -120,17 +122,17 @@
@mixin responsive-font-sizes($min, $max) { @mixin responsive-font-sizes($min, $max) {
$vw-context: (1260 * .1) * 1px; $vw-context: (1260 * .1) * 1px;
$responsive: ($max / $vw-context) * 10vw; $responsive: math.div($max, $vw-context) * 10vw;
$responsive-unitless: $responsive / ($responsive - $responsive + 1); $responsive-unitless: math.div($responsive, ($responsive - $responsive + 1));
$dimension: if(unit($responsive) == 'vh', 'height', 'width'); $dimension: if(unit($responsive) == 'vh', 'height', 'width');
$min-breakpoint: $min / $responsive-unitless * 100; $min-breakpoint: math.div($min, $responsive-unitless) * 100;
@media (max-#{$dimension}: #{$min-breakpoint}) { @media (max-#{$dimension}: #{$min-breakpoint}) {
font-size: $min; font-size: $min;
} }
$max-breakpoint: $max / $responsive-unitless * 100; $max-breakpoint: math.div($max, $responsive-unitless) * 100;
@media (min-#{$dimension}: #{$max-breakpoint}) { @media (min-#{$dimension}: #{$max-breakpoint}) {
font-size: $max; font-size: $max;
......
@use 'sass:math';
// $TYPOGRAPHY // $TYPOGRAPHY
// Base font // Base font
html { html {
font-size: ($base-font-size / 16px) * 100%; font-size: math.div($base-font-size, 16px) * 100%;
line-height: $base-line-height / $base-font-size; line-height: math.div($base-line-height, $base-font-size);
color: $color--default; color: $color--default;
} }
......
@use 'sass:math';
.form { .form {
$root: &; $root: &;
...@@ -418,7 +420,7 @@ ...@@ -418,7 +420,7 @@
padding: .4em; padding: .4em;
margin-bottom: 1em; margin-bottom: 1em;
border: 1px solid $color--mid-grey; border: 1px solid $color--mid-grey;
line-height: $base-line-height / $base-font-size; line-height: math.div($base-line-height, $base-font-size);
@include media-query(tablet-portrait) { @include media-query(tablet-portrait) {
max-width: 70%; max-width: 70%;
......
@use 'sass:math';
// Strip the unit from the given value and return the value // Strip the unit from the given value and return the value
@function strip-unit($value) { @function strip-unit($value) {
@return $value / ($value * 0 + 1); @return math.div($value, ($value * 0 + 1));
} }
// Return an em unit based on the pixel value and context // Return an em unit based on the pixel value and context
@function rem($px, $context: $base-font-size) { @function rem($px, $context: $base-font-size) {
@return #{strip-unit($px / strip-unit($context))}rem; @return #{strip-unit(math.div($px, strip-unit($context)))}rem;
} }
// Returns the opposite direction of each direction in a list // Returns the opposite direction of each direction in a list
......
@use 'sass:math';
// Media queries // Media queries
@mixin media-query($queries...) { @mixin media-query($queries...) {
@each $query in $queries { @each $query in $queries {
...@@ -105,17 +107,17 @@ ...@@ -105,17 +107,17 @@
@mixin responsive-font-sizes($min, $max) { @mixin responsive-font-sizes($min, $max) {
$vw-context: (1260 * .1) * 1px; $vw-context: (1260 * .1) * 1px;
$responsive: ($max / $vw-context) * 10vw; $responsive: math.div($max, $vw-context) * 10vw;
$responsive-unitless: $responsive / ($responsive - $responsive + 1); $responsive-unitless: math.div($responsive, ($responsive - $responsive + 1));
$dimension: if(unit($responsive) == 'vh', 'height', 'width'); $dimension: if(unit($responsive) == 'vh', 'height', 'width');
$min-breakpoint: $min / $responsive-unitless * 100; $min-breakpoint: math.div($min, $responsive-unitless) * 100;
@media (max-#{$dimension}: #{$min-breakpoint}) { @media (max-#{$dimension}: #{$min-breakpoint}) {
font-size: $min; font-size: $min;
} }
$max-breakpoint: $max / $responsive-unitless * 100; $max-breakpoint: math.div($max, $responsive-unitless) * 100;
@media (min-#{$dimension}: #{$max-breakpoint}) { @media (min-#{$dimension}: #{$max-breakpoint}) {
font-size: $max; font-size: $max;
......
@use 'sass:math';
// $TYPOGRAPHY // $TYPOGRAPHY
// Base font // Base font
html { html {
font-size: ($base-font-size / 16px) * 100%; font-size: math.div($base-font-size, 16px) * 100%;
line-height: $base-line-height / $base-font-size; line-height: math.div($base-line-height, $base-font-size);
color: $color--default; color: $color--default;
} }
......
@use 'sass:math';
.form { .form {
&--header-search-desktop { &--header-search-desktop {
max-width: 300px; max-width: 300px;
...@@ -424,7 +426,7 @@ ...@@ -424,7 +426,7 @@
width: 100%; width: 100%;
padding: .4em; padding: .4em;
border: 1px solid $color--mid-grey; border: 1px solid $color--mid-grey;
line-height: $base-line-height / $base-font-size; line-height: math.div($base-line-height, $base-font-size);
} }
// Radio + Checkbox // Radio + Checkbox
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment