Skip to content

Commit 01eb613

Browse files
committed
Use @use variables as *
This makes it easier to read the written variables.
1 parent 0dab870 commit 01eb613

File tree

5 files changed

+33
-33
lines changed

5 files changed

+33
-33
lines changed

src/furo/assets/styles/_scaffold.sass

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// HACK: Always having the scrollbar visible, prevents certain browsers from
1717
// causing the content to stutter horizontally between taller-than-viewport and
1818
// not-taller-than-viewport pages.
19-
@use "variables"
19+
@use "variables" as *
2020

2121
html
2222
overflow-x: hidden
@@ -109,14 +109,14 @@ article
109109
display: flex
110110
justify-content: flex-end
111111
// These next two lines took me two days to figure out.
112-
width: calc((100% - #{variables.$full-width}) / 2 + #{variables.$sidebar-width})
113-
min-width: variables.$sidebar-width
112+
width: calc((100% - #{$full-width}) / 2 + #{$sidebar-width})
113+
min-width: $sidebar-width
114114

115115
// Scroll-along sidebars
116116
.sidebar-container,
117117
.toc-drawer
118118
box-sizing: border-box
119-
width: variables.$sidebar-width
119+
width: $sidebar-width
120120

121121
.toc-drawer
122122
background: var(--color-toc-background)
@@ -143,8 +143,8 @@ article
143143

144144
// Central items.
145145
.content
146-
padding: 0 variables.$content-padding
147-
width: variables.$content-width
146+
padding: 0 $content-padding
147+
width: $content-width
148148

149149
display: flex
150150
flex-direction: column
@@ -342,46 +342,46 @@ article
342342
// Responsive layouting
343343
////////////////////////////////////////////////////////////////////////////////
344344
// Make things a bit bigger on bigger screens.
345-
@media (min-width: variables.$full-width + variables.$sidebar-width)
345+
@media (min-width: $full-width + $sidebar-width)
346346
html
347347
font-size: 110%
348348

349-
@media (max-width: variables.$full-width)
349+
@media (max-width: $full-width)
350350
// Collapse "toc" into the icon.
351351
.toc-content-icon
352352
display: flex
353353
.toc-drawer
354354
position: fixed
355355
height: 100vh
356356
top: 0
357-
right: - variables.$sidebar-width
357+
right: -$sidebar-width
358358
border-left: 1px solid var(--color-background-muted)
359359
.toc-tree
360360
border-left: none
361361
font-size: var(--toc-font-size--mobile)
362362

363363
// Accomodate for a changed content width.
364364
.sidebar-drawer
365-
width: calc((100% - #{variables.$full-width - variables.$sidebar-width}) / 2 + #{variables.$sidebar-width})
365+
width: calc((100% - #{$full-width - $sidebar-width}) / 2 + #{$sidebar-width})
366366

367-
@media (max-width: variables.$content-padded-width + variables.$sidebar-width)
367+
@media (max-width: $content-padded-width + $sidebar-width)
368368
// Center the page
369369
.content
370370
margin-left: auto
371371
margin-right: auto
372-
padding: 0 variables.$content-padding--small
372+
padding: 0 $content-padding--small
373373

374-
@media (max-width: variables.$content-padded-width--small + variables.$sidebar-width)
374+
@media (max-width: $content-padded-width--small + $sidebar-width)
375375
// Collapse "navigation".
376376
.nav-overlay-icon
377377
display: flex
378378
.sidebar-drawer
379379
position: fixed
380380
height: 100vh
381-
width: variables.$sidebar-width
381+
width: $sidebar-width
382382

383383
top: 0
384-
left: - variables.$sidebar-width
384+
left: -$sidebar-width
385385

386386
// Swap which icon is visible.
387387
.toc-header-icon, .theme-toggle-header
@@ -425,13 +425,13 @@ article
425425
flex-direction: column
426426
justify-content: center
427427

428-
@media (max-width: variables.$content-width + 2* variables.$content-padding--small)
428+
@media (max-width: $content-width + 2* $content-padding--small)
429429
// Content should respect window limits.
430430
.content
431431
width: 100%
432432
overflow-x: auto
433433

434-
@media (max-width: variables.$content-width)
434+
@media (max-width: $content-width)
435435
article[role=main] aside.sidebar
436436
float: none
437437
width: 100%

src/furo/assets/styles/base/_theme.sass

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
// This contains the bulk of the logic for handling dark mode, color scheme
44
// toggling and the handling of color-scheme-specific hiding of elements.
55
6-
@use "../variables"
6+
@use "../variables" as *
77

88
body
9-
@include variables.fonts
10-
@include variables.spacing
11-
@include variables.icons
12-
@include variables.admonitions
13-
@include variables.default-admonition(#651fff, "abstract")
14-
@include variables.default-topic(#14B8A6, "pencil")
9+
@include fonts
10+
@include spacing
11+
@include icons
12+
@include admonitions
13+
@include default-admonition(#651fff, "abstract")
14+
@include default-topic(#14B8A6, "pencil")
1515

16-
@include variables.colors
16+
@include colors
1717

1818
.only-light
1919
display: block !important
@@ -24,7 +24,7 @@ html body .only-dark
2424
@media not print
2525
// Enable dark-mode, if requested.
2626
body[data-theme="dark"]
27-
@include variables.colors-dark
27+
@include colors-dark
2828

2929
html & .only-light
3030
display: none !important
@@ -34,7 +34,7 @@ html body .only-dark
3434
// Enable dark mode, unless explicitly told to avoid.
3535
@media (prefers-color-scheme: dark)
3636
body:not([data-theme="light"])
37-
@include variables.colors-dark
37+
@include colors-dark
3838

3939
html & .only-light
4040
display: none !important

src/furo/assets/styles/components/_footer.sass

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file contains the styles used for stylizing the footer that's shown
22
// below the content.
3-
@use "../variables"
3+
@use "../variables" as *
44

55
footer
66
font-size: var(--font-size--small)
@@ -24,7 +24,7 @@ footer
2424

2525
line-height: 1.5
2626

27-
@media (max-width: variables.$content-width)
27+
@media (max-width: $content-width)
2828
text-align: center
2929
flex-direction: column-reverse
3030
gap: 0.25rem

src/furo/assets/styles/content/_admonitions.sass

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@use "sass:list"
2-
@use "../variables"
2+
@use "../variables" as *
33

44
// The design here is strongly inspired by mkdocs-material.
55
.admonition, .topic
@@ -66,7 +66,7 @@ p.topic-title
6666
.admonition
6767
border-left: 0.2rem solid var(--color-admonition-title)
6868

69-
@each $type, $value in variables.$admonitions
69+
@each $type, $value in $admonitions
7070
&.#{$type}
7171
border-left-color: var(--color-admonition-title--#{$type})
7272
> .admonition-title

src/furo/assets/styles/content/_target.sass

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
@use "../variables"
1+
@use "../variables" as *
22

33
:target
44
scroll-margin-top: 2.5rem
55

6-
@media (max-width: variables.$full-width - variables.$sidebar-width)
6+
@media (max-width: $full-width - $sidebar-width)
77
:target
88
scroll-margin-top: calc(2.5rem + var(--header-height))
99

0 commit comments

Comments
 (0)