~james/core

core/web/src/markup.css -rw-r--r-- 6.0 KiB
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 14 hours ago
                                                                                
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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
/* styles for rendered markdown, see $lib/markup. the html is sanitised to a known
   set of tags and classes, so everything here is addressed by element */
@layer components {
	.markup {
		@apply typography-paragraph-body text-foreground-default;
		overflow-wrap: break-word;
	}

	.markup > :first-child,
	/* the wrapper hides the render's first child from the rule above, so repeat it inside */
	.markup > [data-markup] > :first-child {
		@apply mt-none;
	}

	.markup > :last-child,
	.markup > [data-markup] > :last-child {
		@apply mb-none;
	}

	.markup h1,
	.markup h2,
	.markup h3,
	.markup h4,
	.markup h5,
	.markup h6 {
		@apply mt-xl mb-sm font-medium text-foreground-default;
	}

	.markup h1 {
		@apply border-b border-border-default pb-xs typography-heading-3;
	}

	.markup h2 {
		@apply border-b border-border-default pb-xs typography-heading-4;
	}

	.markup h3 {
		@apply typography-paragraph-large font-semibold;
	}

	.markup h4,
	.markup h5,
	.markup h6 {
		@apply typography-paragraph-regular font-semibold;
	}

	.markup a.anchor {
		@apply ml-xs text-foreground-placeholder no-underline opacity-0 transition-opacity;
	}

	.markup :hover > a.anchor,
	.markup a.anchor:focus-visible {
		@apply opacity-100;
	}

	.markup p,
	.markup blockquote,
	.markup ul,
	.markup ol,
	.markup pre,
	.markup table,
	.markup details {
		@apply my-sm;
	}

	.markup a {
		@apply text-foreground-link-default underline hover:text-foreground-link-hover;
	}

	.markup a.mention {
		@apply font-medium no-underline hover:underline;
	}

	.markup strong {
		@apply font-semibold;
	}

	.markup ul,
	.markup ol {
		@apply pl-xl;
	}

	.markup ul {
		@apply list-disc;
	}

	.markup ol {
		@apply list-decimal;
	}

	.markup li + li {
		@apply mt-2xs;
	}

	.markup li > ul,
	.markup li > ol {
		@apply my-2xs;
	}

	.markup dt {
		@apply mt-sm font-semibold;
	}

	.markup dd {
		@apply pl-xl;
	}

	.markup blockquote {
		@apply border-l-2 border-border-strong pl-md text-foreground-muted;
	}

	.markup code {
		@apply rounded bg-background-inset px-2xs py-3xs font-mono text-[0.875em];
	}

	.markup pre {
		@apply overflow-x-auto rounded border border-border-default bg-background-canvas p-sm;
	}

	/* pre above already has the padding and background, inline code would double it */
	.markup pre code {
		@apply bg-transparent p-none font-mono text-[0.875em] leading-[calc(20/13)];
	}

	.markup :where([data-codeblock]) {
		@apply my-sm flex max-h-150 flex-col overflow-hidden rounded border border-border-default;
	}

	.markup :where([data-codeblock][data-expanded]) {
		@apply max-h-[none];
	}

	.markup :where([data-codeblock]) > pre {
		@apply m-none min-h-0 flex-1 overflow-x-auto overflow-y-hidden rounded-none border-none;
	}

	.markup :where([data-codeblock][data-expanded]) > pre {
		@apply overflow-auto;
	}

	.markup :where([data-codeblock-toolbar]) {
		@apply box-content min-h-8 shrink-0 border-b border-border-default bg-background-default p-xs;
	}

	.markup :where([data-mermaid]) {
		@apply my-sm;
		--pele-bg: var(--color-background-default);
		--pele-fg: var(--color-foreground-default);
		--pele-muted: var(--color-foreground-muted);
		--pele-line: var(--color-foreground-default);
		--pele-surface: var(--color-background-inset);
		--pele-surface-alt: var(--color-background-muted);
		--pele-border: var(--color-border-strong);
		--pele-accent: var(--color-background-info-emphasis);
		--pele-critical: var(--color-foreground-danger);
		--pele-radius: var(--radius-sm);
		--pele-font: var(--font-sans);
		--pele-font-mono: var(--font-mono);
	}

	.markup kbd {
		@apply rounded border border-border-default bg-background-subtle px-1.5 py-3xs font-mono text-[0.875em];
	}

	.markup hr {
		@apply my-xl border-t border-border-default;
	}

	.markup img,
	.markup video {
		@apply inline-block max-w-full;
	}

	.markup img {
		@apply cursor-zoom-in rounded-sm;
	}

	.markup a img {
		@apply cursor-auto;
	}

	.markup table {
		@apply block w-max max-w-full border-collapse overflow-x-auto;
	}

	.markup th,
	.markup td {
		@apply border border-border-default px-sm py-1.5 text-left;
	}

	.markup th {
		@apply bg-background-subtle font-semibold;
	}

	.markup summary {
		@apply cursor-pointer font-medium;
	}

	.markup ul.task-list-container {
		@apply list-none pl-none;
	}

	/* only the outermost list gives up its indent, a nested one still steps in */
	.markup li > ul.task-list-container {
		@apply pl-xl;
	}

	/* the checkbox and its label stay in the inline flow, so a nested list still
	   drops to its own line */
	.markup input[type="checkbox"] {
		@apply mr-2xs translate-y-0.5;
	}

	/* a footnote you jump to lands mid screen rather than up against the top */
	.markup :is(a.footnote-anchor, li.footnote-item)[id] {
		scroll-margin-top: 48vh;
	}

	.markup sup.footnote-ref a {
		@apply no-underline hover:underline;
	}

	.markup hr.footnotes-sep {
		@apply mt-2xl;
	}

	.markup section.footnotes {
		@apply typography-paragraph-small text-foreground-muted;
	}

	/* github style alerts, `> [!NOTE]` and friends */
	.markup .markdown-alert {
		@apply my-sm border-l-2 border-border-default pl-md;
	}

	.markup .markdown-alert-title {
		@apply font-semibold;
	}

	.markup .markdown-alert > :last-child {
		@apply mb-none;
	}

	.markup .markdown-alert-note {
		@apply border-background-info-emphasis;
	}

	.markup .markdown-alert-note .markdown-alert-title {
		@apply text-foreground-info;
	}

	.markup .markdown-alert-tip {
		@apply border-background-success-emphasis;
	}

	.markup .markdown-alert-tip .markdown-alert-title {
		@apply text-foreground-success;
	}

	.markup .markdown-alert-important {
		@apply border-background-info-emphasis;
	}

	.markup .markdown-alert-important .markdown-alert-title {
		@apply text-foreground-info;
	}

	.markup .markdown-alert-warning {
		@apply border-background-warning-emphasis;
	}

	.markup .markdown-alert-warning .markdown-alert-title {
		@apply text-foreground-warning;
	}

	.markup .markdown-alert-caution {
		@apply border-background-danger-emphasis;
	}

	.markup .markdown-alert-caution .markdown-alert-title {
		@apply text-foreground-danger;
	}
}