Skip to content

Commit 4a24f53

Browse files
committed
Utilize handler-requested CSS feature
From mkdocstrings/mkdocstrings#218
1 parent d53b1e0 commit 4a24f53

5 files changed

Lines changed: 22 additions & 58 deletions

File tree

docs/assets/style.css

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,7 @@
99

1010
/* https://mkdocstrings.github.io/handlers/python/#recommended-style-material */
1111

12-
.doc-contents th, .doc-contents td {
13-
padding: 0.5em 0.8em !important;
14-
}
15-
1612
div.doc-contents:not(.first) {
1713
padding-left: 15px;
1814
border-left: 4px solid rgba(230, 230, 230);
1915
}
20-
21-
h5.doc-heading {
22-
text-transform: none !important;
23-
}
24-
25-
.hidden-toc::before {
26-
margin-top: 0 !important;
27-
padding-top: 0 !important;
28-
}
29-
30-
.hidden-toc a.headerlink {
31-
display: none;
32-
}
33-
34-
td code {
35-
word-break: normal !important;
36-
}
37-
38-
td p {
39-
margin-top: 0 !important;
40-
margin-bottom: 0 !important;
41-
}

docs/styling.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
## Recommended styles
22

3-
Adding this styling to your site is **strongly** recommended, otherwise things may not look right. You can, of course, adapt and add more.
3+
Adding this styling to your site is recommended, otherwise things may not look right. You can, of course, adapt and add more.
44

5-
!!! example "css/mkdocstrings.css"
5+
!!! example "docs/css/mkdocstrings.css"
66
```css
77
--8<-- "examples/simple/docs/css/mkdocstrings.css"
88
```
@@ -13,6 +13,12 @@ Adding this styling to your site is **strongly** recommended, otherwise things m
1313
- css/mkdocstrings.css
1414
```
1515

16+
This is in addition to the mandatory style that *mkdocstrings-crystal* already inserts (just for reference):
17+
18+
```css
19+
--8<-- "mkdocstrings/templates/crystal/material/style.css"
20+
```
21+
1622
## Custom styles
1723

1824
The doc items have consistently applied CSS classes. As of now, there is no separate documentation of what exactly they are. You are recommended to just *inspect* in the browser whenever you don't like the look of something and see how to reach it in CSS according to the markup.

examples/migrated/docs/css/mkdocstrings.css

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,3 @@ div.doc-contents:not(.first) {
33
padding-left: 15px;
44
border-left: 4px solid rgba(230, 230, 230);
55
}
6-
7-
/* Prevent all-caps names in headings */
8-
h5.doc-heading {
9-
text-transform: none !important;
10-
}
11-
12-
/* [View source] links don't have brackets by default */
13-
a.doc-source-link::before {
14-
content: "[";
15-
color: var(--md-typeset-color);
16-
}
17-
a.doc-source-link::after {
18-
content: "]";
19-
color: var(--md-typeset-color);
20-
}

examples/simple/docs/css/mkdocstrings.css

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,3 @@ div.doc-contents:not(.first) {
33
padding-left: 15px;
44
border-left: 4px solid rgba(230, 230, 230);
55
}
6-
7-
/* Prevent all-caps names in headings */
8-
h5.doc-heading {
9-
text-transform: none !important;
10-
}
11-
12-
/* [View source] links don't have brackets by default */
13-
a.doc-source-link::before {
14-
content: "[";
15-
color: var(--md-typeset-color);
16-
}
17-
a.doc-source-link::after {
18-
content: "]";
19-
color: var(--md-typeset-color);
20-
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* Prevent all-caps names in headings */
2+
h5.doc-heading {
3+
text-transform: none !important;
4+
}
5+
6+
/* [View source] links don't have brackets by default */
7+
a.doc-source-link::before {
8+
content: "[";
9+
color: var(--md-typeset-color);
10+
}
11+
a.doc-source-link::after {
12+
content: "]";
13+
color: var(--md-typeset-color);
14+
}

0 commit comments

Comments
 (0)