@naiheyoung/use 0.0.1 → 0.0.4

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.
@@ -0,0 +1,54 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ id-token: write
11
+ contents: read
12
+
13
+ jobs:
14
+ check-version:
15
+ runs-on: ubuntu-latest
16
+ outputs:
17
+ is_version: ${{ steps.check.outputs.is_version }}
18
+ steps:
19
+ - name: Check commit message
20
+ id: check
21
+ run: |
22
+ COMMIT_MSG="${{ github.event.head_commit.message }}"
23
+ echo "Commit message: $COMMIT_MSG"
24
+
25
+ if echo "$COMMIT_MSG" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'; then
26
+ echo "is_version=true" >> "$GITHUB_OUTPUT"
27
+ else
28
+ echo "is_version=false" >> "$GITHUB_OUTPUT"
29
+ fi
30
+
31
+ publish:
32
+ needs: check-version
33
+ if: needs.check-version.outputs.is_version == 'true'
34
+ runs-on: ubuntu-latest
35
+
36
+ steps:
37
+ - uses: actions/checkout@v6
38
+
39
+ - uses: pnpm/action-setup@v4
40
+
41
+ - uses: actions/setup-node@v5
42
+ with:
43
+ node-version: lts/*
44
+ cache: pnpm
45
+ registry-url: 'https://registry.npmjs.org'
46
+
47
+ - name: Install
48
+ run: pnpm i --frozen-lockfile
49
+
50
+ - name: Build
51
+ run: pnpm build
52
+
53
+ - name: Publish
54
+ run: pnpm publish --provenance --access public
@@ -1,386 +1,487 @@
1
- /* Powered by @naiheyoung/use. 奈何*/
2
- @import '@naiheyoung/color';
3
-
4
- /* dm-mono-latin-400-normal */
5
- @font-face {
6
- font-family: 'DM Mono';
7
- font-style: normal;
8
- font-display: swap;
9
- font-weight: 400;
10
- src:
11
- url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-400-normal.woff2)
12
- format('woff2'),
13
- url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-400-normal.woff)
14
- format('woff');
15
- unicode-range:
16
- U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
17
- U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
18
- }
19
-
20
- /* dm-mono-latin-500-normal */
21
- @font-face {
22
- font-family: 'DM Mono';
23
- font-style: normal;
24
- font-display: swap;
25
- font-weight: 500;
26
- src:
27
- url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-500-normal.woff2)
28
- format('woff2'),
29
- url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-500-normal.woff)
30
- format('woff');
31
- unicode-range:
32
- U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
33
- U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
34
- }
35
-
36
- /* dm-sans-latin-wght-normal */
37
- @font-face {
38
- font-family: 'DM Sans Variable';
39
- font-style: normal;
40
- font-display: swap;
41
- font-weight: 100 1000;
42
- src: url(https://cdn.jsdelivr.net/fontsource/fonts/dm-sans:vf@latest/latin-wght-normal.woff2)
43
- format('woff2-variations');
44
- unicode-range:
45
- U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
46
- U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
47
- }
48
-
49
- /* jetbrains-mono-latin-wght-normal */
50
- @font-face {
51
- font-family: 'JetBrains Mono Variable';
52
- font-style: normal;
53
- font-display: swap;
54
- font-weight: 100 800;
55
- src: url(https://cdn.jsdelivr.net/fontsource/fonts/jetbrains-mono:vf@latest/latin-wght-normal.woff2)
56
- format('woff2-variations');
57
- unicode-range:
58
- U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
59
- U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
60
- }
61
-
62
- :root,
63
- :host {
64
- --font-mono: 'DM Mono', monospace;
65
- --font-sans: 'DM Sans Variable', monospace;
66
- --font-code: 'JetBrains Mono Variable', monospace;
67
- }
68
-
69
- :root {
70
- --shiki-dark-bg-0: #151515;
71
- --prose-padding-block: 12px;
72
- --prose-padding-inline: 1.5rem;
73
- --prose-radius: 0.5rem;
74
- --prose-diff-add-color: #3dd68c;
75
- --prose-diff-remove-color: #cb7676;
76
- --prose-highlighted-bg-color: rgba(101, 117, 133, 0.16);
77
- --prose-highlighted-word-color: #e6a817;
78
- --prose-focused-opacity: 0.7;
79
- --prose-focused-blur: 0.095rem;
80
- --prose-li-fg: var(--colors-pink-rgb);
81
- }
82
-
83
- .prose h1 {
84
- font-weight: 800;
85
- font-size: 2.25em;
86
- margin-top: 0;
87
- margin-bottom: 0.8888889em;
88
- line-height: 1.1111111;
89
- }
90
-
91
- .prose h2 {
92
- font-weight: 700;
93
- font-size: 1.5em;
94
- margin-top: 2em;
95
- margin-bottom: 1em;
96
- line-height: 1.3333333;
97
- }
98
-
99
- .prose h3 {
100
- color: inherit;
101
- font-weight: 600;
102
- font-size: 1.25em;
103
- margin-top: 1.6em;
104
- margin-bottom: 0.6em;
105
- line-height: 1.6;
106
- opacity: 0.7;
107
- }
108
-
109
- .prose h4 {
110
- color: inherit;
111
- font-weight: 600;
112
- margin-top: 1.5em;
113
- margin-bottom: 0.5em;
114
- line-height: 1.5;
115
- }
116
-
117
- html.dark .prose .has-diff span.diff::before {
118
- position: absolute;
119
- left: calc(var(--prose-padding-inline) / 3);
120
- transition: color 0.35s;
121
- }
122
-
123
- html.dark .prose .has-diff span.diff.add::before {
124
- content: '+';
125
- color: var(--prose-diff-add-color);
126
- }
127
-
128
- html.dark .prose .has-diff span.diff.remove {
129
- opacity: 0.85;
130
-
131
- &::before {
132
- content: '-';
133
- color: var(--prose-diff-remove-color);
134
- }
135
- }
136
-
137
- html.dark .prose .has-highlighted span.highlighted {
138
- background-color: var(--prose-highlighted-bg-color);
139
- transition: background-color 0.35s;
140
- width: calc(100% + (var(--prose-padding-inline) * 2));
141
- display: inline-block;
142
- margin-inline: -1.5rem;
143
- padding-inline: var(--prose-padding-inline);
144
- }
145
-
146
- html.dark .prose .shiki span.highlighted-word {
147
- padding: 1px 3px;
148
- margin: -1px -3px;
149
- border-radius: 3px;
150
- text-decoration: var(--prose-highlighted-word-color) underline;
151
- }
152
-
153
- html.dark .prose .has-focused .line:not(.focused) {
154
- opacity: var(--prose-focused-opacity);
155
- filter: blur(var(--prose-focused-blur));
156
- transition:
157
- opacity 0.35s,
158
- filter 0.35s;
159
- }
160
-
161
- html.dark .prose .has-focused:hover .line:not(.focused) {
162
- opacity: 1;
163
- filter: blur(0);
164
- }
165
-
166
- .prose hr {
167
- height: 1rem;
168
- }
169
-
170
- .prose mark,
171
- .prose code:not(.shiki code) {
172
- background-color: #fe5a1d;
173
- border-radius: 3px;
174
- padding: 1px 3px;
175
- font-size: 0.875rem;
176
- font-weight: 500;
177
- color: marktext;
178
- }
179
-
180
- .prose blockquote {
181
- position: relative;
182
- font-weight: 500;
183
- font-style: italic;
184
- color: inherit;
185
- margin-block: 1.6em;
186
- padding-left: 1em;
187
- padding-block: 0.5em;
188
-
189
- &::before {
190
- position: absolute;
191
- content: '';
192
- width: 0.25rem;
193
- background-color: rgba(125, 125, 125, 0.3);
194
- top: 0.6rem;
195
- bottom: 0.4rem;
196
- border-radius: 3px;
197
- left: 0;
198
- }
199
- }
200
-
201
- .prose > p,
202
- .markdown-alert > p {
203
- margin-block: 1.25em;
204
- }
205
-
206
- .prose .markdown-magic-link {
207
- display: flex;
208
- gap: 3px;
209
- font-size: 0.875rem;
210
- color: rgba(0, 0, 0, 0.55);
211
- align-items: center;
212
-
213
- &.markdown-magic-link-github-at {
214
- background-color: rgba(0, 0, 0, 0.1);
215
- border-radius: 1.5em;
216
- width: fit-content;
217
- padding-right: 0.6em;
218
- transition: background-color 0.35s;
219
-
220
- &:hover {
221
- background-color: rgba(0, 0, 0, 0.15);
222
- }
223
- }
224
-
225
- & .markdown-magic-link-image {
226
- display: inline-block;
227
- width: 1.5em;
228
- height: 1.5em;
229
- background-size: cover;
230
- background-repeat: no-repeat;
231
- background-position: center;
232
- border-radius: 50%;
233
- }
234
- }
235
-
236
- html.dark .prose .markdown-magic-link {
237
- color: rgba(255, 255, 255, 0.55);
238
-
239
- &.markdown-magic-link-github-at {
240
- background-color: rgba(255, 255, 255, 0.1);
241
-
242
- &:hover {
243
- background-color: rgba(255, 255, 255, 0.15);
244
- }
245
- }
246
- }
247
-
248
- .prose ul {
249
- padding: 1rem;
250
-
251
- > li {
252
- position: relative;
253
- padding-inline: 2rem;
254
- padding-bottom: 1.5rem;
255
- font-size: 1.25rem;
256
-
257
- &::before {
258
- position: absolute;
259
- content: '';
260
- width: 0.625rem;
261
- height: 0.625rem;
262
- left: 0;
263
- top: 0.7rem;
264
- border-radius: 50%;
265
- background: rgb(var(--prose-li-fg));
266
- box-shadow: 0 0 0 0.25rem rgb(var(--prose-li-fg) / 0.3);
267
- animation: living 2s infinite;
268
- animation-delay: calc(0.2s * var(--living-delay));
269
- }
270
- &::after {
271
- position: absolute;
272
- content: '';
273
- width: 1px;
274
- height: 100%;
275
- background-color: #a3a3a31a;
276
- left: 0.3125rem;
277
- top: 0.925rem;
278
- z-index: -1;
279
- }
280
- }
281
-
282
- > li:last-child::after {
283
- height: 0;
284
- }
285
- }
286
-
287
- @keyframes living {
288
- 0% {
289
- box-shadow: 0 0 0 0.25rem rgb(var(--prose-li-fg) / 0.3);
290
- }
291
- 50% {
292
- box-shadow: 0 0 0 0.35rem rgb(var(--prose-li-fg) / 0.3);
293
- }
294
- 100% {
295
- box-shadow: 0 0 0 0.25rem rgb(var(--prose-li-fg) / 0.3);
296
- }
297
- }
298
-
299
- .prose ul > li:nth-child(1) {
300
- --living-delay: 0;
301
- }
302
- .prose ul > li:nth-child(2) {
303
- --living-delay: 1;
304
- }
305
- .prose ul > li:nth-child(3) {
306
- --living-delay: 2;
307
- }
308
- .prose ul > li:nth-child(4) {
309
- --living-delay: 3;
310
- }
311
- .prose ul > li:nth-child(5) {
312
- --living-delay: 4;
313
- }
314
-
315
- .prose p > a:not(:has(img, picture, figure, figcaption)) {
316
- position: relative;
317
-
318
- &::after {
319
- position: absolute;
320
- content: '';
321
- width: 0;
322
- height: 3px;
323
- background-color: rgb(var(--colors-d-rgb) / 0.47);
324
- border-radius: var(--spacing);
325
- bottom: -2px;
326
- left: 50%;
327
- transform: translateX(-50%);
328
- transition: width 0.25s;
329
- }
330
- &:hover::after {
331
- width: 95%;
332
- }
333
- }
334
-
335
- .prose p > a.prose-link {
336
- position: relative;
337
-
338
- & [type='detail'] {
339
- color: rgb(var(--colors-nord13-rgb) / 0.37);
340
- > svg {
341
- display: inline;
342
- color: rgb(var(--colors-nord13-rgb) / 0.9);
343
- margin-right: 0.0875em;
344
- }
345
- }
346
- & [type='repo'] {
347
- color: rgb(var(--colors-yellow-rgb) / 0.67);
348
- > svg {
349
- display: inline;
350
- color: rgb(var(--colors-yellow-rgb) / 0.9);
351
- margin-right: 0.0875em;
352
- }
353
- }
354
- & [type='user'] {
355
- color: rgb(var(--colors-pink-rgb) / 0.87);
356
- > svg {
357
- display: inline;
358
- color: rgb(var(--colors-pink-rgb) / 0.9);
359
- margin-right: 0.0875em;
360
- }
361
- }
362
- &:has([type='user'])::after {
363
- background: linear-gradient(-90deg, rgb(var(--colors-pink-rgb) / 0.87), transparent);
364
- }
365
- &:has([type='repo'])::after {
366
- background: linear-gradient(
367
- -90deg,
368
- rgb(var(--colors-pink-rgb) / 0.87),
369
- rgb(var(--colors-yellow-rgb) / 0.67)
370
- );
371
- }
372
- &:has([type='detail'])::after {
373
- background: linear-gradient(
374
- -90deg,
375
- rgb(var(--colors-yellow-rgb) / 0.67),
376
- rgb(var(--colors-nord13-rgb) / 0.37)
377
- );
378
- }
379
- }
380
-
381
- .prose p > a.prose-link > span > svg {
382
- display: inline;
383
- margin-right: 0.0875em;
384
- width: 1em;
385
- height: 1em;
386
- }
1
+ /* Powered by @naiheyoung/use. 奈何*/
2
+ @import '@naiheyoung/color';
3
+
4
+ /* dm-mono-latin-400-normal */
5
+ @font-face {
6
+ font-family: 'DM Mono';
7
+ font-style: normal;
8
+ font-display: swap;
9
+ font-weight: 400;
10
+ src:
11
+ url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-400-normal.woff2)
12
+ format('woff2'),
13
+ url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-400-normal.woff)
14
+ format('woff');
15
+ unicode-range:
16
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
17
+ U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
18
+ }
19
+
20
+ /* dm-mono-latin-500-normal */
21
+ @font-face {
22
+ font-family: 'DM Mono';
23
+ font-style: normal;
24
+ font-display: swap;
25
+ font-weight: 500;
26
+ src:
27
+ url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-500-normal.woff2)
28
+ format('woff2'),
29
+ url(https://cdn.jsdelivr.net/fontsource/fonts/dm-mono@latest/latin-500-normal.woff)
30
+ format('woff');
31
+ unicode-range:
32
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
33
+ U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
34
+ }
35
+
36
+ /* dm-sans-latin-wght-normal */
37
+ @font-face {
38
+ font-family: 'DM Sans Variable';
39
+ font-style: normal;
40
+ font-display: swap;
41
+ font-weight: 100 1000;
42
+ src: url(https://cdn.jsdelivr.net/fontsource/fonts/dm-sans:vf@latest/latin-wght-normal.woff2)
43
+ format('woff2-variations');
44
+ unicode-range:
45
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
46
+ U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
47
+ }
48
+
49
+ /* jetbrains-mono-latin-wght-normal */
50
+ @font-face {
51
+ font-family: 'JetBrains Mono Variable';
52
+ font-style: normal;
53
+ font-display: swap;
54
+ font-weight: 100 800;
55
+ src: url(https://cdn.jsdelivr.net/fontsource/fonts/jetbrains-mono:vf@latest/latin-wght-normal.woff2)
56
+ format('woff2-variations');
57
+ unicode-range:
58
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
59
+ U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
60
+ }
61
+
62
+ :root,
63
+ :host {
64
+ --font-mono: 'DM Mono', monospace;
65
+ --font-sans: 'DM Sans Variable', monospace;
66
+ --font-code: 'JetBrains Mono Variable', monospace;
67
+ }
68
+
69
+ :root {
70
+ --shiki-dark-bg-0: #151515;
71
+ --prose-pre-padding-block: 12px;
72
+ --prose-pre-code-padding-inline: 1.5rem;
73
+ --prose-pre-radius: 0.5rem;
74
+ --prose-diff-add-color: #3dd68c;
75
+ --prose-diff-add-bg-color: rgb(61 214 140 / 0.18);
76
+ --prose-diff-remove-color: #cb7676;
77
+ --prose-diff-remove-bg-color: rgb(203 118 118 / 0.18);
78
+ --prose-highlighted-bg-color: rgb(136 136 136 / 0.13);
79
+ --prose-l-highlighted-word-color: #ff8282;
80
+ --prose-highlighted-word-color: #e6a817;
81
+ --prose-focused-opacity: 0.7;
82
+ --prose-focused-blur: 0.095rem;
83
+ --prose-li-fg: var(--colors-pink-rgb);
84
+ --prose-hr-block: 1.5rem;
85
+ --prose-hr-fg: rgb(var(--colors-d-rgb) / 0.65);
86
+ }
87
+
88
+ .prose h1 {
89
+ font-weight: 800;
90
+ font-size: 2.25em;
91
+ margin-top: 0;
92
+ margin-bottom: 0.8888889em;
93
+ line-height: 1.1111111;
94
+ }
95
+
96
+ .prose h2 {
97
+ font-weight: 700;
98
+ font-size: 1.5em;
99
+ margin-top: 2em;
100
+ margin-bottom: 1em;
101
+ line-height: 1.3333333;
102
+ }
103
+
104
+ .prose h3 {
105
+ color: inherit;
106
+ font-weight: 600;
107
+ font-size: 1.25em;
108
+ margin-top: 1.6em;
109
+ margin-bottom: 0.6em;
110
+ line-height: 1.6;
111
+ opacity: 0.7;
112
+ }
113
+
114
+ .prose h4 {
115
+ color: inherit;
116
+ font-weight: 600;
117
+ margin-top: 1.5em;
118
+ margin-bottom: 0.5em;
119
+ line-height: 1.5;
120
+ }
121
+
122
+ html.dark .prose .shiki {
123
+ color: var(--shiki-dark);
124
+ background-color: var(--shiki-dark-bg-0);
125
+
126
+ & span {
127
+ color: var(--shiki-dark);
128
+ }
129
+ }
130
+
131
+ html .prose .shiki {
132
+ color: var(--shiki-light);
133
+ background-color: var(--shiki-light-bg);
134
+ border-radius: var(--prose-pre-radius);
135
+
136
+ & span {
137
+ color: var(--shiki-light);
138
+ }
139
+ }
140
+
141
+ .prose .shiki {
142
+ position: relative;
143
+ padding-block: var(--prose-pre-padding-block);
144
+ margin-block: 0.5rem;
145
+
146
+ > code {
147
+ display: block;
148
+ line-height: 1.7;
149
+ padding-inline: var(--prose-pre-code-padding-inline);
150
+ }
151
+ }
152
+
153
+ .prose .has-diff span.diff {
154
+ width: calc(100% + (var(--prose-pre-code-padding-inline) * 2));
155
+ display: inline-block;
156
+ margin-inline: calc(-1 * var(--prose-pre-code-padding-inline));
157
+ padding-inline: var(--prose-pre-code-padding-inline);
158
+
159
+ &::before {
160
+ position: absolute;
161
+ left: calc(var(--prose-pre-code-padding-inline) / 3);
162
+ transition: color 0.35s;
163
+ }
164
+ }
165
+
166
+ html.dark .prose .has-diff span.diff {
167
+ background: unset;
168
+ }
169
+
170
+ .prose .has-diff span.diff.add {
171
+ background-color: var(--prose-diff-add-bg-color);
172
+
173
+ &::before {
174
+ content: '+';
175
+ color: var(--prose-diff-add-color);
176
+ }
177
+ }
178
+
179
+ .prose .has-diff span.diff.remove {
180
+ opacity: 0.75;
181
+ background-color: var(--prose-diff-remove-bg-color);
182
+
183
+ &::before {
184
+ content: '-';
185
+ color: var(--prose-diff-remove-color);
186
+ }
187
+ }
188
+
189
+ html.dark .prose .has-diff span.diff.remove {
190
+ opacity: 0.85;
191
+ }
192
+
193
+ .prose .has-highlighted span.highlighted,
194
+ .prose span.highlighted {
195
+ background-color: var(--prose-highlighted-bg-color);
196
+ transition: background-color 0.35s;
197
+ width: calc(100% + (var(--prose-pre-code-padding-inline) * 2));
198
+ display: inline-block;
199
+ margin-inline: calc(-1 * var(--prose-pre-code-padding-inline));
200
+ padding-inline: var(--prose-pre-code-padding-inline);
201
+ }
202
+
203
+ .prose .shiki span.highlighted-word {
204
+ padding: 1px 3px;
205
+ margin: -1px -3px;
206
+ border-radius: 3px;
207
+ text-decoration: var(--prose-l-highlighted-word-color) underline;
208
+ }
209
+
210
+ html.dark .prose .shiki span.highlighted-word {
211
+ text-decoration: var(--prose-highlighted-word-color) underline;
212
+ }
213
+
214
+ .prose .has-focused .line:not(.focused) {
215
+ opacity: var(--prose-focused-opacity);
216
+ filter: blur(var(--prose-focused-blur));
217
+ transition:
218
+ opacity 0.35s,
219
+ filter 0.35s;
220
+ }
221
+
222
+ .prose .has-focused:hover .line:not(.focused) {
223
+ opacity: 1;
224
+ filter: blur(0);
225
+ }
226
+
227
+ .prose hr {
228
+ margin-block: var(--prose-hr-block);
229
+ color: var(--prose-hr-fg);
230
+ }
231
+
232
+ .prose mark,
233
+ .prose code:not(.shiki code) {
234
+ background-color: #fe5a1d;
235
+ border-radius: 3px;
236
+ padding: 1px 3px;
237
+ font-size: 0.875rem;
238
+ font-weight: 500;
239
+ color: marktext;
240
+ }
241
+
242
+ .prose blockquote {
243
+ position: relative;
244
+ font-weight: 500;
245
+ font-style: italic;
246
+ color: inherit;
247
+ margin-block: 1.6em;
248
+ padding-left: 1em;
249
+ padding-block: 0.5em;
250
+
251
+ &::before {
252
+ position: absolute;
253
+ content: '';
254
+ width: 0.25rem;
255
+ background-color: rgb(125 125 125 / 0.3);
256
+ top: 0.6rem;
257
+ bottom: 0.4rem;
258
+ border-radius: 3px;
259
+ left: 0;
260
+ }
261
+ }
262
+
263
+ .prose > p,
264
+ .markdown-alert > p {
265
+ margin-block: 1.25em;
266
+ }
267
+
268
+ .prose .markdown-magic-link {
269
+ display: flex;
270
+ gap: 3px;
271
+ font-size: 0.875rem;
272
+ color: rgb(0 0 0 / 0.55);
273
+ align-items: center;
274
+
275
+ &.markdown-magic-link-github-at {
276
+ background-color: rgb(0 0 0 / 0.1);
277
+ border-radius: 1.5em;
278
+ width: fit-content;
279
+ padding-right: 0.6em;
280
+ transition: background-color 0.35s;
281
+
282
+ &:hover {
283
+ background-color: rgb(0 0 0 / 0.15);
284
+ }
285
+ }
286
+
287
+ & .markdown-magic-link-image {
288
+ display: inline-block;
289
+ width: 1.5em;
290
+ height: 1.5em;
291
+ background-size: cover;
292
+ background-repeat: no-repeat;
293
+ background-position: center;
294
+ border-radius: 50%;
295
+ }
296
+ }
297
+
298
+ html.dark .prose .markdown-magic-link {
299
+ color: rgb(255 255 255 / 0.55);
300
+
301
+ &.markdown-magic-link-github-at {
302
+ background-color: rgb(255 255 255 / 0.1);
303
+
304
+ &:hover {
305
+ background-color: rgb(255 255 255 / 0.15);
306
+ }
307
+ }
308
+ }
309
+
310
+ .prose ul {
311
+ padding: 1rem;
312
+
313
+ > li {
314
+ position: relative;
315
+ padding-inline: 2rem;
316
+ padding-bottom: 1.5rem;
317
+ font-size: 1.25rem;
318
+
319
+ &::before {
320
+ position: absolute;
321
+ content: '';
322
+ width: 0.625rem;
323
+ height: 0.625rem;
324
+ left: 0;
325
+ top: 0.7rem;
326
+ border-radius: 50%;
327
+ background: rgb(var(--prose-li-fg));
328
+ box-shadow: 0 0 0 0.25rem rgb(var(--prose-li-fg) / 0.3);
329
+ animation: living 2s infinite;
330
+ animation-delay: calc(0.2s * var(--living-delay));
331
+ }
332
+ &::after {
333
+ position: absolute;
334
+ content: '';
335
+ width: 1px;
336
+ height: 100%;
337
+ background-color: #a3a3a31a;
338
+ left: 0.3125rem;
339
+ top: 0.925rem;
340
+ z-index: -1;
341
+ }
342
+ }
343
+
344
+ > li:last-child::after {
345
+ height: 0;
346
+ }
347
+ }
348
+
349
+ .prose ol {
350
+ padding: 1rem;
351
+ counter-reset: orderedCounter;
352
+
353
+ > li {
354
+ position: relative;
355
+ counter-increment: orderedCounter;
356
+ position: relative;
357
+ padding-inline: 2.5rem;
358
+ padding-bottom: 1.5rem;
359
+ font-size: 1.25rem;
360
+
361
+ &::before {
362
+ position: absolute;
363
+ content: counter(orderedCounter, decimal-leading-zero) '.';
364
+ left: -3px;
365
+ }
366
+
367
+ & li:last-child {
368
+ padding-bottom: unset;
369
+ }
370
+ }
371
+ }
372
+
373
+ @keyframes living {
374
+ 0% {
375
+ box-shadow: 0 0 0 0.25rem rgb(var(--prose-li-fg) / 0.3);
376
+ }
377
+ 50% {
378
+ box-shadow: 0 0 0 0.35rem rgb(var(--prose-li-fg) / 0.3);
379
+ }
380
+ 100% {
381
+ box-shadow: 0 0 0 0.25rem rgb(var(--prose-li-fg) / 0.3);
382
+ }
383
+ }
384
+
385
+ .prose ul > li:nth-child(1) {
386
+ --living-delay: 0;
387
+ }
388
+ .prose ul > li:nth-child(2) {
389
+ --living-delay: 1;
390
+ }
391
+ .prose ul > li:nth-child(3) {
392
+ --living-delay: 2;
393
+ }
394
+ .prose ul > li:nth-child(4) {
395
+ --living-delay: 3;
396
+ }
397
+ .prose ul > li:nth-child(5) {
398
+ --living-delay: 4;
399
+ }
400
+
401
+ .prose p > a:not(:has(img, picture, figure, figcaption)) {
402
+ position: relative;
403
+
404
+ &::after {
405
+ position: absolute;
406
+ content: '';
407
+ width: 0;
408
+ height: 3px;
409
+ background-color: rgb(var(--colors-d-rgb) / 0.47);
410
+ border-radius: var(--spacing);
411
+ bottom: -2px;
412
+ left: 50%;
413
+ transform: translateX(-50%);
414
+ transition: width 0.25s;
415
+ }
416
+ &:hover::after {
417
+ width: 95%;
418
+ }
419
+ }
420
+
421
+ .prose p > a.prose-link {
422
+ position: relative;
423
+
424
+ & [type='detail'] {
425
+ color: rgb(var(--colors-nord13-rgb) / 0.37);
426
+ > svg {
427
+ display: inline;
428
+ color: rgb(var(--colors-nord13-rgb) / 0.9);
429
+ margin-right: 0.0875em;
430
+ }
431
+ }
432
+ & [type='repo'] {
433
+ color: rgb(var(--colors-yellow-rgb) / 0.67);
434
+ > svg {
435
+ display: inline;
436
+ color: rgb(var(--colors-yellow-rgb) / 0.9);
437
+ margin-right: 0.0875em;
438
+ }
439
+ }
440
+ & [type='user'] {
441
+ color: rgb(var(--colors-pink-rgb) / 0.87);
442
+ > svg {
443
+ display: inline;
444
+ color: rgb(var(--colors-pink-rgb) / 0.9);
445
+ margin-right: 0.0875em;
446
+ }
447
+ }
448
+ &:has([type='user'])::after {
449
+ background: linear-gradient(-90deg, rgb(var(--colors-pink-rgb) / 0.87), transparent);
450
+ }
451
+ &:has([type='repo'])::after {
452
+ background: linear-gradient(
453
+ -90deg,
454
+ rgb(var(--colors-pink-rgb) / 0.87),
455
+ rgb(var(--colors-yellow-rgb) / 0.67)
456
+ );
457
+ }
458
+ &:has([type='detail'])::after {
459
+ background: linear-gradient(
460
+ -90deg,
461
+ rgb(var(--colors-yellow-rgb) / 0.67),
462
+ rgb(var(--colors-nord13-rgb) / 0.37)
463
+ );
464
+ }
465
+ }
466
+
467
+ .prose p > a.prose-link > span > svg {
468
+ display: inline;
469
+ margin-right: 0.0875em;
470
+ width: 1em;
471
+ height: 1em;
472
+ }
473
+
474
+ .prose p > a:not(.prose-link, .markdown-magic-link) {
475
+ animation: breathing 2.5s infinite;
476
+ }
477
+
478
+ @keyframes breathing {
479
+ 0%,
480
+ 100% {
481
+ opacity: 1;
482
+ }
483
+ 40%,
484
+ 60% {
485
+ opacity: 0.3;
486
+ }
487
+ }
@@ -0,0 +1,121 @@
1
+ /* Generate by @shikijs/codegen */
2
+ import type {
3
+ DynamicImportLanguageRegistration,
4
+ DynamicImportThemeRegistration,
5
+ HighlighterGeneric
6
+ } from '@shikijs/types'
7
+ import { createBundledHighlighter, createSingletonShorthands } from '@shikijs/core'
8
+ import { createJavaScriptRegexEngine } from '@shikijs/engine-javascript'
9
+ import {
10
+ transformerNotationDiff,
11
+ transformerNotationHighlight,
12
+ transformerNotationWordHighlight,
13
+ transformerNotationFocus,
14
+ transformerMetaHighlight,
15
+ transformerMetaWordHighlight,
16
+ transformerRemoveNotationEscape
17
+ } from '@shikijs/transformers'
18
+
19
+ type BundledLanguage =
20
+ | 'bash'
21
+ | 'sh'
22
+ | 'bat'
23
+ | 'css'
24
+ | 'diff'
25
+ | 'docker'
26
+ | 'html'
27
+ | 'http'
28
+ | 'java'
29
+ | 'js'
30
+ | 'json'
31
+ | 'lua'
32
+ | 'md'
33
+ | 'nginx'
34
+ | 'py'
35
+ | 'ps'
36
+ | 'plain'
37
+ | 'regex'
38
+ | 'sql'
39
+ | 'ts'
40
+ | 'vim'
41
+ | 'vue'
42
+ | 'xml'
43
+ | 'yml'
44
+ type BundledTheme = 'vitesse-dark' | 'vitesse-light'
45
+ type Highlighter = HighlighterGeneric<BundledLanguage, BundledTheme>
46
+
47
+ const bundledLanguages = {
48
+ bash: () => import('@shikijs/langs/shellscript'),
49
+ sh: () => import('@shikijs/langs/shellscript'),
50
+ bat: () => import('@shikijs/langs/bat'),
51
+ css: () => import('@shikijs/langs/css'),
52
+ diff: () => import('@shikijs/langs/diff'),
53
+ docker: () => import('@shikijs/langs/docker'),
54
+ html: () => import('@shikijs/langs/html'),
55
+ http: () => import('@shikijs/langs/http'),
56
+ java: () => import('@shikijs/langs/java'),
57
+ js: () => import('@shikijs/langs/javascript'),
58
+ json: () => import('@shikijs/langs/json'),
59
+ lua: () => import('@shikijs/langs/lua'),
60
+ md: () => import('@shikijs/langs/markdown'),
61
+ nginx: () => import('@shikijs/langs/nginx'),
62
+ py: () => import('@shikijs/langs/python'),
63
+ ps: () => import('@shikijs/langs/powershell'),
64
+ plain: () => import('@shikijs/langs/tex'),
65
+ regex: () => import('@shikijs/langs/regexp'),
66
+ sql: () => import('@shikijs/langs/sql'),
67
+ ts: () => import('@shikijs/langs/typescript'),
68
+ vim: () => import('@shikijs/langs/viml'),
69
+ vue: () => import('@shikijs/langs/vue'),
70
+ xml: () => import('@shikijs/langs/xml'),
71
+ yml: () => import('@shikijs/langs/yaml')
72
+ } as Record<BundledLanguage, DynamicImportLanguageRegistration>
73
+
74
+ const bundledThemes = {
75
+ 'vitesse-dark': () => import('@shikijs/themes/vitesse-dark'),
76
+ 'vitesse-light': () => import('@shikijs/themes/vitesse-light')
77
+ } as Record<BundledTheme, DynamicImportThemeRegistration>
78
+
79
+ const createHighlighter = /* @__PURE__ */ createBundledHighlighter<
80
+ BundledLanguage,
81
+ BundledTheme
82
+ >({
83
+ langs: bundledLanguages,
84
+ themes: bundledThemes,
85
+ engine: () => createJavaScriptRegexEngine()
86
+ })
87
+
88
+ const {
89
+ codeToHtml,
90
+ codeToHast,
91
+ codeToTokensBase,
92
+ codeToTokens,
93
+ codeToTokensWithThemes,
94
+ getSingletonHighlighter,
95
+ getLastGrammarState
96
+ } = /* @__PURE__ */ createSingletonShorthands<BundledLanguage, BundledTheme>(createHighlighter)
97
+
98
+ const transformers = [
99
+ transformerNotationDiff(),
100
+ transformerNotationHighlight(),
101
+ transformerNotationWordHighlight(),
102
+ transformerNotationFocus(),
103
+ transformerMetaHighlight(),
104
+ transformerMetaWordHighlight(),
105
+ transformerRemoveNotationEscape()
106
+ ]
107
+
108
+ export {
109
+ bundledLanguages,
110
+ bundledThemes,
111
+ codeToHast,
112
+ codeToHtml,
113
+ codeToTokens,
114
+ codeToTokensBase,
115
+ codeToTokensWithThemes,
116
+ createHighlighter,
117
+ getLastGrammarState,
118
+ getSingletonHighlighter,
119
+ transformers
120
+ }
121
+ export type { BundledLanguage, BundledTheme, Highlighter }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naiheyoung/use",
3
- "version": "0.0.1",
3
+ "version": "0.0.4",
4
4
  "description": "Files used for personal development.",
5
5
  "homepage": "https://github.com/naiheyoung/use#readme",
6
6
  "author": "Naihe",
@@ -29,8 +29,14 @@
29
29
  "README.md"
30
30
  ],
31
31
  "devDependencies": {
32
+ "@shikijs/core": "^3.21.0",
33
+ "@shikijs/engine-javascript": "^3.21.0",
34
+ "@shikijs/langs": "^3.21.0",
35
+ "@shikijs/themes": "^3.21.0",
36
+ "@shikijs/transformers": "^3.21.0",
37
+ "@shikijs/types": "^3.21.0",
32
38
  "@types/fs-extra": "^11.0.4",
33
- "@types/node": "^25.0.5",
39
+ "@types/node": "^25.0.6",
34
40
  "@types/prompts": "^2.4.9",
35
41
  "cac": "^6.7.14",
36
42
  "chalk": "^5.6.2",
@@ -43,19 +49,12 @@
43
49
  "vitest": "^4.0.16"
44
50
  },
45
51
  "publishConfig": {
46
- "access": "public"
52
+ "access": "public",
53
+ "registry": "https://registry.npmjs.org"
47
54
  },
48
55
  "dependencies": {
49
56
  "@naiheyoung/color": "^1.1.0"
50
57
  },
51
- "peerDependencies": {
52
- "@naiheyoung/color": "^1.1.0"
53
- },
54
- "peerDependenciesMeta": {
55
- "@naiheyoung/color": {
56
- "optional": true
57
- }
58
- },
59
58
  "scripts": {
60
59
  "test": "vitest",
61
60
  "prebuild": "pnpm run format",