@netlify/spark-ui 0.0.46 → 0.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/packages/assets/fonts/README.md +5 -0
- package/packages/assets/fonts/figtree/Figtree-Italic[wght].woff2 +0 -0
- package/packages/assets/fonts/figtree/Figtree[wght].woff2 +0 -0
- package/packages/assets/fonts/instrument-sans/InstrumentSans-Italic[wdth,wght].woff2 +0 -0
- package/packages/assets/fonts/instrument-sans/InstrumentSans[wdth,wght].woff2 +0 -0
- package/packages/assets/fonts/martian-mono/MartianMono-Bold.woff2 +0 -0
- package/packages/assets/fonts/martian-mono/MartianMono-Medium.woff2 +0 -0
- package/packages/assets/fonts/martian-mono/MartianMono-Regular.woff2 +0 -0
- package/packages/assets/fonts/martian-mono/MartianMono-SemiBold.woff2 +0 -0
- package/packages/components/CodeBlock.astro +208 -0
- package/packages/global.d.ts +5 -0
- package/packages/styles/base.css +1 -0
- package/packages/styles/code-block.css +249 -0
- package/packages/styles/fonts.css +125 -10
- package/packages/styles/reset.css +79 -0
- package/packages/styles/tokens.css +24 -19
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/spark-ui",
|
|
3
3
|
"description": "Assets, design tokens, components, and utilities",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.47",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/components/preact/index.js",
|
|
7
7
|
"types": "dist/components/preact/index.d.ts",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@preact/preset-vite": "^2.10.1",
|
|
36
|
+
"@shikijs/transformers": "^3.3.0",
|
|
36
37
|
"glob": "^11.0.1",
|
|
37
38
|
"preact": "^10.26.4",
|
|
38
39
|
"vite": "^6.2.5",
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
"vite-tsconfig-paths": "^5.1.4"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
|
-
"@terrazzo/cli": "^0.
|
|
45
|
+
"@terrazzo/cli": "^0.7.0",
|
|
45
46
|
"@terrazzo/plugin-css": "^0.6.0",
|
|
46
47
|
"@types/gtag.js": "^0.0.20",
|
|
47
48
|
"tslib": "^2.8.1",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { Code } from 'astro:components';
|
|
3
|
+
import '../styles/code-block.css';
|
|
4
|
+
import poimandresTheme from '../../themes/poimandres.json';
|
|
5
|
+
import {
|
|
6
|
+
transformerMetaHighlight,
|
|
7
|
+
transformerNotationDiff,
|
|
8
|
+
transformerNotationFocus,
|
|
9
|
+
} from '@shikijs/transformers';
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
code: string;
|
|
13
|
+
lang?: string;
|
|
14
|
+
highlight?: string;
|
|
15
|
+
del?: string;
|
|
16
|
+
ins?: string;
|
|
17
|
+
frame?: 'code' | 'terminal' | 'none';
|
|
18
|
+
theme?: string;
|
|
19
|
+
wrap?: boolean;
|
|
20
|
+
title?: string;
|
|
21
|
+
class?: string;
|
|
22
|
+
showLineNumbers?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const {
|
|
26
|
+
code,
|
|
27
|
+
lang = '',
|
|
28
|
+
highlight = '',
|
|
29
|
+
del = '',
|
|
30
|
+
ins = '',
|
|
31
|
+
frame = 'none',
|
|
32
|
+
theme = 'poimandres',
|
|
33
|
+
wrap = false,
|
|
34
|
+
title = '',
|
|
35
|
+
class: className,
|
|
36
|
+
showLineNumbers = false,
|
|
37
|
+
...rest
|
|
38
|
+
} = Astro.props;
|
|
39
|
+
|
|
40
|
+
// Process highlighting ranges (e.g. {2-3,6})
|
|
41
|
+
const highlightRanges = highlight
|
|
42
|
+
? highlight
|
|
43
|
+
.replace(/[{}]/g, '')
|
|
44
|
+
.split(',')
|
|
45
|
+
.map((range: string) => {
|
|
46
|
+
if (range.includes('-')) {
|
|
47
|
+
const [start, end] = range.split('-').map(Number);
|
|
48
|
+
return Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
|
49
|
+
}
|
|
50
|
+
return [Number(range)];
|
|
51
|
+
})
|
|
52
|
+
.flat()
|
|
53
|
+
: [];
|
|
54
|
+
|
|
55
|
+
// Process deleted lines
|
|
56
|
+
const delRanges = del
|
|
57
|
+
? del
|
|
58
|
+
.split(',')
|
|
59
|
+
.map((range: string) => {
|
|
60
|
+
if (range.includes('-')) {
|
|
61
|
+
const [start, end] = range.split('-').map(Number);
|
|
62
|
+
return Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
|
63
|
+
}
|
|
64
|
+
return [Number(range)];
|
|
65
|
+
})
|
|
66
|
+
.flat()
|
|
67
|
+
: [];
|
|
68
|
+
|
|
69
|
+
// Process inserted lines
|
|
70
|
+
const insRanges = ins
|
|
71
|
+
? ins
|
|
72
|
+
.split(',')
|
|
73
|
+
.map((range: string) => {
|
|
74
|
+
if (range.includes('-')) {
|
|
75
|
+
const [start, end] = range.split('-').map(Number);
|
|
76
|
+
return Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
|
77
|
+
}
|
|
78
|
+
return [Number(range)];
|
|
79
|
+
})
|
|
80
|
+
.flat()
|
|
81
|
+
: [];
|
|
82
|
+
|
|
83
|
+
// Apply highlighting, deletions, and insertions using Shiki's transformers
|
|
84
|
+
const codeWithMeta = code
|
|
85
|
+
.split('\n')
|
|
86
|
+
.map((line: string, i: number) => {
|
|
87
|
+
const lineNumber = i + 1;
|
|
88
|
+
const meta = [];
|
|
89
|
+
|
|
90
|
+
if (highlightRanges.includes(lineNumber)) {
|
|
91
|
+
meta.push('focus');
|
|
92
|
+
}
|
|
93
|
+
if (delRanges.includes(lineNumber)) {
|
|
94
|
+
meta.push('--');
|
|
95
|
+
}
|
|
96
|
+
if (insRanges.includes(lineNumber)) {
|
|
97
|
+
meta.push('++');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return meta.length > 0 ? `${line} // [!code ${meta.join(' ')}]` : line;
|
|
101
|
+
})
|
|
102
|
+
.join('\n');
|
|
103
|
+
|
|
104
|
+
// Determine which theme to use
|
|
105
|
+
const selectedTheme = theme === 'poimandres' ? poimandresTheme : theme;
|
|
106
|
+
|
|
107
|
+
// Determine if we should show line numbers
|
|
108
|
+
const showNumbers = showLineNumbers && code.split('\n').length > 1;
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
<div
|
|
112
|
+
class:list={[
|
|
113
|
+
'code-block',
|
|
114
|
+
frame === 'terminal' && 'terminal-frame',
|
|
115
|
+
frame === 'code' && 'code-frame',
|
|
116
|
+
frame === 'none' && 'no-frame',
|
|
117
|
+
showNumbers && 'with-line-numbers',
|
|
118
|
+
className,
|
|
119
|
+
]}
|
|
120
|
+
{...rest}
|
|
121
|
+
>
|
|
122
|
+
{
|
|
123
|
+
(title || lang) && frame !== 'none' && frame !== 'terminal' && (
|
|
124
|
+
<div class="code-block-title">
|
|
125
|
+
{lang && <span class="code-language">{lang}</span>}
|
|
126
|
+
{title && <span class="code-title">{title}</span>}
|
|
127
|
+
</div>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
<div class="code-block-content">
|
|
131
|
+
<Code
|
|
132
|
+
code={codeWithMeta}
|
|
133
|
+
lang={lang}
|
|
134
|
+
theme={selectedTheme}
|
|
135
|
+
wrap={wrap}
|
|
136
|
+
transformers={[
|
|
137
|
+
transformerMetaHighlight(),
|
|
138
|
+
transformerNotationDiff(),
|
|
139
|
+
transformerNotationFocus(),
|
|
140
|
+
]}
|
|
141
|
+
/>
|
|
142
|
+
<button class="copy-button" aria-label="Copy code to clipboard" data-tooltip="Copy">
|
|
143
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="copy-icon">
|
|
144
|
+
<path
|
|
145
|
+
d="M18 3c0-1.657-1.343-3-3-3v0h-12c-1.657 0-3 1.343-3 3v0 12c0 1.657 1.343 3 3 3v0h12c1.657 0 3-1.343 3-3v0zM15 1.5c0.828 0 1.5 0.672 1.5 1.5v0 12c0 0.828-0.672 1.5-1.5 1.5v0h-12c-0.828 0-1.5-0.672-1.5-1.5v0-12c0-0.828 0.672-1.5 1.5-1.5v0zM21 7.5c0.828 0 1.5 0.672 1.5 1.5v0 12c0 0.828-0.672 1.5-1.5 1.5v0h-12c-0.828 0-1.5-0.672-1.5-1.5v0-1.5h-1.5v1.5c0 1.657 1.343 3 3 3v0h12c1.657 0 3-1.343 3-3v0-12c0-1.657-1.343-3-3-3v0h-1.5v1.5z"
|
|
146
|
+
></path>
|
|
147
|
+
</svg>
|
|
148
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="check-icon">
|
|
149
|
+
<path
|
|
150
|
+
d="M22.942 6.582l-13.778 13.778c-0.156 0.156-0.371 0.253-0.609 0.253s-0.453-0.097-0.609-0.253v0l-6.028-6.028c-0.156-0.156-0.252-0.371-0.252-0.609 0-0.476 0.386-0.862 0.862-0.862 0.238 0 0.453 0.096 0.609 0.252v0l5.418 5.42 13.168-13.169c0.156-0.156 0.371-0.252 0.609-0.252 0.476 0 0.862 0.386 0.862 0.862 0 0.238-0.096 0.453-0.252 0.609v0z"
|
|
151
|
+
></path>
|
|
152
|
+
</svg>
|
|
153
|
+
</button>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<script>
|
|
158
|
+
document.addEventListener('astro:page-load', () => {
|
|
159
|
+
setupCopyBtn();
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
// Also initialize immediately in case the page is not using transitions
|
|
163
|
+
if (document.readyState === 'complete' || document.readyState === 'interactive') {
|
|
164
|
+
setupCopyBtn();
|
|
165
|
+
} else {
|
|
166
|
+
document.addEventListener('DOMContentLoaded', setupCopyBtn);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function setupCopyBtn() {
|
|
170
|
+
const copyButtons = document.querySelectorAll(
|
|
171
|
+
'.code-block .copy-button'
|
|
172
|
+
) as NodeListOf<HTMLButtonElement>;
|
|
173
|
+
copyButtons.forEach(button => {
|
|
174
|
+
button.addEventListener('click', async () => {
|
|
175
|
+
const codeBlock = button.closest('.code-block');
|
|
176
|
+
if (!codeBlock) return;
|
|
177
|
+
|
|
178
|
+
const pre = codeBlock.querySelector('pre');
|
|
179
|
+
if (!pre) return;
|
|
180
|
+
|
|
181
|
+
// Get the text content, remove the Shiki annotations if present
|
|
182
|
+
const rawText = pre.textContent || '';
|
|
183
|
+
const code = rawText.replace(/\/\/\s*\[!.*?\]/g, '').trim();
|
|
184
|
+
|
|
185
|
+
// Copy to clipboard
|
|
186
|
+
try {
|
|
187
|
+
await navigator.clipboard.writeText(code);
|
|
188
|
+
button.classList.add('copied');
|
|
189
|
+
button.setAttribute('data-tooltip', 'Copied!');
|
|
190
|
+
setTimeout(() => {
|
|
191
|
+
button.classList.remove('copied');
|
|
192
|
+
button.setAttribute('data-tooltip', 'Copy');
|
|
193
|
+
button.blur();
|
|
194
|
+
}, 2000);
|
|
195
|
+
} catch (error) {
|
|
196
|
+
console.error('Failed to copy code: ', error);
|
|
197
|
+
button.classList.add('error');
|
|
198
|
+
button.setAttribute('data-tooltip', 'Failed to copy!');
|
|
199
|
+
setTimeout(() => {
|
|
200
|
+
button.classList.remove('error');
|
|
201
|
+
button.setAttribute('data-tooltip', 'Copy');
|
|
202
|
+
button.blur();
|
|
203
|
+
}, 2000);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
</script>
|
package/packages/styles/base.css
CHANGED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
.code-block {
|
|
2
|
+
position: relative;
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
width: 100%;
|
|
5
|
+
border: 1px solid var(--neutral-700);
|
|
6
|
+
border-radius: 6px;
|
|
7
|
+
font-size: 0.9em;
|
|
8
|
+
line-height: 1.5;
|
|
9
|
+
background-color: var(--neutral-800);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* Title */
|
|
13
|
+
.code-block-title {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
gap: var(--space-s);
|
|
17
|
+
padding-block: var(--space-2xs);
|
|
18
|
+
padding-inline: var(--space-s);
|
|
19
|
+
border-bottom: 1px solid var(--neutral-700);
|
|
20
|
+
font-size: 0.9em;
|
|
21
|
+
color: var(--neutral-200);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.code-block-title .code-language {
|
|
25
|
+
padding: 0.1em 0.5em;
|
|
26
|
+
border-radius: 2px;
|
|
27
|
+
background-color: var(--neutral-700);
|
|
28
|
+
letter-spacing: 0.05em;
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
text-transform: uppercase;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.code-block-title .code-title {
|
|
34
|
+
flex-grow: 1;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
text-overflow: ellipsis;
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
font-weight: 500;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Code */
|
|
42
|
+
.code-block .code-block-content {
|
|
43
|
+
position: relative;
|
|
44
|
+
overflow: auto;
|
|
45
|
+
margin: 0
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.code-block pre {
|
|
49
|
+
border: 0;
|
|
50
|
+
border-radius: 6px;
|
|
51
|
+
padding-block: var(--space-m);
|
|
52
|
+
padding-inline: var(--space-s);
|
|
53
|
+
margin: 0
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.code-block .code-block-content:not(:only-child) pre {
|
|
57
|
+
border-radius: 0 0 6px 6px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.code-block pre:focus-visible {
|
|
61
|
+
outline-offset: -2px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.code-block :where(pre, code) {
|
|
65
|
+
font-family: var(--font-monospace, monospace);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Copy button */
|
|
69
|
+
.code-block .copy-button {
|
|
70
|
+
position: absolute;
|
|
71
|
+
top: 0.5rem;
|
|
72
|
+
right: 0.5rem;
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
width: 2rem;
|
|
77
|
+
height: 2rem;
|
|
78
|
+
margin: 0;
|
|
79
|
+
border: 1px solid var(--neutral-700);
|
|
80
|
+
border-radius: 4px;
|
|
81
|
+
background-color: var(--neutral-800);
|
|
82
|
+
color: var(--neutral-400);
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
transition: all 0.2s ease;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.code-block .copy-button:hover,
|
|
88
|
+
.code-block .copy-button:focus {
|
|
89
|
+
background-color: var(--neutral-900);
|
|
90
|
+
color: var(--neutral-200);
|
|
91
|
+
outline: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.code-block .copy-button svg {
|
|
95
|
+
flex-shrink: 0;
|
|
96
|
+
width: 1rem;
|
|
97
|
+
height: 1rem;
|
|
98
|
+
margin: 0;
|
|
99
|
+
color: inherit;
|
|
100
|
+
fill: currentColor;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.code-block .copy-button .copy-icon {
|
|
104
|
+
display: block;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.code-block .copy-button .check-icon {
|
|
108
|
+
display: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Copy button tooltip */
|
|
112
|
+
.code-block .copy-button::before,
|
|
113
|
+
.code-block .copy-button::after {
|
|
114
|
+
position: absolute;
|
|
115
|
+
top: 50%;
|
|
116
|
+
transform: translateY(-50%);
|
|
117
|
+
opacity: 0;
|
|
118
|
+
visibility: hidden;
|
|
119
|
+
pointer-events: none;
|
|
120
|
+
transition: opacity 0.2s ease, visibility 0s 0.2s ease;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.code-block .copy-button::before {
|
|
124
|
+
content: attr(data-tooltip);
|
|
125
|
+
right: calc(100% + 10px);
|
|
126
|
+
padding: 0.15em 0.5em;
|
|
127
|
+
border-radius: 2px;
|
|
128
|
+
background-color: var(--color-brand-alt);
|
|
129
|
+
color: var(--neutral-800);
|
|
130
|
+
font-size: 0.9em;
|
|
131
|
+
white-space: nowrap;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.code-block .copy-button::after {
|
|
135
|
+
content: '';
|
|
136
|
+
right: calc(100%);
|
|
137
|
+
border: 5px solid transparent;
|
|
138
|
+
border-left-color: var(--color-brand-alt);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.code-block .copy-button:hover::before,
|
|
142
|
+
.code-block .copy-button:hover::after,
|
|
143
|
+
.code-block .copy-button:focus::before,
|
|
144
|
+
.code-block .copy-button:focus::after,
|
|
145
|
+
.code-block .copy-button.copied::before,
|
|
146
|
+
.code-block .copy-button.copied::after,
|
|
147
|
+
.code-block .copy-button.error::before,
|
|
148
|
+
.code-block .copy-button.error::after {
|
|
149
|
+
opacity: 1;
|
|
150
|
+
visibility: visible;
|
|
151
|
+
transition: opacity 0.2s ease;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.code-block .copy-button.copied .copy-icon {
|
|
155
|
+
display: none;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.code-block .copy-button.copied .check-icon {
|
|
159
|
+
display: block;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.code-block .copy-button.error::before {
|
|
163
|
+
background-color: var(--red-500);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.code-block .copy-button.error::after {
|
|
167
|
+
border-left-color: var(--red-500);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* Frame styling */
|
|
171
|
+
.code-block.terminal-frame {
|
|
172
|
+
background-color: #1e1e1e;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.code-block.terminal-frame::before {
|
|
176
|
+
position: relative;
|
|
177
|
+
display: block;
|
|
178
|
+
content: '';
|
|
179
|
+
height: 1.6rem;
|
|
180
|
+
background-color: var(--neutral-800);
|
|
181
|
+
border-bottom: 1px solid var(--neutral-700);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.code-block.terminal-frame::after {
|
|
185
|
+
position: absolute;
|
|
186
|
+
top: 0.5rem;
|
|
187
|
+
left: 1rem;
|
|
188
|
+
width: 0.6rem;
|
|
189
|
+
height: 0.6rem;
|
|
190
|
+
content: '';
|
|
191
|
+
border-radius: 50%;
|
|
192
|
+
background-color: var(--neutral-600);
|
|
193
|
+
box-shadow: 1.25rem 0 0 var(--neutral-600), 2.5rem 0 0 var(--neutral-600);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* Line highlighting styles */
|
|
197
|
+
.code-block [data-highlighted-line],
|
|
198
|
+
.code-block .line.focused,
|
|
199
|
+
.code-block .line:has(.focus),
|
|
200
|
+
.code-block .line:has(.highlighted),
|
|
201
|
+
.code-block pre.has-focused .line.focused {
|
|
202
|
+
background-color: color-mix(in srgb, var(--neutral-000) 10%, transparent);
|
|
203
|
+
display: inline-block;
|
|
204
|
+
width: 100%;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.code-block [data-deleted-line],
|
|
208
|
+
.code-block .line.diff.remove,
|
|
209
|
+
.code-block .line:has(.diff.remove),
|
|
210
|
+
.code-block .line:has(.deleted),
|
|
211
|
+
.code-block .line:has(.diff-remove) {
|
|
212
|
+
background-color: color-mix(in srgb, var(--red-500) 30%, transparent);
|
|
213
|
+
text-decoration: line-through;
|
|
214
|
+
text-decoration-color: var(--neutral-400);
|
|
215
|
+
opacity: 0.7;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.code-block [data-inserted-line],
|
|
219
|
+
.code-block .line.diff.add,
|
|
220
|
+
.code-block .line:has(.diff.add),
|
|
221
|
+
.code-block .line:has(.inserted),
|
|
222
|
+
.code-block .line:has(.diff-add) {
|
|
223
|
+
background-color: color-mix(in srgb, var(--green-500) 30%, transparent);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/* Line numbers styling */
|
|
227
|
+
.code-block.with-line-numbers pre {
|
|
228
|
+
padding-left: var(--space-xl);
|
|
229
|
+
counter-reset: line;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.code-block.with-line-numbers code>span {
|
|
233
|
+
position: relative;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.code-block.with-line-numbers code>span::before {
|
|
237
|
+
position: absolute;
|
|
238
|
+
left: -2.5rem;
|
|
239
|
+
width: 2rem;
|
|
240
|
+
padding-right: var(--space-2xs);
|
|
241
|
+
border-right: 1px solid var(--neutral-700);
|
|
242
|
+
counter-increment: line;
|
|
243
|
+
content: counter(line);
|
|
244
|
+
user-select: none;
|
|
245
|
+
color: var(--neutral-500);
|
|
246
|
+
font-size: 0.9em;
|
|
247
|
+
line-height: 1.75;
|
|
248
|
+
text-align: right;
|
|
249
|
+
}
|
|
@@ -1,17 +1,132 @@
|
|
|
1
|
+
/* font-face: Text */
|
|
1
2
|
@font-face {
|
|
2
|
-
font-family:
|
|
3
|
-
src: url('../assets/fonts/
|
|
4
|
-
unicode-range: U+5, U+20, U+21, U+24, U+25, U+26, U+27, U+2B-2E, U+30-3A, U+3F, U+41-5A, U+61-7A, U+D7, U+2019, U+201C,
|
|
5
|
-
U+201D;
|
|
6
|
-
font-weight: 100 1000;
|
|
3
|
+
font-family: 'Instrument Sans';
|
|
4
|
+
src: url('../assets/fonts/instrument-sans/InstrumentSans[wdth,wght].woff2') format('woff2');
|
|
7
5
|
font-display: swap;
|
|
6
|
+
font-weight: 100 900;
|
|
7
|
+
unicode-range:
|
|
8
|
+
U+5, U+20, U+21, U+24, U+25, U+26, U+27, U+2B-2E, U+30-3A, U+3F, U+41-5A, U+61-7A, U+D7, U+2019,
|
|
9
|
+
U+201C, U+201D;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
@font-face {
|
|
11
|
-
font-family:
|
|
12
|
-
src: url('../assets/fonts/
|
|
13
|
-
unicode-range: U+5, U+20, U+21, U+24, U+25, U+26, U+27, U+2B-2E, U+30-3A, U+3F, U+41-5A, U+61-7A, U+D7, U+2019, U+201C,
|
|
14
|
-
U+201D;
|
|
15
|
-
font-weight: 200 900;
|
|
13
|
+
font-family: 'Instrument Sans';
|
|
14
|
+
src: url('../assets/fonts/instrument-sans/InstrumentSans-Italic[wdth,wght].woff2') format('woff2');
|
|
16
15
|
font-display: swap;
|
|
16
|
+
font-style: italic;
|
|
17
|
+
font-weight: 100 900;
|
|
18
|
+
unicode-range:
|
|
19
|
+
U+5, U+20, U+21, U+24, U+25, U+26, U+27, U+2B-2E, U+30-3A, U+3F, U+41-5A, U+61-7A, U+D7, U+2019,
|
|
20
|
+
U+201C, U+201D;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* font-face: Display */
|
|
24
|
+
@font-face {
|
|
25
|
+
font-family: 'Figtree';
|
|
26
|
+
src: url('../assets/fonts/figtree/Figtree-Variable.woff2') format('woff2');
|
|
27
|
+
font-display: swap;
|
|
28
|
+
font-weight: 100 900;
|
|
29
|
+
unicode-range:
|
|
30
|
+
U+5, U+20, U+21, U+24, U+25, U+26, U+27, U+2B-2E, U+30-3A, U+3F, U+41-5A, U+61-7A, U+D7, U+2019,
|
|
31
|
+
U+201C, U+201D;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* font-face: Monospace */
|
|
35
|
+
@font-face {
|
|
36
|
+
font-family: 'Martian Mono';
|
|
37
|
+
src: url('../assets/fonts/martian-mono/MartianMono-Regular.woff2') format('woff2');
|
|
38
|
+
font-weight: 400;
|
|
39
|
+
font-display: swap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@font-face {
|
|
43
|
+
font-family: 'Martian Mono';
|
|
44
|
+
src: url('../assets/fonts/martian-mono/MartianMono-Medium.woff2') format('woff2');
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
font-display: swap;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@font-face {
|
|
50
|
+
font-family: 'Martian Mono';
|
|
51
|
+
src: url('../assets/fonts/martian-mono/MartianMono-SemiBold.woff2') format('woff2');
|
|
52
|
+
font-weight: 600;
|
|
53
|
+
font-display: swap;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@font-face {
|
|
57
|
+
font-family: 'Martian Mono';
|
|
58
|
+
src: url('../assets/fonts/martian-mono/MartianMono-Bold.woff2') format('woff2');
|
|
59
|
+
font-weight: 700;
|
|
60
|
+
font-display: swap;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Text */
|
|
64
|
+
body {
|
|
65
|
+
font-family: var(--font-family-text);
|
|
66
|
+
font-size: var(--font-size-text-lg);
|
|
67
|
+
font-weight: var(--font-weight-normal);
|
|
68
|
+
line-height: var(--line-height-text);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
b,
|
|
72
|
+
strong {
|
|
73
|
+
font-weight: var(--font-weight-bold);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
i,
|
|
77
|
+
em {
|
|
78
|
+
font-style: italic;
|
|
79
|
+
font-weight: var(--font-weight-normal);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Headings */
|
|
83
|
+
h1,
|
|
84
|
+
.h1 {
|
|
85
|
+
font-family: var(--font-family-display);
|
|
86
|
+
font-size: var(--font-size-display-2xl);
|
|
87
|
+
font-weight: var(--font-weight-extrabold);
|
|
88
|
+
line-height: var(--line-height-heading);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
h2,
|
|
92
|
+
.h2 {
|
|
93
|
+
font-family: var(--font-family-display);
|
|
94
|
+
font-size: var(--font-size-display-xl);
|
|
95
|
+
font-weight: var(--font-weight-extrabold);
|
|
96
|
+
line-height: var(--line-height-heading);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
h3,
|
|
100
|
+
.h3 {
|
|
101
|
+
font-family: var(--font-family-display);
|
|
102
|
+
font-size: var(--font-size-display-lg);
|
|
103
|
+
font-weight: var(--font-weight-bold);
|
|
104
|
+
line-height: var(--line-height-heading);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
h4,
|
|
108
|
+
.h4 {
|
|
109
|
+
font-family: var(--font-family-display);
|
|
110
|
+
font-size: var(--font-size-display-sm);
|
|
111
|
+
font-weight: var(--font-weight-bold);
|
|
112
|
+
line-height: var(--line-height-heading);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* Lists */
|
|
116
|
+
li::marker {
|
|
117
|
+
color: var(--color-brand);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
ol li::marker {
|
|
121
|
+
font-weight: var(--font-weight-bold);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Code */
|
|
125
|
+
pre,
|
|
126
|
+
code,
|
|
127
|
+
kbd {
|
|
128
|
+
font-family: var(--font-family-monospace);
|
|
129
|
+
font-size: var(--font-size-text-md);
|
|
130
|
+
font-weight: var(--font-weight-normal);
|
|
131
|
+
line-height: var(--line-height-text);
|
|
17
132
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
*,
|
|
2
|
+
*::before,
|
|
3
|
+
*::after {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
body,
|
|
8
|
+
h1,
|
|
9
|
+
h2,
|
|
10
|
+
h3,
|
|
11
|
+
h4,
|
|
12
|
+
h5,
|
|
13
|
+
p,
|
|
14
|
+
figure,
|
|
15
|
+
blockquote,
|
|
16
|
+
dl,
|
|
17
|
+
dd,
|
|
18
|
+
ul,
|
|
19
|
+
ol,
|
|
20
|
+
pre,
|
|
21
|
+
code {
|
|
22
|
+
margin: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:where(p, h1, h2, h3, h4, h5, h6) {
|
|
26
|
+
overflow-wrap: break-word;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:where(ul, ol) {
|
|
30
|
+
padding-inline-start: 1em;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:where(ul[role='list'], ol[role='list'], ul[class], ol[class]) {
|
|
34
|
+
list-style: none;
|
|
35
|
+
padding-inline-start: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
39
|
+
html:focus-within {
|
|
40
|
+
scroll-behavior: smooth;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
html {
|
|
45
|
+
/* Prevent font size inflation */
|
|
46
|
+
-moz-text-size-adjust: none;
|
|
47
|
+
-webkit-text-size-adjust: none;
|
|
48
|
+
text-size-adjust: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
body {
|
|
52
|
+
line-height: 1.5;
|
|
53
|
+
min-height: 100vh;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
a {
|
|
57
|
+
color: currentcolor;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
a:not([class]) {
|
|
61
|
+
text-decoration-skip-ink: auto;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
picture,
|
|
65
|
+
img,
|
|
66
|
+
video,
|
|
67
|
+
iframe,
|
|
68
|
+
object {
|
|
69
|
+
display: block;
|
|
70
|
+
max-inline-size: 100%;
|
|
71
|
+
block-size: auto;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
input,
|
|
75
|
+
button,
|
|
76
|
+
textarea,
|
|
77
|
+
select {
|
|
78
|
+
font: inherit;
|
|
79
|
+
}
|
|
@@ -37,15 +37,29 @@
|
|
|
37
37
|
--color-warning-bg: var(--gold-100);
|
|
38
38
|
--color-warning-border: var(--gold-300);
|
|
39
39
|
--color-warning-text: var(--gold-800);
|
|
40
|
-
--font-
|
|
41
|
-
--font-
|
|
42
|
-
--font-
|
|
43
|
-
--font-
|
|
44
|
-
--font-
|
|
45
|
-
--font-
|
|
46
|
-
--font-
|
|
47
|
-
--font-
|
|
48
|
-
--font-
|
|
40
|
+
--font-family-display: "Figtree", system-ui, "Helvetica", sans-serif;
|
|
41
|
+
--font-family-monospace: "Martian Mono", ui-monospace, "Cascadia Code", "Source Code Pro", "Menlo", "Consolas", "DejaVu Sans Mono", monospace;
|
|
42
|
+
--font-family-text: "Instrument Sans", system-ui, "Helvetica", sans-serif;
|
|
43
|
+
--font-size-display-2xl: 4rem;
|
|
44
|
+
--font-size-display-2xs: 1.125rem;
|
|
45
|
+
--font-size-display-3xl: 4.5rem;
|
|
46
|
+
--font-size-display-4xl: 5rem;
|
|
47
|
+
--font-size-display-lg: 3rem;
|
|
48
|
+
--font-size-display-md: 2.5rem;
|
|
49
|
+
--font-size-display-sm: 2rem;
|
|
50
|
+
--font-size-display-xl: 3.5rem;
|
|
51
|
+
--font-size-display-xs: 1.5rem;
|
|
52
|
+
--font-size-text-lg: 1.125rem;
|
|
53
|
+
--font-size-text-md: 1rem;
|
|
54
|
+
--font-size-text-sm: 0.875rem;
|
|
55
|
+
--font-size-text-xl: 1.375rem;
|
|
56
|
+
--font-size-text-xs: 0.75rem;
|
|
57
|
+
--font-weight-bold: 700;
|
|
58
|
+
--font-weight-light: 200;
|
|
59
|
+
--font-weight-medium: 500;
|
|
60
|
+
--font-weight-regular: 400;
|
|
61
|
+
--font-weight-semibold: 600;
|
|
62
|
+
--font-weight-semilight: 300;
|
|
49
63
|
--gold-000: color(srgb 0.9921568627450981 0.9607843137254902 0.8470588235294118);
|
|
50
64
|
--gold-100: color(srgb 0.9647058823529412 0.8784313725490196 0.6470588235294118);
|
|
51
65
|
--gold-200: color(srgb 0.9803921568627451 0.803921568627451 0.43529411764705883);
|
|
@@ -68,7 +82,7 @@
|
|
|
68
82
|
--green-900: color(srgb 0.08235294117647059 0.16470588235294117 0.09803921568627451);
|
|
69
83
|
--line-height-heading: 1.2;
|
|
70
84
|
--line-height-none: 1;
|
|
71
|
-
--line-height-
|
|
85
|
+
--line-height-text: 1.5;
|
|
72
86
|
--neutral-000: color(srgb 1 1 1);
|
|
73
87
|
--neutral-100: color(srgb 0.9647058823529412 0.9647058823529412 0.9686274509803922);
|
|
74
88
|
--neutral-200: color(srgb 0.9137254901960784 0.9215686274509803 0.9294117647058824);
|
|
@@ -133,15 +147,6 @@
|
|
|
133
147
|
--teal-700: color(srgb 0.00392156862745098 0.4117647058823529 0.40784313725490196);
|
|
134
148
|
--teal-800: color(srgb 0.00392156862745098 0.2823529411764706 0.2784313725490196);
|
|
135
149
|
--teal-900: color(srgb 0.047058823529411764 0.16470588235294117 0.16470588235294117);
|
|
136
|
-
--text-2xl: 1.74rem;
|
|
137
|
-
--text-3xl: 2.3rem;
|
|
138
|
-
--text-4xl: 3.04rem;
|
|
139
|
-
--text-5xl: 4.01rem;
|
|
140
|
-
--text-base: 1rem;
|
|
141
|
-
--text-lg: 1.125rem;
|
|
142
|
-
--text-sm: 0.875rem;
|
|
143
|
-
--text-xl: 1.32rem;
|
|
144
|
-
--text-xs: 0.8125rem;
|
|
145
150
|
}
|
|
146
151
|
|
|
147
152
|
@media (prefers-color-scheme: light) {
|