Skip to content

Commit 7e4103c

Browse files
committed
NG: Add all styles from Furo, modulo colors
1 parent 857ecea commit 7e4103c

30 files changed

+1368
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@import "print"
1+
@import "print"
22
@import "screen-readers"
33
@import "theme"
4-
//@import "typography"
4+
@import "typography"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// This file contains styles for managing print media.
2+
3+
////////////////////////////////////////////////////////////////////////////////
4+
// Hide elements not relevant to print media.
5+
////////////////////////////////////////////////////////////////////////////////
6+
@media print
7+
// Hide icon container.
8+
.content-icon-container
9+
display: none !important
10+
11+
// Hide showing header links if hovering over when printing.
12+
.headerlink
13+
display: none !important
14+
15+
// Hide mobile header.
16+
.mobile-header
17+
display: none !important
18+
19+
// Hide navigation links.
20+
.related-pages
21+
display: none !important
22+
23+
////////////////////////////////////////////////////////////////////////////////
24+
// Tweaks related to decolorization.
25+
////////////////////////////////////////////////////////////////////////////////
26+
@media print
27+
// Apply a border around code which no longer have a color background.
28+
.highlight
29+
border: 0.1pt solid var(--color-foreground-border)
30+
31+
////////////////////////////////////////////////////////////////////////////////
32+
// Avoid page break in some relevant cases.
33+
////////////////////////////////////////////////////////////////////////////////
34+
@media print
35+
ul, ol, dl, a, table, pre, blockquote
36+
page-break-inside: avoid
37+
38+
h1, h2, h3, h4, h5, h6, img, figure, caption
39+
page-break-inside: avoid
40+
page-break-after: avoid
41+
42+
ul, ol, dl
43+
page-break-before: avoid

