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

fix: mitigate Dart Sass depreciation warnings #2027

Closed
wants to merge 2 commits into from
Closed
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
235 changes: 120 additions & 115 deletions _sass/addon/commons.scss

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions _sass/addon/module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use 'variables';

/*
* Mainly scss modules, only imported to `assets/css/main.scss`
*/
Expand All @@ -7,7 +9,7 @@
%heading {
color: var(--heading-color);
font-weight: 400;
font-family: $font-family-heading;
font-family: variables.$font-family-heading;
scroll-margin-top: 3.5rem;
}

Expand Down Expand Up @@ -82,7 +84,7 @@
}

%rounded {
border-radius: $radius-lg;
border-radius: variables.$radius-lg;
}

%img-caption {
Expand Down
66 changes: 34 additions & 32 deletions _sass/addon/syntax.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,31 @@
* The syntax highlight.
*/

@import 'colors/syntax-light';
@import 'colors/syntax-dark';
@use '../colors/syntax-light';
@use '../colors/syntax-dark';
@use 'module';
@use 'variables';

html {
@media (prefers-color-scheme: light) {
&:not([data-mode]),
&[data-mode='light'] {
@include light-syntax;
@include syntax-light.light-syntax;
}

&[data-mode='dark'] {
@include dark-syntax;
@include syntax-dark.dark-syntax;
}
}

@media (prefers-color-scheme: dark) {
&:not([data-mode]),
&[data-mode='dark'] {
@include dark-syntax;
@include syntax-dark.dark-syntax;
}

&[data-mode='light'] {
@include light-syntax;
@include syntax-light.light-syntax;
}
}
}
Expand All @@ -47,19 +49,19 @@ html {
}

.highlight {
@extend %rounded;
@extend %code-snippet-bg;
@extend %rounded !optional;
@extend %code-snippet-bg !optional;

overflow: auto;
padding-bottom: 0.75rem;

@at-root figure#{&} {
@extend %code-snippet-bg;
@extend %code-snippet-bg !optional;
}

pre {
margin-bottom: 0;
font-size: $code-font-size;
font-size: variables.$code-font-size;
line-height: 1.4rem;
word-wrap: normal; /* Fixed Safari overflow-x */
}
Expand Down Expand Up @@ -101,10 +103,10 @@ code {
color: var(--code-color);

&.highlighter-rouge {
font-size: $code-font-size;
font-size: variables.$code-font-size;
padding: 3px 5px;
word-break: break-word;
border-radius: $radius-sm;
border-radius: variables.$radius-sm;
background-color: var(--inline-code-bg);
}

Expand All @@ -130,7 +132,7 @@ code {
}

td.rouge-code {
@extend %code-snippet-padding;
@extend %code-snippet-padding !optional;

/*
Prevent some browser extends from
Expand All @@ -144,13 +146,13 @@ td.rouge-code {
}

div[class^='language-'] {
@extend %rounded;
@extend %code-snippet-bg;
@extend %rounded !optional;
@extend %code-snippet-bg !optional;

box-shadow: var(--language-border-color) 0 0 0 1px;

.content > & {
@include ml-mr(-1rem);
@include module.ml-mr(-1rem);

border-radius: 0;
}
Expand Down Expand Up @@ -179,23 +181,23 @@ div {
}

.code-header {
@extend %no-cursor;
@extend %no-cursor !optional;

display: flex;
justify-content: space-between;
align-items: center;
height: $code-header-height;
height: variables.$code-header-height;
margin-left: 0.75rem;
margin-right: 0.25rem;

/* the label block */
span {
line-height: $code-header-height;
line-height: variables.$code-header-height;

/* label icon */
i {
font-size: 1rem;
width: $code-icon-width;
width: variables.$code-icon-width;
color: var(--code-header-icon-color);

&.small {
Expand All @@ -219,12 +221,12 @@ div {

/* clipboard */
button {
@extend %cursor-pointer;
@extend %rounded;
@extend %cursor-pointer !optional;
@extend %rounded !optional;

border: 1px solid transparent;
height: $code-header-height;
width: $code-header-height;
height: variables.$code-header-height;
width: variables.$code-header-height;
padding: 0;
background-color: inherit;

Expand Down Expand Up @@ -259,33 +261,33 @@ div {
@media all and (min-width: 576px) {
div[class^='language-'] {
.content > & {
@include ml-mr(0);
@include module.ml-mr(0);

border-radius: $radius-lg;
border-radius: variables.$radius-lg;
}

.code-header {
@include ml-mr(0);
@include module.ml-mr(0);

$dot-margin: 1rem;

&::before {
content: '';
display: inline-block;
margin-left: $dot-margin;
width: $code-dot-size;
height: $code-dot-size;
width: variables.$code-dot-size;
height: variables.$code-dot-size;
border-radius: 50%;
background-color: var(--code-header-muted-color);
box-shadow: ($code-dot-size + $code-dot-gap) 0 0
box-shadow: (variables.$code-dot-size + variables.$code-dot-gap) 0 0
var(--code-header-muted-color),
($code-dot-size + $code-dot-gap) * 2 0 0
(variables.$code-dot-size + variables.$code-dot-gap) * 2 0 0
var(--code-header-muted-color);
}

span {
// center the text of label
margin-left: calc(($dot-margin + $code-dot-size) / 2 * -1);
margin-left: calc(($dot-margin + variables.$code-dot-size) / 2 * -1);
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions _sass/layout/archives.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
margin-left: -$timeline-width;

&::before {
@extend %timeline;
@extend %timeline !optional;

height: 72px;
left: 79px;
bottom: 16px;
}

&:first-child::before {
@extend %timeline;
@extend %timeline !optional;

height: 32px;
top: 24px;
Expand Down Expand Up @@ -59,7 +59,7 @@
font-size: 1.1rem;
line-height: 3rem;

@extend %text-ellipsis;
@extend %text-ellipsis !optional;

&:nth-child(odd) {
background-color: var(--main-bg, #ffffff);
Expand All @@ -74,7 +74,7 @@
}

&::before {
@extend %timeline;
@extend %timeline !optional;

top: 0;
left: 77px;
Expand Down
8 changes: 5 additions & 3 deletions _sass/layout/categories.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use '../addon/variables';

/*
Style for Tab Categories
*/
Expand All @@ -12,11 +14,11 @@

&.card,
.list-group {
@extend %rounded;
@extend %rounded !optional;
}

.card-header {
$radius: calc($radius-lg - 1px);
$radius: calc(variables.$radius-lg - 1px);

padding: 0.75rem;
border-radius: $radius;
Expand All @@ -29,7 +31,7 @@
}

i {
@extend %category-icon-color;
@extend %category-icon-color !optional;

font-size: 86%; /* fontawesome icons */
}
Expand Down
8 changes: 5 additions & 3 deletions _sass/layout/category-tag.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use '../addon/module';

/*
Style for page Category and Tag
*/
Expand Down Expand Up @@ -28,7 +30,7 @@

/* post's title */
> a {
@extend %no-bottom-border;
@extend %no-bottom-border !optional;

font-size: 1.1rem;
}
Expand All @@ -48,7 +50,7 @@
#page-tag,
#access-lastmod {
a:hover {
@extend %link-hover;
@extend %link-hover !optional;

margin-bottom: -1px; /* Avoid jumping */
}
Expand All @@ -63,7 +65,7 @@
}

> a {
@include text-ellipsis;
@include module.text-ellipsis;
}
}
}
Expand Down
22 changes: 12 additions & 10 deletions _sass/layout/home.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use '../addon/variables';

/*
Style for Homepage
*/
Expand All @@ -20,14 +22,14 @@
background: none;

%img-radius {
border-radius: $radius-lg $radius-lg 0 0;
border-radius: variables.$radius-lg variables.$radius-lg 0 0;
}

.preview-img {
@extend %img-radius;
@extend %img-radius !optional;

img {
@extend %img-radius;
@extend %img-radius !optional;
}
}

Expand All @@ -36,7 +38,7 @@
padding: 1rem;

.card-title {
@extend %text-clip;
@extend %text-clip !optional;

color: var(--heading-color) !important;
font-size: 1.25rem;
Expand All @@ -47,18 +49,18 @@
}

.card-text.content {
@extend %muted;
@extend %muted !optional;

p {
@extend %text-clip;
@extend %text-clip !optional;

line-height: 1.5;
margin: 0;
}
}

.post-meta {
@extend %muted;
@extend %muted !optional;

i {
&:not(:first-child) {
Expand All @@ -67,15 +69,15 @@
}

em {
@extend %normal-font-style;
@extend %normal-font-style !optional;

color: inherit;
}

> div:first-child {
display: block;

@extend %text-ellipsis;
@extend %text-ellipsis !optional;
}
}
}
Expand Down Expand Up @@ -130,7 +132,7 @@
/* Tablet */
@media all and (min-width: 768px) {
%img-radius {
border-radius: 0 $radius-lg $radius-lg 0;
border-radius: 0 variables.$radius-lg variables.$radius-lg 0;
}

#post-list {
Expand Down
Loading