Skip to content

Commit 2b235e4

Browse files
CSS fixes for Materials for MkDocs and wkhtmltopdf
1 parent c2f3199 commit 2b235e4

File tree

1 file changed

+126
-12
lines changed

1 file changed

+126
-12
lines changed

docs/stylesheets/extra.css

Lines changed: 126 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/* fix logo size */
2+
.md-header-nav__button.md-logo img, .md-header-nav__button.md-logo svg {
3+
width: auto;
4+
height: 21px;
5+
}
6+
7+
/* fix image border */
8+
.md-typeset img[align=left], .md-typeset svg[align=left] {
9+
margin: auto;
10+
}
11+
112
.md-typeset a {
213
color: #ff1744;
314
word-break: break-word;
@@ -10,6 +21,7 @@
1021
text-decoration: underline;
1122
}
1223

24+
.md-nav__item
1325
.md-nav__link--active,
1426
.md-nav__link:active {
1527
color: #ff1744;
@@ -29,8 +41,20 @@
2941
word-break: keep-all;
3042
}
3143

44+
.md-typeset a {
45+
color: #ff1744;
46+
word-break: break-word;
47+
}
48+
49+
50+
/* fixing colors because wkhtmltopdf does not understand colors such as "var(--md-typeset-a-color);" */
3251
@media print {
3352

53+
/* fix image size */
54+
.md-typeset img, .md-typeset svg {
55+
zoom: 80%;
56+
}
57+
3458
/* disable menu */
3559
.md-md-header {
3660
display: none;
@@ -41,23 +65,111 @@
4165
display: none;
4266
}
4367

68+
/* fix font size of normal text */
69+
.md-typeset {
70+
font-size: 10pt;
71+
}
72+
73+
/* fix font size of text in tables */
74+
.md-typeset table:not([class]) {
75+
font-size: 8pt;
76+
}
77+
78+
/* fix colors of table headers */
79+
.md-typeset table:not([class]) th {
80+
color: white;
81+
background-color: rgba(0, 0, 0, 0.54);
82+
min-width: 60pt;
83+
}
84+
85+
/* fix color of footnote and font */
86+
.md-typeset .footnote {
87+
color: black;
88+
font-size: 8pt;
89+
}
90+
91+
/* fix font of code in footnote */
92+
.md-typeset .footnote code {
93+
font-size: 8pt;
94+
}
95+
96+
/* hide footnode link */
97+
.md-typeset .footnote-backref::before {
98+
display: none;
99+
}
100+
101+
/* fix code background color */
102+
.md-typeset code {
103+
font-size: 8pt;
104+
background-color: whitesmoke;
105+
}
106+
107+
/* fix code foreground color */
108+
.md-typeset code, .md-typeset pre, .md-typeset kbd {
109+
color: #36464e;
110+
}
111+
112+
/* fix code color for line numbers */
113+
.highlighttable .linenodiv pre {
114+
color: rgba(0, 0, 0, 0.54);
115+
text-align: right;
116+
}
117+
118+
/* fix settings for line numbers */
119+
.highlighttable .linenos {
120+
padding: 6pt 6pt;
121+
font-size: 8pt;
122+
background-color: rgba(0,0,0,.07);
123+
}
124+
125+
/* fix code highlighting colors */
126+
.codehilite .k, .highlight .k, .codehilite .kd, .highlight .kd, .codehilite .kn, .highlight .kn, .codehilite .kp, .highlight .kp, .codehilite .kr, .highlight .kr, .codehilite .kt, .highlight .kt {
127+
color: #3f6ec6;
128+
}
129+
.codehilite .kc, .highlight .kc, .codehilite .n, .highlight .n {
130+
color: #36464e;
131+
}
132+
.codehilite .p, .highlight .p {
133+
color: rgba(0, 0, 0, 0.54);
134+
}
135+
.codehilite .o, .highlight .o, .codehilite .ow, .highlight .ow {
136+
color: rgba(0, 0, 0, 0.54);
137+
}
138+
.codehilite .c, .highlight .c, .codehilite .cm, .highlight .cm, .codehilite .c1, .highlight .c1, .codehilite .ch, .highlight .ch, .codehilite .cs, .highlight .cs, .codehilite .sd, .highlight .sd {
139+
color: rgba(0, 0, 0, 0.54)
140+
}
141+
.codehilite .m, .highlight .m, .codehilite .mf, .highlight .mf, .codehilite .mh, .highlight .mh, .codehilite .mi, .highlight .mi, .codehilite .il, .highlight .il, .codehilite .mo, .highlight .mo {
142+
color: #d52a2a;
143+
}
144+
.codehilite .cpf, .highlight .cpf, .codehilite .l, .highlight .l, .codehilite .s, .highlight .s, .codehilite .sb, .highlight .sb, .codehilite .sc, .highlight .sc, .codehilite .s2, .highlight .s2, .codehilite .si, .highlight .si, .codehilite .s1, .highlight .s1, .codehilite .ss, .highlight .ss {
145+
color: #1c7d4d;
146+
}
147+
.codehilite .no, .highlight .no, .codehilite .nb, .highlight .nb, .codehilite .bp, .highlight .bp {
148+
color: #6e59d9;
149+
}
150+
151+
/* add space between line numbers and code */
152+
span.linenos {
153+
padding-right: 12pt;
154+
}
155+
156+
/* fix background color in body */
157+
body {
158+
background-color: white;
159+
}
160+
161+
/* fix row seperators */
162+
.md-typeset table:not([class]) td {
163+
padding: .6rem .8rem;
164+
border-top: .05rem solid rgba(0,0,0,.07);
165+
vertical-align: top;
166+
}
167+
44168
/* do not show link details in brackets content: " [" attr(href) "]" */
45169
.md-typeset a:after {
46170
display: none;
47171
}
48172

49-
/* disable scrollbar */
50-
.md-typeset__scrollwrap,
51-
.md-typeset table:not([class]),
52-
.md-typeset
53-
.md-typeset__table table,
54-
.md-container,
55-
.md-main,
56-
html {
57-
overflow-x: hidden;
58-
-webkit-overflow-scrolling: hidden
59-
}
60-
61173
/* table-header-group leads to overlap with content */
62174
thead {
63175
display: table-row-group;
@@ -75,6 +187,8 @@
75187
page-break-before: avoid;
76188
}
77189

190+
[id="severity-of-the-rule"],
191+
[id="keywords-used"],
78192
[id="we-do-not-agree-with-all-your-standards"],
79193
[id="column"],
80194
[id="function"],

0 commit comments

Comments
 (0)