summaryrefslogtreecommitdiff
path: root/src/styles/markdown.css
blob: 9d30641247f9f78e7f9695b9d8e7531ff97f06ac (plain)
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
.sl-markdown-content
	:not(a, strong, em, del, span, input, code, br)
	+ :not(a, strong, em, del, span, input, code, br, :where(.not-content *)) {
	margin-top: 1rem;
}

/* Headings after non-headings have more spacing. */
.sl-markdown-content
	:not(h1, h2, h3, h4, h5, h6)
	+ :is(h1, h2, h3, h4, h5, h6):not(:where(.not-content *)) {
	margin-top: 1.5em;
}

.sl-markdown-content li + li:not(:where(.not-content *)),
.sl-markdown-content dt + dt:not(:where(.not-content *)),
.sl-markdown-content dt + dd:not(:where(.not-content *)),
.sl-markdown-content dd + dd:not(:where(.not-content *)) {
	margin-top: 0.25rem;
}

.sl-markdown-content li:not(:where(.not-content *)) {
	overflow-wrap: anywhere;
}

.sl-markdown-content
	li
	> :last-child:not(li, ul, ol):not(a, strong, em, del, span, input, :where(.not-content *)) {
	margin-bottom: 1.25rem;
}

.sl-markdown-content dt:not(:where(.not-content *)) {
	font-weight: 700;
}
.sl-markdown-content dd:not(:where(.not-content *)) {
	padding-inline-start: 1rem;
}

.sl-markdown-content :is(h1, h2, h3, h4, h5, h6):not(:where(.not-content *)) {
	color: var(--sl-color-white);
	line-height: var(--sl-line-height-headings);
	font-weight: 600;
    font-size: 10000%;
}

.sl-markdown-content :is(img, picture, video, canvas, svg, iframe):not(:where(.not-content *)) {
	display: block;
	max-width: 100%;
	height: auto;
}

.sl-markdown-content h1:not(:where(.not-content *)) {
	font-size: var(--sl-text-h1);
}
.sl-markdown-content h2:not(:where(.not-content *)) {
	font-size: var(--sl-text-h2);
}
.sl-markdown-content h3:not(:where(.not-content *)) {
	font-size: var(--sl-text-h3);
}
.sl-markdown-content h4:not(:where(.not-content *)) {
	font-size: var(--sl-text-h4);
}
.sl-markdown-content h5:not(:where(.not-content *)) {
	font-size: var(--sl-text-h5);
}
.sl-markdown-content h6:not(:where(.not-content *)) {
	font-size: var(--sl-text-h6);
}

.sl-markdown-content a:not(:where(.not-content *)) {
	color: var(--sl-color-text-accent);
}
.sl-markdown-content a:hover:not(:where(.not-content *)) {
	color: var(--sl-color-white);
}

.sl-markdown-content code:not(:where(.not-content *)) {
	background-color: var(--sl-color-bg-inline-code);
	margin-block: -0.125rem;
	padding: 0.125rem 0.375rem;
	font-size: var(--sl-text-code-sm);
}
.sl-markdown-content :is(h1, h2, h3, h4, h5, h6) code {
	font-size: inherit;
}

.sl-markdown-content pre:not(:where(.not-content *)) {
	border: 1px solid var(--sl-color-gray-5);
	padding: 0.75rem 1rem;
	font-size: var(--sl-text-code);
	tab-size: 2;
}

.sl-markdown-content pre code:not(:where(.not-content *)) {
	all: unset;
	font-family: var(--__sl-font-mono);
}

.sl-markdown-content blockquote:not(:where(.not-content *)) {
	border-inline-start: 1px solid var(--sl-color-gray-5);
	padding-inline-start: 1rem;
}

/* Table styling */
.sl-markdown-content table:not(:where(.not-content *)) {
	display: block;
	overflow: auto;
	border-spacing: 0;
}
.sl-markdown-content :is(th, td):not(:where(.not-content *)) {
	border-bottom: 1px solid var(--sl-color-gray-5);
	padding: 0.5rem 1rem;
	/* Align text to the top of the row in multiline tables. */
	vertical-align: baseline;
}
.sl-markdown-content :is(th:first-child, td:first-child):not(:where(.not-content *)) {
	padding-inline-start: 0;
}
.sl-markdown-content :is(th:last-child, td:last-child):not(:where(.not-content *)) {
	padding-inline-end: 0;
}
.sl-markdown-content th:not(:where(.not-content *)) {
	color: var(--sl-color-white);
	font-weight: 600;
}
/* Align headings to the start of the line unless set by the `align` attribute. */
.sl-markdown-content th:not([align]):not(:where(.not-content *)) {
	text-align: start;
}
/* <table>s, <hr>s, and <blockquote>s inside asides */
.sl-markdown-content .starlight-aside :is(th, td, hr, blockquote):not(:where(.not-content *)) {
	border-color: var(--sl-color-gray-4);
}
@supports (border-color: color-mix(in srgb, var(--sl-color-asides-text-accent) 30%, transparent)) {
	.sl-markdown-content .starlight-aside :is(th, td, hr, blockquote):not(:where(.not-content *)) {
		border-color: color-mix(in srgb, var(--sl-color-asides-text-accent) 30%, transparent);
	}
}

