-
Notifications
You must be signed in to change notification settings - Fork 296
/
_api.sass
95 lines (79 loc) · 2.23 KB
/
_api.sass
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// This file stylizes the API documentation (stuff generated by autodoc). It's
// deeply nested due to how autodoc structures the HTML without enough classes
// to select the relevant items.
// API docs!
dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)
// Tweak the spacing of all the things!
dd
margin-left: 2rem
> :first-child
margin-top: 0.125rem
> :last-child
margin-bottom: 0.75rem
// This is used for the arguments
.field-list
margin-bottom: 0.75rem
// "Headings" (like "Parameters" and "Return")
> dt
text-transform: uppercase
font-size: var(--font-size--small)
dd:empty
margin-bottom: 0.5rem
dd > ul
margin-left: -1.2rem
> li
> p:nth-child(2)
margin-top: 0
// When the last-empty-paragraph follows a paragraph, it doesn't need
// to augument the existing spacing.
> p + p:last-child:empty
margin-top: 0
margin-bottom: 0
// Colorize the elements
> dt
color: var(--color-api-overall)
.sig:not(.sig-inline)
font-weight: bold
font-size: var(--api-font-size)
font-family: var(--font-stack--monospace)
margin-left: -0.25rem
margin-right: -0.25rem
padding-top: 0.25rem
padding-bottom: 0.25rem
padding-right: 0.5rem
// These are intentionally em, to properly match the font size.
padding-left: 3em
text-indent: -2.5em
border-radius: 0.25rem
background: var(--color-api-background)
transition: background 100ms ease-out
&:hover
background: var(--color-api-background-hover)
// adjust the size of the [source] link on the right.
a.reference
.viewcode-link
font-weight: normal
width: 3.5rem
em.property
font-style: normal
&:first-child
color: var(--color-api-keyword)
.sig-name
color: var(--color-api-name)
.sig-prename
font-weight: normal
color: var(--color-api-pre-name)
.sig-paren
color: var(--color-api-paren)
.sig-param
font-style: normal
.versionmodified
font-style: italic
div.versionadded, div.versionchanged, div.deprecated
p
margin-top: 0.125rem
margin-bottom: 0.125rem
// Align the [docs] and [source] to the right.
.viewcode-link, .viewcode-back
float: right
text-align: right