-
Notifications
You must be signed in to change notification settings - Fork 122
/
base-text.scss
148 lines (126 loc) · 2.71 KB
/
base-text.scss
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*
This file is used as a common base style for markdown text rendering.
It is included in the global base styles in PDF rendering and in the markdown preview in the frontend.
This file is not actually a scss file, but a regular css file.
The reason why the file extension is .scss is that the SCSS-preprocessor inlines it in the markdown preview component styles.
*/
/* Component base styles for component layout */
table {
width: 100%;
caption-side: bottom;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th {
font-weight: bold;
}
td {
overflow-wrap: anywhere;
}
th, td {
padding: 0.3em;
}
tr {
break-inside: avoid;
}
thead {
break-inside: avoid;
break-after: avoid;
}
caption {
font-weight: bold;
break-inside: avoid;
break-before: avoid;
}
table img {
display: block;
margin-left: auto;
margin-right: auto;
}
/* Images and figures */
figure {
break-inside: avoid;
text-align: center;
margin-left: 0;
margin-right: 0;
}
figcaption {
font-weight: bold;
break-inside: avoid;
break-before: avoid;
}
img {
max-width: 100%;
}
/* Code blocks */
pre code {
display: block;
}
/* Allow line wrapping in code blocks: prevent code from overflowing page */
pre {
white-space: pre-wrap;
}
/* Markdown text styles */
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }
h1, h2, h3, h4, h5, h6 {
font-weight: bold;
margin: 1em 0 0.4em 0;
}
p, ul, ol, blockquote, table, .code-block, .markdown {
margin: 0 0 0.8em 0;
padding: 0;
}
p:last-child, ul:last-child, ol:last-child, blockquote:last-child, table:last-child, .code-block:last-child, .markdown:last-child {
margin-bottom: 0;
}
blockquote {
background-color: #f9f9f9;
border-left: 5px solid #ccc;
padding: 0.1em 0.5em;
}
ul li, ol li {
margin-left: 1.5em;
padding-left: 0;
}
ul li.task-list-item {
list-style-type: none;
}
ul li.task-list-item input[type=checkbox] {
margin-left: -1.5em;
width: 1.5em;
padding: 0;
}
pre {
white-space: pre-wrap;
}
code {
padding: 0.2em;
border-radius: 3px;
font-family: monospace;
font-size: 0.85em;
background-color: rgb(240, 240, 240);
}
pre code {
padding: 1em; /* Conflicts with syntax highlighting "pre code.hljs" padding. For now both have to have the same value. */
display: block;
}
/* Mermaid diagrams */
.mermaid-diagram {
display: inline-block;
width: 100%;
height: 100%;
}
.mermaid-diagram img, .mermaid-diagram svg {
width: 100%;
height: 100%;
max-width: 100%;
max-height: 23cm; /* prevent text from overflowing page, approximation because we do not have access to the actual page content height */
object-fit: contain;
}