/* <code> inside asides */
@supports (border-color: color-mix(in srgb, var(--sl-color-asides-text-accent) 12%, transparent)) {
	.sl-markdown-content .starlight-aside code:not(:where(.not-content *)) {
		background-color: color-mix(in srgb, var(--sl-color-asides-text-accent) 12%, transparent);
	}
}

.sl-markdown-content hr:not(:where(.not-content *)) {
	border: 0;
	border-bottom: 1px solid var(--sl-color-hairline);
}

/* <details> and <summary> styles */
.sl-markdown-content details:not(:where(.not-content *)) {
	--sl-details-border-color: var(--sl-color-gray-5);
	--sl-details-border-color--hover: var(--sl-color-text-accent);

	border-inline-start: 2px solid var(--sl-details-border-color);
	padding-inline-start: 1rem;
}
.sl-markdown-content details:not([open]):hover:not(:where(.not-content *)),
.sl-markdown-content details:has(> summary:hover):not(:where(.not-content *)) {
	border-color: var(--sl-details-border-color--hover);
}
.sl-markdown-content summary:not(:where(.not-content *)) {
	color: var(--sl-color-white);
	cursor: pointer;
	display: block; /* Needed to hide the default marker in some browsers. */
	font-weight: 600;
	/* Expand the outline so that the marker cannot distort it. */
	margin-inline-start: -0.5rem;
	padding-inline-start: 0.5rem;
}
.sl-markdown-content details[open] > summary:not(:where(.not-content *)) {
	margin-bottom: 1rem;
}

/* <summary> marker styles */
.sl-markdown-content summary:not(:where(.not-content *))::marker,
.sl-markdown-content summary:not(:where(.not-content *))::-webkit-details-marker {
	display: none;
}
.sl-markdown-content summary:not(:where(.not-content *))::before {
	--sl-details-marker-size: 1.25rem;

	background-color: currentColor;
	content: '';
	display: inline-block;
	height: var(--sl-details-marker-size);
	width: var(--sl-details-marker-size);
	margin-inline: calc((var(--sl-details-marker-size) / 4) * -1) 0.25rem;
	vertical-align: middle;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.8 11.3 10.6 7a1 1 0 1 0-1.4 1.5l3.5 3.5-3.5 3.5a1 1 0 0 0 0 1.4 1 1 0 0 0 .7.3 1 1 0 0 0 .7-.3l4.2-4.2a1 1 0 0 0 0-1.4Z'/%3E%3C/svg%3E%0A");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.8 11.3 10.6 7a1 1 0 1 0-1.4 1.5l3.5 3.5-3.5 3.5a1 1 0 0 0 0 1.4 1 1 0 0 0 .7.3 1 1 0 0 0 .7-.3l4.2-4.2a1 1 0 0 0 0-1.4Z'/%3E%3C/svg%3E%0A");
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
	.sl-markdown-content summary:not(:where(.not-content *))::before {
		transition: transform 0.2s ease-in-out;
	}
}
.sl-markdown-content details[open] > summary:not(:where(.not-content *))::before {
	transform: rotateZ(90deg);
}
[dir='rtl'] .sl-markdown-content summary:not(:where(.not-content *))::before,
.sl-markdown-content [dir='rtl'] summary:not(:where(.not-content *))::before {
	transform: rotateZ(180deg);
}
/* <summary> with only a paragraph automatically added when using MDX */
.sl-markdown-content summary:not(:where(.not-content *)) p:only-child {
	display: inline;
}

/* <details> styles inside asides */
.sl-markdown-content .starlight-aside details:not(:where(.not-content *)) {
	--sl-details-border-color: var(--sl-color-asides-border);
	--sl-details-border-color--hover: var(--sl-color-asides-text-accent);
}