Skip to content
Snippets Groups Projects
Commit a42ca795 authored by Fredrik Jonsson's avatar Fredrik Jonsson
Browse files

Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

parent 067de347
No related branches found
No related tags found
No related merge requests found
@use 'sass:math';
// Strip the unit from the given value and return the 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
@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
......
@use 'sass:math';
// Media queries
@mixin media-query($queries...) {
@each $query in $queries {
......@@ -120,17 +122,17 @@
@mixin responsive-font-sizes($min, $max) {
$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');
$min-breakpoint: $min / $responsive-unitless * 100;
$min-breakpoint: math.div($min, $responsive-unitless) * 100;
@media (max-#{$dimension}: #{$min-breakpoint}) {
font-size: $min;
}
$max-breakpoint: $max / $responsive-unitless * 100;
$max-breakpoint: math.div($max, $responsive-unitless) * 100;
@media (min-#{$dimension}: #{$max-breakpoint}) {
font-size: $max;
......
@use 'sass:math';
// $TYPOGRAPHY
// Base font
html {
font-size: ($base-font-size / 16px) * 100%;
line-height: $base-line-height / $base-font-size;
font-size: math.div($base-font-size, 16px) * 100%;
line-height: math.div($base-line-height, $base-font-size);
color: $color--default;
}
......
@use 'sass:math';
.form {
$root: &;
......@@ -418,7 +420,7 @@
padding: .4em;
margin-bottom: 1em;
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) {
max-width: 70%;
......
@use 'sass:math';
// Strip the unit from the given value and return the 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
@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
......
@use 'sass:math';
// Media queries
@mixin media-query($queries...) {
@each $query in $queries {
......@@ -105,17 +107,17 @@
@mixin responsive-font-sizes($min, $max) {
$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');
$min-breakpoint: $min / $responsive-unitless * 100;
$min-breakpoint: math.div($min, $responsive-unitless) * 100;
@media (max-#{$dimension}: #{$min-breakpoint}) {
font-size: $min;
}
$max-breakpoint: $max / $responsive-unitless * 100;
$max-breakpoint: math.div($max, $responsive-unitless) * 100;
@media (min-#{$dimension}: #{$max-breakpoint}) {
font-size: $max;
......
@use 'sass:math';
// $TYPOGRAPHY
// Base font
html {
font-size: ($base-font-size / 16px) * 100%;
line-height: $base-line-height / $base-font-size;
font-size: math.div($base-font-size, 16px) * 100%;
line-height: math.div($base-line-height, $base-font-size);
color: $color--default;
}
......
@use 'sass:math';
.form {
&--header-search-desktop {
max-width: 300px;
......@@ -424,7 +426,7 @@
width: 100%;
padding: .4em;
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
......
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