Skip to content

Commit dd9c12d

Browse files
committed
Fix Dart Sass Deprecations
Upgrading Jekyll pulled in a newer version of Dart Sass, and we have deprecation warnings in some of our sass files. Most of them are an easy fix with an equivalent, newer syntax. ``` Deprecation Warning [global-builtin]: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0. Use color.adjust instead. More info and automated migrator: https://sass-lang.com/d/import ╷ 22 │ $grey-color-dark: darken($grey-color, 25%); │ ^^^^^^^^^^^^^^^^^^^^^^^^ ╵ /home/mkasberg/code/opensourcecatholic.github.io/css/main.scss 22:20 root stylesheet Deprecation Warning [color-functions]: darken() is deprecated. Suggestions: color.scale($color, $lightness: -49.0384615385%) color.adjust($color, $lightness: -25%) More info: https://sass-lang.com/d/color-functions ╷ 22 │ $grey-color-dark: darken($grey-color, 25%); │ ^^^^^^^^^^^^^^^^^^^^^^^^ ╵ ```
1 parent 8a5b346 commit dd9c12d

3 files changed

Lines changed: 18 additions & 14 deletions

File tree

_sass/_base.scss

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "sass:color";
2+
13
/**
24
* Reset some basic elements
35
*/
@@ -34,7 +36,7 @@ h1, h2, h3, h4, h5, h6,
3436
p, blockquote, pre,
3537
ul, ol, dl, figure,
3638
%vertical-rhythm {
37-
margin-bottom: $spacing-unit / 2;
39+
margin-bottom: calc($spacing-unit / 2);
3840
}
3941

4042

@@ -95,7 +97,7 @@ a {
9597
text-decoration: none;
9698

9799
&:visited {
98-
color: darken($brand-color, 15%);
100+
color: color.adjust($brand-color, $lightness: -15%);
99101
}
100102

101103
&:hover {
@@ -112,7 +114,7 @@ a {
112114
blockquote {
113115
color: $grey-color;
114116
border-left: 4px solid $grey-color-light;
115-
padding-left: $spacing-unit / 2;
117+
padding-left: calc($spacing-unit / 2);
116118
font-size: 18px;
117119
letter-spacing: -1px;
118120
font-style: italic;
@@ -167,8 +169,8 @@ pre {
167169
@include media-query($on-laptop) {
168170
max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit}));
169171
max-width: calc(#{$content-width} - (#{$spacing-unit}));
170-
padding-right: $spacing-unit / 2;
171-
padding-left: $spacing-unit / 2;
172+
padding-right: calc($spacing-unit / 2);
173+
padding-left: calc($spacing-unit / 2);
172174
}
173175
}
174176

_sass/_layout.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
@include media-query($on-palm) {
5252
position: absolute;
5353
top: 9px;
54-
right: $spacing-unit / 2;
54+
right: calc($spacing-unit / 2);
5555
background-color: $background-color;
5656
border: 1px solid $grey-color-light;
5757
border-radius: 5px;
@@ -114,7 +114,7 @@
114114

115115
.footer-heading {
116116
font-size: 18px;
117-
margin-bottom: $spacing-unit / 2;
117+
margin-bottom: calc($spacing-unit / 2);
118118
}
119119

120120
.contact-list,
@@ -126,14 +126,14 @@
126126
.footer-col-wrapper {
127127
font-size: 15px;
128128
color: $grey-color;
129-
margin-left: -$spacing-unit / 2;
129+
margin-left: calc(-1 * $spacing-unit / 2);
130130
@extend %clearfix;
131131
}
132132

133133
.footer-col {
134134
float: left;
135-
margin-bottom: $spacing-unit / 2;
136-
padding-left: $spacing-unit / 2;
135+
margin-bottom: calc($spacing-unit / 2);
136+
padding-left: calc($spacing-unit / 2);
137137
}
138138

139139
.footer-col-1 {

css/main.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
---
44
@charset "utf-8";
55

6+
@use "sass:color";
7+
@use "sass:math";
68

79

810
// Our variables
@@ -21,8 +23,8 @@ $brand-color: #2a7ae2;
2123
$osc-color: #1583bd;
2224

2325
$grey-color: #828282;
24-
$grey-color-light: lighten($grey-color, 40%);
25-
$grey-color-dark: darken($grey-color, 25%);
26+
$grey-color-light: color.adjust($grey-color, $lightness: 40%);
27+
$grey-color-dark: color.adjust($grey-color, $lightness: -25%);
2628

2729
// Width of the content area
2830
$content-width: 800px;
@@ -35,8 +37,8 @@ $on-laptop: 800px;
3537
// Use media queries like this:
3638
// @include media-query($on-palm) {
3739
// .wrapper {
38-
// padding-right: $spacing-unit / 2;
39-
// padding-left: $spacing-unit / 2;
40+
// padding-right: calc($spacing-unit / 2);
41+
// padding-left: calc($spacing-unit / 2);
4042
// }
4143
// }
4244
@mixin media-query($device) {

0 commit comments

Comments
 (0)