You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage/customization.md
+86-35
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,12 @@
1
1
# Customization
2
2
3
-
It is possible to customize the output of the generated documentation with CSS
4
-
and/or by overriding templates.
3
+
It is possible to customize the output of the generated documentation with CSS and/or by overriding templates.
5
4
6
5
## CSS classes
7
6
8
-
Our templates add [CSS](https://www.w3schools.com/Css/) classes to many HTML elements
9
-
to make it possible for users to customize the resulting look and feel.
7
+
Our templates add [CSS](https://www.w3schools.com/Css/) classes to many HTML elements to make it possible for users to customize the resulting look and feel.
10
8
11
-
To add CSS rules and style mkdocstrings' output,
12
-
put them in a CSS file in your docs folder, for example in `docs/css/mkdocstrings.css`,
13
-
and reference this file in [MkDocs' `extra_css` configuration option](https://www.mkdocs.org/user-guide/configuration/#extra_css):
9
+
To add CSS rules and style mkdocstrings' output, put them in a CSS file in your docs folder, for example in `docs/css/mkdocstrings.css`, and reference this file in [MkDocs' `extra_css` configuration option](https://www.mkdocs.org/user-guide/configuration/#extra_css):
14
10
15
11
```yaml title="mkdocs.yml"
16
12
extra_css:
@@ -29,34 +25,92 @@ Example:
29
25
30
26
### Colors
31
27
32
-
You can customize the colors of the symbol types
33
-
(see [`show_symbol_type_heading`][show_symbol_type_heading] and [`show_symbol_type_toc`][show_symbol_type_toc])
34
-
by overriding the values of our CSS variables, for example:
28
+
You can customize the colors of the symbol types (see [`show_symbol_type_heading`][show_symbol_type_heading] and [`show_symbol_type_toc`][show_symbol_type_toc]) by overriding the values of our CSS variables, for example:
35
29
36
30
```css title="docs/css/mkdocstrings.css"
37
31
[data-md-color-scheme="default"] {
38
-
--doc-symbol-data-fg-color: #d1b619;
39
-
40
-
--doc-symbol-data-bg-color: #d1b6191a;
32
+
--doc-symbol-ts-accessor-fg-color: #6f42c1
33
+
--doc-symbol-ts-attribute-fg-color: #6f42c1
34
+
--doc-symbol-ts-class-fg-color: #22863a
35
+
--doc-symbol-ts-constructor-fg-color: #1f66ff
36
+
--doc-symbol-ts-data-fg-color: #0366d6
37
+
--doc-symbol-ts-enum-fg-color: #6f42c1
38
+
--doc-symbol-ts-enum_member-fg-color: #f0ad4e
39
+
--doc-symbol-ts-interface-fg-color: #6f42c1
40
+
--doc-symbol-ts-method-fg-color: #0366d6
41
+
--doc-symbol-ts-module-fg-color: #0366d6
42
+
--doc-symbol-ts-namespace-fg-color: #0366d6
43
+
--doc-symbol-ts-parameter-fg-color: #e36209
44
+
--doc-symbol-ts-project-fg-color: #24292f
45
+
--doc-symbol-ts-property-fg-color: #6f42c1
46
+
--doc-symbol-ts-type-fg-color: #6f42c1
47
+
--doc-symbol-ts-type_alias-fg-color: #6f42c1
48
+
--doc-symbol-ts-variable-fg-color: #e36209
49
+
50
+
--doc-symbol-ts-accessor-bg-color: #6f42c11a
51
+
--doc-symbol-ts-attribute-bg-color: #6f42c11a
52
+
--doc-symbol-ts-class-bg-color: #22863a1a
53
+
--doc-symbol-ts-constructor-bg-color: #1f66ff1a
54
+
--doc-symbol-ts-data-bg-color: #0366d61a
55
+
--doc-symbol-ts-enum-bg-color: #6f42c11a
56
+
--doc-symbol-ts-enum_member-bg-color: #f0ad4e1a
57
+
--doc-symbol-ts-interface-bg-color: #6f42c11a
58
+
--doc-symbol-ts-method-bg-color: #0366d61a
59
+
--doc-symbol-ts-module-bg-color: #0366d61a
60
+
--doc-symbol-ts-namespace-bg-color: #0366d61a
61
+
--doc-symbol-ts-parameter-bg-color: #e362091a
62
+
--doc-symbol-ts-project-bg-color: #24292f1a
63
+
--doc-symbol-ts-property-bg-color: #6f42c11a
64
+
--doc-symbol-ts-type-bg-color: #6f42c11a
65
+
--doc-symbol-ts-type_alias-bg-color: #6f42c11a
66
+
--doc-symbol-ts-variable-bg-color: #e362091a
41
67
}
42
68
43
69
[data-md-color-scheme="slate"] {
44
-
--doc-symbol-data-fg-color: #46c2cb;
45
-
46
-
--doc-symbol-data-bg-color: #46c2cb1a;
70
+
--doc-symbol-ts-accessor-fg-color: #d4a5f0
71
+
--doc-symbol-ts-attribute-fg-color: #d4a5f0
72
+
--doc-symbol-ts-class-fg-color: #78e7d1
73
+
--doc-symbol-ts-constructor-fg-color: #6ba3ff
74
+
--doc-symbol-ts-data-fg-color: #58a6ff
75
+
--doc-symbol-ts-enum-fg-color: #d4a5f0
76
+
--doc-symbol-ts-enum_member-fg-color: #ffb864
77
+
--doc-symbol-ts-interface-fg-color: #d4a5f0
78
+
--doc-symbol-ts-method-fg-color: #58a6ff
79
+
--doc-symbol-ts-module-fg-color: #58a6ff
80
+
--doc-symbol-ts-namespace-fg-color: #58a6ff
81
+
--doc-symbol-ts-parameter-fg-color: #f4a261
82
+
--doc-symbol-ts-project-fg-color: #e1e4e8
83
+
--doc-symbol-ts-property-fg-color: #d4a5f0
84
+
--doc-symbol-ts-type-fg-color: #d4a5f0
85
+
--doc-symbol-ts-type_alias-fg-color: #d4a5f0
86
+
--doc-symbol-ts-variable-fg-color: #f4a261
87
+
88
+
--doc-symbol-ts-accessor-bg-color: #d4a5f01a
89
+
--doc-symbol-ts-attribute-bg-color: #d4a5f01a
90
+
--doc-symbol-ts-class-bg-color: #78e7d11a
91
+
--doc-symbol-ts-constructor-bg-color: #6ba3ff1a
92
+
--doc-symbol-ts-data-bg-color: #58a6ff1a
93
+
--doc-symbol-ts-enum-bg-color: #d4a5f01a
94
+
--doc-symbol-ts-enum_member-bg-color: #ffb8641a
95
+
--doc-symbol-ts-interface-bg-color: #d4a5f01a
96
+
--doc-symbol-ts-method-bg-color: #58a6ff1a
97
+
--doc-symbol-ts-module-bg-color: #58a6ff1a
98
+
--doc-symbol-ts-namespace-bg-color: #58a6ff1a
99
+
--doc-symbol-ts-parameter-bg-color: #f4a2611a
100
+
--doc-symbol-ts-project-bg-color: #e1e4e81a
101
+
--doc-symbol-ts-property-bg-color: #d4a5f01a
102
+
--doc-symbol-ts-type-bg-color: #d4a5f01a
103
+
--doc-symbol-ts-type_alias-bg-color: #d4a5f01a
104
+
--doc-symbol-ts-variable-bg-color: #f4a2611a
47
105
}
48
106
```
49
107
50
-
The `[data-md-color-scheme="*"]` selectors work with the [Material for MkDocs] theme.
51
-
If you are using another theme, adapt the selectors to this theme
52
-
if it supports light and dark themes,
53
-
otherwise just override the variables at root level:
108
+
The `[data-md-color-scheme="*"]` selectors work with the [Material for MkDocs] theme. If you are using another theme, adapt the selectors to this theme if it supports light and dark themes, otherwise just override the variables at root level:
54
109
55
110
```css title="docs/css/mkdocstrings.css"
56
111
:root {
57
-
--doc-symbol-data-fg-color: #d1b619;
58
-
59
-
--doc-symbol-data-bg-color: #d1b6191a;
112
+
--doc-symbol-ts-data-fg-color: #d1b619;
113
+
--doc-symbol-ts-data-bg-color: #d1b6191a;
60
114
}
61
115
```
62
116
@@ -66,32 +120,29 @@ otherwise just override the variables at root level:
0 commit comments