Skip to content

Commit a64cdfd

Browse files
silverwindlafriks
andauthored
Markdown CSS tweaks (#15572)
Update Markdown CSS to more closely match GH rendering. Changes include better nested list margins and tweaked font sizes. Co-authored-by: Lauris BH <[email protected]>
1 parent ae6d786 commit a64cdfd

File tree

1 file changed

+34
-24
lines changed

1 file changed

+34
-24
lines changed

web_src/less/_markdown.less

+34-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.markdown:not(code) {
22
overflow: hidden;
33
font-size: 16px;
4-
line-height: 1.6 !important;
4+
line-height: 1.5 !important;
55
word-wrap: break-word;
66

77
&.ui.segment {
@@ -75,14 +75,10 @@
7575
h4,
7676
h5,
7777
h6 {
78-
margin-top: 1em;
78+
margin-top: 24px;
7979
margin-bottom: 16px;
8080
font-weight: 600;
81-
line-height: 1.4;
82-
83-
&:first-of-type {
84-
margin-top: 0 !important;
85-
}
81+
line-height: 1.25;
8682
}
8783

8884
h1 tt,
@@ -102,38 +98,36 @@
10298

10399
h1 {
104100
padding-bottom: .3em;
105-
font-size: 2.25em;
106-
line-height: 1.2;
101+
font-size: 2em;
107102
border-bottom: 1px solid var(--color-secondary);
108103
}
109104

110105
h2 {
111106
padding-bottom: .3em;
112-
font-size: 1.75em;
113-
line-height: 1.225;
107+
font-size: 1.5em;
114108
border-bottom: 1px solid var(--color-secondary);
115109
}
116110

117111
h3 {
118-
font-size: 1.5em;
119-
line-height: 1.43;
112+
font-size: 1.25em;
120113
}
121114

122115
h4 {
123-
font-size: 1.25em;
116+
font-size: 1em;
124117
}
125118

126119
h5 {
127-
font-size: 1em;
120+
font-size: .875em;
128121
}
129122

130123
h6 {
131-
font-size: 1em;
124+
font-size: .85em;
132125
color: var(--color-text-light-2);
133126
}
134127

135128
p,
136129
blockquote,
130+
details,
137131
ul,
138132
ol,
139133
dl,
@@ -232,7 +226,11 @@
232226
}
233227

234228
li > p {
235-
margin-top: 0;
229+
margin-top: 16px;
230+
}
231+
232+
li + li {
233+
margin-top: .25em;
236234
}
237235

238236
dl {
@@ -268,10 +266,13 @@
268266
}
269267

270268
table {
271-
width: auto;
272-
overflow: auto;
273-
word-break: keep-all;
274269
display: block;
270+
width: 100%;
271+
width: -webkit-max-content;
272+
width: -moz-max-content;
273+
width: max-content;
274+
max-width: 100%;
275+
overflow: auto;
275276
}
276277

277278
table th {
@@ -294,11 +295,20 @@
294295

295296
img {
296297
max-width: 100%;
297-
box-sizing: border-box;
298+
box-sizing: initial;
299+
}
300+
301+
img[align="right"] {
302+
padding-left: 20px;
303+
}
304+
305+
img[align="left"] {
306+
padding-right: 20px;
298307
}
299308

300309
.emoji {
301310
max-width: none;
311+
vertical-align: text-top;
302312
}
303313

304314
span.frame {
@@ -391,11 +401,11 @@
391401

392402
code,
393403
tt {
394-
padding: .2em .3em;
404+
padding: .2em .4em;
395405
margin: 0;
396406
font-size: 85%;
397407
background-color: var(--color-markdown-code-block);
398-
border-radius: 3px;
408+
border-radius: 4px;
399409
}
400410

401411
code br,
@@ -428,7 +438,7 @@
428438
font-size: 85%;
429439
line-height: 1.45;
430440
background-color: var(--color-markdown-code-block);
431-
border-radius: 3px;
441+
border-radius: 4px;
432442
}
433443

434444
.highlight pre {

0 commit comments

Comments
 (0)