Skip to content

Commit 8dd48ab

Browse files
committed
Upgade Sass compiler.
- Replace @import with @use. - Reorder some declarations. - Use its module system to load variables from the `_colors` file.
1 parent b5685eb commit 8dd48ab

File tree

7 files changed

+29
-18
lines changed

7 files changed

+29
-18
lines changed

flake.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ffdocs/view/styles/_items.scss

+4-4
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ main.item section {
106106
}
107107

108108
dl {
109+
border-width: 1px 1px 0 1px;
110+
border-style: solid;
111+
border-color: var(--item-table-border);
112+
109113
@media screen and (min-width: 15cm) {
110114
display: grid;
111115
grid-template-columns: min-content 1fr;
112116
}
113117

114-
border-width: 1px 1px 0 1px;
115-
border-style: solid;
116-
border-color: var(--item-table-border);
117-
118118
dt {
119119
font-family: monospace;
120120
color: var(--item-table-term-fg);

lib/ffdocs/view/styles/_layout.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "colors";
2+
13
* {
24
box-sizing: border-box;
35
}
@@ -148,12 +150,13 @@ nav {
148150

149151
details {
150152
summary {
153+
151154
display: block; // Remove icon.
152155
cursor: pointer;
153156
outline: 0;
154157

155158
padding: 0.5rem 0.5rem 0.5rem 1rem;
156-
border-bottom: 1px solid $nav-summary-border-color;
159+
border-bottom: 1px solid colors.$nav-summary-border-color;
157160

158161
&::after {
159162
content: " ";

lib/ffdocs/view/styles/_list.scss

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1+
@use "sass:color";
2+
@use "colors";
3+
14
:root {
25
--list-header: #555;
36
--list-items-sep: #ccc;
47

5-
--list-selected-bg: #{lighten($main-green, 40%)}
8+
--list-selected-bg: #{color.adjust(colors.$main-green, $lightness: 40%)}
69
}
710

811
@media (prefers-color-scheme: dark) {
912
:root {
1013
--list-header: #ccc;
1114
--list-items-sep: #777;
1215

13-
--list-selected-bg: #{darken($main-green, 25%)}
16+
--list-selected-bg: #{color.adjust(colors.$main-green, $lightness: -25%)}
1417
}
1518
}
1619

lib/ffdocs/view/styles/_version_front.scss

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "colors";
2+
13
:root {
24
--versionfront-header: #333;
35
--versionfront-lists-link: $link-color;

lib/ffdocs/view/styles/main.scss

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
@import "colors";
2-
@import "items";
3-
@import "layout";
4-
@import "list";
5-
@import "search";
6-
@import "version_changelog";
7-
@import "version_front";
8-
@import "version_matrix";
1+
@use "colors";
2+
@use "items";
3+
@use "layout";
4+
@use "list";
5+
@use "search";
6+
@use "version_changelog";
7+
@use "version_front";
8+
@use "version_matrix";
99

1010
:root {
1111
--base-font-size: 12pt;

lib/ffdocs/view/website.rb

+3
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ def render(executor)
187187

188188
@main_css_path = @output.join(File.basename(CSS_SOURCE, ".scss") + ".css")
189189
@main_css_path.write(result.css)
190+
rescue Sass::CompileError => e
191+
STDERR.print e.full_message(highlight: true)
192+
exit 1
190193
end
191194

192195
# Combine the JS files.

0 commit comments

Comments
 (0)