Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support dart sass v2.0.0 #150

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions fork-versions/default/_normalize.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*! normalize-scss | MIT/GPLv2 License | bit.ly/normalize-scss */
@use "sass:math";

@import 'variables';
@import 'vertical-rhythm';
Expand Down Expand Up @@ -32,12 +33,12 @@ html {
@if $base-font-size != 16px or $normalize-vertical-rhythm {
// Correct old browser bug that prevented accessible resizing of text
// when root font-size is set with px or em.
font-size: ($base-font-size / 16px) * 100%;
font-size: math.div($base-font-size, 16px) * 100%;
}
@if $normalize-vertical-rhythm {
// Establish a vertical rhythm unit using $base-font-size and
// $base-line-height variables.
line-height: ($base-line-height / $base-font-size) * 1em; /* 1 */
line-height: math.div($base-line-height, $base-font-size) * 1em; /* 1 */
}
@else {
line-height: 1.15; /* 1 */
Expand Down
7 changes: 4 additions & 3 deletions fork-versions/default/_vertical-rhythm.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use "sass:math";
//
// Vertical Rhythm
//
Expand All @@ -10,10 +11,10 @@
@error "The normalize vertical-rhythm module only supports px inputs. The typey library is better.";
}
@if $unit == rem {
@return ($value / $base-font-size) * 1rem;
@return math.div($value, $base-font-size) * 1rem;
}
@else if $unit == em {
@return ($value / $relative-to) * 1em;
@return math.div($value, $relative-to) * 1em;
}
@else { // $unit == px
@return $value;
Expand Down Expand Up @@ -52,7 +53,7 @@
}

@mixin normalize-line-height($font-size, $min-line-padding: 2px) {
$lines: ceil($font-size / $base-line-height);
$lines: ceil(math.div($font-size, $base-line-height));
// If lines are cramped include some extra leading.
@if ($lines * $base-line-height - $font-size) < ($min-line-padding * 2) {
$lines: $lines + 1;
Expand Down
8 changes: 5 additions & 3 deletions sass/normalize/_normalize-mixin.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "sass:math";

// Helper function for the normalize() mixin.
@function _normalize-include($section, $exclude: null) {
// Initialize the global variables needed by this function.
Expand Down Expand Up @@ -61,10 +63,10 @@
@if $base-font-size != 16px or $normalize-vertical-rhythm {
// Correct old browser bug that prevented accessible resizing of text
// when root font-size is set with px or em.
font-size: ($base-font-size / 16px) * 100%;
font-size: math.div($base-font-size, 16px) * 100%;
}
@if $normalize-vertical-rhythm {
line-height: ($base-line-height / $base-font-size) * 1em; /* 1 */
line-height: math.div($base-line-height, $base-font-size) * 1em; /* 1 */
}
@else {
line-height: 1.15; /* 1 */
Expand Down Expand Up @@ -419,7 +421,7 @@
font-family: if($base-font-family, $base-font-family, sans-serif); /* 1 */
font-size: 100%; /* 1 */
@if $normalize-vertical-rhythm {
line-height: ($base-line-height / $base-font-size) * 1em; /* 1 */
line-height: math.div($base-line-height, $base-font-size) * 1em; /* 1 */
}
@else {
line-height: 1.15; /* 1 */
Expand Down
7 changes: 4 additions & 3 deletions sass/normalize/_vertical-rhythm.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use "sass:math";
//
// Vertical Rhythm
//
Expand All @@ -10,10 +11,10 @@
@error "The normalize vertical-rhythm module only supports px inputs. The typey library is better.";
}
@if $unit == rem {
@return ($value / $base-font-size) * 1rem;
@return math.div($value, $base-font-size) * 1rem;
}
@else if $unit == em {
@return ($value / $relative-to) * 1em;
@return math.div($value, $relative-to) * 1em;
}
@else { // $unit == px
@return $value;
Expand Down Expand Up @@ -52,7 +53,7 @@
}

@mixin normalize-line-height($font-size, $min-line-padding: 2px) {
$lines: ceil($font-size / $base-line-height);
$lines: ceil(math.div($font-size, $base-line-height));
// If lines are cramped include some extra leading.
@if ($lines * $base-line-height - $font-size) < ($min-line-padding * 2) {
$lines: $lines + 1;
Expand Down