Skip to content

Commit 56eed97

Browse files
committed
Theme: Revert adoption of Sass @use back to @import
Doesn't seem to support overriding theme files from the site's _sass directory. I'm happy to invert the relationship and require sprinkling `@use` in every site, but it seems even with that it still doesn't work. Let's try this again some time after Oct 2026.
1 parent e61d736 commit 56eed97

File tree

4 files changed

+53
-31
lines changed

4 files changed

+53
-31
lines changed

_config.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,29 @@ kramdown:
6767
sass:
6868
style: compressed
6969
sourcemap: never
70+
# Sass has deprecated `@import` but I failed to find a way to make
71+
# the new Sass module system do what we need via `@use`.
72+
#
73+
# Previous attempt at [1] was rolled back because while it was
74+
# workable for the demo, it fell apart when using it in a production
75+
# site like qunitjs.com because `@use` seems to favor nearby files
76+
# even after you have left the site.
77+
# Example: `assets/styles.scss`, defined in theme.
78+
# - `assets/styles.scss` @use `amethyst`, defined in theme.
79+
# - `amethyst.scss` @use `amethyst-variables-all`, defined in theme.
80+
# - `amethyst-variables-all` @use `amethyst-variables` which is
81+
# overridden by the current site, but while @import prefers
82+
# the site directory, @use seems to favour the nearest, thus
83+
# making extension points impossible.
84+
#
85+
# Silence the deprecation for now, and let's hope this matures
86+
# and gets better documented some time before Oct 2026 [2].
87+
#
88+
# [1]: https://github.com/qunitjs/jekyll-theme-amethyst/commit/356962ef961c8d06741147fb4e4b2e56d917a080
89+
# [2] https://sass-lang.com/blog/import-is-deprecated/
90+
# [3] https://sass-lang.com/blog/the-module-system-is-launched/
91+
# [4] https://github.com/jekyll/minima/issues/815
92+
quiet_deps: true
7093

7194

7295
# Blog archives

_sass/amethyst-variables-all.scss

Lines changed: 0 additions & 21 deletions
This file was deleted.

_sass/amethyst.scss

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,29 @@
22

33
// Amethyst theme for Jekyll
44

5-
@use "amethyst-variables-all" as *;
65
@use "sass:color";
76
@use "sass:string";
87

8+
$size-sm: 0.8rem;
9+
$size-1: 1rem;
10+
$size-2: 1.333rem;
11+
$size-3: 1.777rem;
12+
$size-4: 2.369rem;
13+
$size-5: 3.157rem;
14+
$size-spacing: $size-2;
15+
$box-spacing: $size-1;
16+
17+
$color-white: #fff;
18+
$color-light: #f4f4f4;
19+
$color-off-white: #cdcdcd;
20+
$color-darkgrey: #63676d; // based on 2015 api.jquery.com design
21+
$color-black: #333;
22+
23+
$screen-s: 480px;
24+
$screen-m: 768px;
25+
$screen-l: 992px;
26+
$screen-xl: 1200px;
27+
928
* {
1029
box-sizing: border-box;
1130
}
@@ -449,13 +468,13 @@ table {
449468
/* Search */
450469

451470
typesense-minibar {
452-
--tsmb-color-base-background: #{color.adjust($color-accent, $lightness: 12%)};
471+
--tsmb-color-base-background: #{lighten($color-accent, 12%)};
453472
--tsmb-color-primary30: #{$color-accent};
454473
--tsmb-color-primary50: #{$color-vibrant};
455474
--tsmb-color-primary90: #{$color-bright};
456475
--tsmb-color-base30: var(--tsmb-color-primary90);
457-
--tsmb-color-base50: #{color.change($color-bright, $alpha: 0.6)}; // #a98dc1
458-
--tsmb-color-base90: #{color.change($color-bright, $alpha: 0.6)};
476+
--tsmb-color-base50: #{change-color($color-bright, $alpha: 0.6)}; // #a98dc1
477+
--tsmb-color-base90: #{change-color($color-bright, $alpha: 0.6)};
459478

460479
flex: 1;
461480
align-self: center;
@@ -464,7 +483,7 @@ typesense-minibar form {
464483
width: auto;
465484
}
466485
typesense-minibar form:not(:focus-within)::before {
467-
filter: string.unquote("invert()");
486+
filter: unquote("invert()");
468487
}
469488
typesense-minibar input[type="search"] {
470489
border: none;
@@ -591,8 +610,8 @@ typesense-minibar input[type="search"] {
591610

592611
.hero {
593612
margin-bottom: $size-spacing;
594-
background-color: color.adjust($color-vibrant, $lightness: -12%);
595-
background-image: linear-gradient(135deg, color.adjust($color-vibrant, $lightness: -12%), $color-vibrant );
613+
background-color: darken($color-vibrant, 12%);
614+
background-image: linear-gradient(135deg, darken($color-vibrant, 12%), $color-vibrant );
596615
padding: ($size-4 * 2) 0;
597616
text-align: center;
598617
}

assets/styles.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
@use "typesense-minibar.css";
55

6-
@use "amethyst";
7-
@use "highlight";
8-
@use "custom";
6+
@import "amethyst-variables";
7+
@import "amethyst";
8+
@import "highlight";
9+
@import "custom";

0 commit comments

Comments
 (0)