diff --git a/_sass/misc/article-menu.scss b/_sass/misc/article-menu.scss index ef8b651fe84..11c5d60676d 100644 --- a/_sass/misc/article-menu.scss +++ b/_sass/misc/article-menu.scss @@ -16,7 +16,7 @@ .post-menu-content { ul { border-left: 1px solid #e9ecef; - $indent: math.div($base-font-size, 4); + $indent: divide($base-font-size, 4); $active-bgcolor: #ecebec; @for $i from 2 to 7 { diff --git a/_sass/yat.scss b/_sass/yat.scss index c0d54504ece..22d25af8b8c 100644 --- a/_sass/yat.scss +++ b/_sass/yat.scss @@ -5,6 +5,7 @@ // Recommendation: math.div($header-height, 1.5) or calc($header-height / 1.5) // More info and automated migrator: https://sass-lang.com/d/slash-div @use 'sass:math'; +@use 'sass:meta'; // Define defaults for each variable. @@ -63,6 +64,18 @@ $on-laptop: 800px !default; font-size: $base-font-size * $ratio; } +// Better compatibility for divisions. +// +// Deprecation Warning: Using / for division outside of calc() is deprecated +// and will be removed in Dart Sass 2.0.0." +@function divide($dividend, $divisor: 1) { + @if meta.function-exists('div', 'math') { + @return math.div($dividend, $divisor); + } @else { + @return ($dividend / $divisor); + } +} + // Import partials. @import "yat/base",