summaryrefslogtreecommitdiff
path: root/remarks/WR-004.txt
blob: d25745816109210232dc5e261b10c392263b4b78 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Document: WR-004                                                 P. Webb
                                                              2024.11.05

        Breaking Change: `@import` and global built-in functions

Body

   I updated dependencies of a SvelteKit project and was surprised to
   see it complain about the way I import my Sass files. I could've used
   the automatic migrator the Sass Lang team mentioned[1] but I don't
   like my project potentially getting mangled, so I turned this:

   ```scss
   @import "sass/uchu/core/mixin";

   @include font(100, "/type/geist-mono", "socii sans");
   @include font-plus-italics(400, "/type/serif", "socii serif");
   ```

   to this:

   ```scss
   @use "sass/uchu/core/mixin" as mixin;

   @include mixin.font(100, "/type/geist-mono", "socii sans");
   @include mixin.font-plus-italics(400, "/type/serif", "socii serif");
   ```

   I find that choosing a namespace[2] makes this new import system
   feel better.

References

   [1] <https://sass-lang.com/documentation/breaking-changes/import>
   [2] <https://sass-lang.com/documentation/at-rules/use/#choosing-a-namespace>