src/crate/theme/rtd/crate/static/vendor/furo/styles/base/_theme.sass

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ body
77
@include fonts
88
@include spacing
99
@include icons
10-
// @include admonitions
11-
// @include default-admonition(#651fff, "abstract")
12-
// @include default-topic(#14B8A6, "pencil")
10+
@include admonitions
11+
@include default-admonition(#651fff, "abstract")
12+
@include default-topic(#14B8A6, "pencil")
1313

1414
// @include colors
1515
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
// This file contains the styling for making the content throughout the page,
2+
// including fonts, paragraphs, headings and spacing among these elements.
3+
4+
body
5+
font-family: var(--font-stack)
6+
pre,
7+
code,
8+
kbd,
9+
samp
10+
font-family: var(--font-stack--monospace)
11+
12+
// Make fonts look slightly nicer.
13+
body
14+
-webkit-font-smoothing: antialiased
15+
-moz-osx-font-smoothing: grayscale
16+
17+
// Line height from Bootstrap 4.1
18+
article
19+
line-height: 1.5
20+
21+
//
22+
// Headings
23+
//
24+
h1,
25+
h2,
26+
h3,
27+
h4,
28+
h5,
29+
h6
30+
line-height: 1.25
31+
font-family: var(--font-stack--headings)
32+
font-weight: bold
33+
34+
border-radius: 0.5rem
35+
margin-top: 0.5rem
36+
margin-bottom: 0.5rem
37+
margin-left: -0.5rem
38+
margin-right: -0.5rem
39+
padding-left: 0.5rem
40+
padding-right: 0.5rem
41+
42+
+ p
43+
margin-top: 0
44+
45+
h1
46+
font-size: 2.5em
47+
margin-top: 1.75rem
48+
margin-bottom: 1rem
49+
h2
50+
font-size: 2em
51+
margin-top: 1.75rem
52+
h3
53+
font-size: 1.5em
54+
h4
55+
font-size: 1.25em
56+
h5
57+
font-size: 1.125em
58+
h6
59+
font-size: 1em
60+
61+
small
62+
opacity: 75%
63+
font-size: 80%
64+
65+
// Paragraph
66+
p
67+
margin-top: 0.5rem
68+
margin-bottom: 0.75rem
69+
70+
// Horizontal rules
71+
hr.docutils
72+
height: 1px
73+
padding: 0
74+
margin: 2rem 0
75+
background-color: var(--color-background-border)
76+
border: 0
77+
78+
.centered
79+
text-align: center
80+
81+
// Links
82+
a
83+
text-decoration: underline
84+
85+
color: var(--color-link)
86+
text-decoration-color: var(--color-link-underline)
87+
88+
&:visited
89+
color: var(--color-link--visited)
90+
text-decoration-color: var(--color-link-underline--visited)
91+
&:hover
92+
color: var(--color-link--visited--hover)
93+
text-decoration-color: var(--color-link-underline--visited--hover)
94+
95+
&:hover
96+
color: var(--color-link--hover)
97+
text-decoration-color: var(--color-link-underline--hover)
98+
&.muted-link
99+
color: inherit
100+
&:hover
101+
color: var(--color-link--hover)
102+
text-decoration-color: var(--color-link-underline--hover)
103+
&:visited
104+
color: var(--color-link--visited--hover)
105+
text-decoration-color: var(--color-link-underline--visited--hover)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
//
2+
// The design here is strongly inspired by mkdocs-material.
3+
.admonition, .topic
4+
margin: 1rem auto
5+
padding: 0 0.5rem 0.5rem 0.5rem
6+
7+
background: var(--color-admonition-background)
8+
9+
border-radius: 0.2rem
10+
box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.05), 0 0 0.0625rem rgba(0, 0, 0, 0.1)
11+
12+
font-size: var(--admonition-font-size)
13+
14+
overflow: hidden
15+
page-break-inside: avoid
16+
17+
// First element should have no margin, since the title has it.
18+
> :nth-child(2)
19+
margin-top: 0
20+
21+
// Last item should have no margin, since we'll control that w/ padding
22+
> :last-child
23+
margin-bottom: 0
24+
25+
.admonition p.admonition-title,
26+
p.topic-title
27+
position: relative
28+
margin: 0 -0.5rem 0.5rem
29+
padding-left: 2rem
30+
padding-right: .5rem
31+
padding-top: .4rem
32+
padding-bottom: .4rem
33+
34+
font-weight: 500
35+
font-size: var(--admonition-title-font-size)
36+
line-height: 1.3
37+
38+
// Our fancy icon
39+
&::before
40+
content: ""
41+
position: absolute
42+
left: 0.5rem
43+
width: 1rem
44+
height: 1rem
45+
46+
// Default styles
47+
p.admonition-title
48+
background-color: var(--color-admonition-title-background)
49+
&::before
50+
background-color: var(--color-admonition-title)
51+
mask-image: var(--icon-admonition-default)
52+
mask-repeat: no-repeat
53+
54+
p.topic-title
55+
background-color: var(--color-topic-title-background)
56+
&::before
57+
background-color: var(--color-topic-title)
58+
mask-image: var(--icon-topic-default)
59+
mask-repeat: no-repeat
60+
61+
//
62+
// Variants
63+
//
64+
.admonition
65+
border-left: 0.2rem solid var(--color-admonition-title)
66+
67+
@each $type, $value in $admonitions
68+
&.#{$type}
69+
border-left-color: var(--color-admonition-title--#{$type})
70+
> .admonition-title
71+
background-color: var(--color-admonition-title-background--#{$type})
72+
&::before
73+
background-color: var(--color-admonition-title--#{$type})
74+
mask-image: var(--icon-#{nth($value, 2)})
75+
76+
.admonition-todo > .admonition-title
77+
text-transform: uppercase
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
// This file stylizes the API documentation (stuff generated by autodoc). It's
2+
// deeply nested due to how autodoc structures the HTML without enough classes
3+
// to select the relevant items.
4+
5+
// API docs!
6+
dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)
7+
// Tweak the spacing of all the things!
8+
dd
9+
margin-left: 2rem
10+
> :first-child
11+
margin-top: 0.125rem
12+
> :last-child
13+
margin-bottom: 0.75rem
14+
15+
// This is used for the arguments
16+
.field-list
17+
margin-bottom: 0.75rem
18+
19+
// "Headings" (like "Parameters" and "Return")
20+
> dt
21+
text-transform: uppercase
22+
font-size: var(--font-size--small)
23+
24+
dd:empty
25+
margin-bottom: 0.5rem
26+
dd > ul
27+
margin-left: -1.2rem
28+
> li
29+
> p:nth-child(2)
30+
margin-top: 0
31+
// When the last-empty-paragraph follows a paragraph, it doesn't need
32+
// to augument the existing spacing.
33+
> p + p:last-child:empty
34+
margin-top: 0
35+
margin-bottom: 0
36+
37+
// Colorize the elements
38+
> dt
39+
color: var(--color-api-overall)
40+
41+
.sig:not(.sig-inline)
42+
font-weight: bold
43+
44+
font-size: var(--api-font-size)
45+
font-family: var(--font-stack--monospace)
46+
47+
margin-left: -0.25rem
48+
margin-right: -0.25rem
49+
padding-top: 0.25rem
50+
padding-bottom: 0.25rem
51+
padding-right: 0.5rem
52+
53+
// These are intentionally em, to properly match the font size.
54+
padding-left: 3em
55+
text-indent: -2.5em
56+
57+
border-radius: 0.25rem
58+
59+
background: var(--color-api-background)
60+
transition: background 100ms ease-out
61+
62+
&:hover
63+
background: var(--color-api-background-hover)
64+
65+
// adjust the size of the [source] link on the right.
66+
a.reference
67+
.viewcode-link
68+
font-weight: normal
69+
width: 4.25rem
70+
71+
em.property
72+
font-style: normal
73+
&:first-child
74+
color: var(--color-api-keyword)
75+
.sig-name
76+
color: var(--color-api-name)
77+
.sig-prename
78+
font-weight: normal
79+
color: var(--color-api-pre-name)
80+
.sig-paren
81+
color: var(--color-api-paren)
82+
.sig-param
83+
font-style: normal
84+
85+
div.versionadded,
86+
div.versionchanged,
87+
div.deprecated,
88+
div.versionremoved
89+
border-left: 0.1875rem solid
90+
border-radius: 0.125rem
91+
92+
padding-left: 0.75rem
93+
94+
p
95+
margin-top: 0.125rem
96+
margin-bottom: 0.125rem
97+
98+
div.versionadded
99+
border-color: var(--color-api-added-border)
100+
.versionmodified
101+
color: var(--color-api-added)
102+
103+
div.versionchanged
104+
border-color: var(--color-api-changed-border)
105+
.versionmodified
106+
color: var(--color-api-changed)
107+
108+
div.deprecated
109+
border-color: var(--color-api-deprecated-border)
110+
.versionmodified
111+
color: var(--color-api-deprecated)
112+
113+
div.versionremoved
114+
border-color: var(--color-api-removed-border)
115+
.versionmodified
116+
color: var(--color-api-removed)
117+
118+
// Align the [docs] and [source] to the right.
119+
.viewcode-link, .viewcode-back
120+
float: right
121+
text-align: right
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.line-block
2+
margin-top: 0.5rem
3+
margin-bottom: 0.75rem
4+
.line-block
5+
margin-top: 0rem
6+
margin-bottom: 0rem
7+
padding-left: 1rem
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Captions
2+
article p.caption,
3+
table > caption,
4+
.code-block-caption
5+
font-size: var(--font-size--small)
6+
text-align: center
7+
8+
// Caption above a TOCTree
9+
.toctree-wrapper.compound
10+
.caption, :not(.caption) > .caption-text
11+
font-size: var(--font-size--small)
12+
text-transform: uppercase
13+
14+
text-align: initial
15+
margin-bottom: 0
16+
17+
> ul
18+
margin-top: 0
19+
margin-bottom: 0

0 commit comments

Comments
 (0)