@naiheyoung/use 0.0.2 → 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
@@ -68,16 +68,21 @@
68
68
 
69
69
  :root {
70
70
  --shiki-dark-bg-0: #151515;
71
- --prose-padding-block: 12px;
72
- --prose-padding-inline: 1.5rem;
73
- --prose-radius: 0.5rem;
71
+ --prose-pre-padding-block: 12px;
72
+ --prose-pre-code-padding-inline: 1.5rem;
73
+ --prose-pre-radius: 0.5rem;
74
74
  --prose-diff-add-color: #3dd68c;
75
+ --prose-diff-add-bg-color: rgb(61 214 140 / 0.18);
75
76
  --prose-diff-remove-color: #cb7676;
76
- --prose-highlighted-bg-color: rgba(101, 117, 133, 0.16);
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;
77
80
  --prose-highlighted-word-color: #e6a817;
78
81
  --prose-focused-opacity: 0.7;
79
82
  --prose-focused-blur: 0.095rem;
80
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);
81
86
  }
82
87
 
83
88
  .prose h1 {
@@ -114,19 +119,66 @@
114
119
  line-height: 1.5;
115
120
  }
116
121
 
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;
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
+ }
121
129
  }
122
130
 
123
- html.dark .prose .has-diff span.diff.add::before {
124
- content: '+';
125
- color: var(--prose-diff-add-color);
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
+ }
126
139
  }
127
140
 
128
- html.dark .prose .has-diff span.diff.remove {
129
- opacity: 0.85;
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);
130
182
 
131
183
  &::before {
132
184
  content: '-';
@@ -134,23 +186,32 @@ html.dark .prose .has-diff span.diff.remove {
134
186
  }
135
187
  }
136
188
 
137
- html.dark .prose .has-highlighted span.highlighted {
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 {
138
195
  background-color: var(--prose-highlighted-bg-color);
139
196
  transition: background-color 0.35s;
140
- width: calc(100% + (var(--prose-padding-inline) * 2));
197
+ width: calc(100% + (var(--prose-pre-code-padding-inline) * 2));
141
198
  display: inline-block;
142
- margin-inline: -1.5rem;
143
- padding-inline: var(--prose-padding-inline);
199
+ margin-inline: calc(-1 * var(--prose-pre-code-padding-inline));
200
+ padding-inline: var(--prose-pre-code-padding-inline);
144
201
  }
145
202
 
146
- html.dark .prose .shiki span.highlighted-word {
203
+ .prose .shiki span.highlighted-word {
147
204
  padding: 1px 3px;
148
205
  margin: -1px -3px;
149
206
  border-radius: 3px;
207
+ text-decoration: var(--prose-l-highlighted-word-color) underline;
208
+ }
209
+
210
+ html.dark .prose .shiki span.highlighted-word {
150
211
  text-decoration: var(--prose-highlighted-word-color) underline;
151
212
  }
152
213
 
153
- html.dark .prose .has-focused .line:not(.focused) {
214
+ .prose .has-focused .line:not(.focused) {
154
215
  opacity: var(--prose-focused-opacity);
155
216
  filter: blur(var(--prose-focused-blur));
156
217
  transition:
@@ -158,13 +219,14 @@ html.dark .prose .has-focused .line:not(.focused) {
158
219
  filter 0.35s;
159
220
  }
160
221
 
161
- html.dark .prose .has-focused:hover .line:not(.focused) {
222
+ .prose .has-focused:hover .line:not(.focused) {
162
223
  opacity: 1;
163
224
  filter: blur(0);
164
225
  }
165
226
 
166
227
  .prose hr {
167
- height: 1rem;
228
+ margin-block: var(--prose-hr-block);
229
+ color: var(--prose-hr-fg);
168
230
  }
169
231
 
170
232
  .prose mark,
@@ -190,7 +252,7 @@ html.dark .prose .has-focused:hover .line:not(.focused) {
190
252
  position: absolute;
191
253
  content: '';
192
254
  width: 0.25rem;
193
- background-color: rgba(125, 125, 125, 0.3);
255
+ background-color: rgb(125 125 125 / 0.3);
194
256
  top: 0.6rem;
195
257
  bottom: 0.4rem;
196
258
  border-radius: 3px;
@@ -207,18 +269,18 @@ html.dark .prose .has-focused:hover .line:not(.focused) {
207
269
  display: flex;
208
270
  gap: 3px;
209
271
  font-size: 0.875rem;
210
- color: rgba(0, 0, 0, 0.55);
272
+ color: rgb(0 0 0 / 0.55);
211
273
  align-items: center;
212
274
 
213
275
  &.markdown-magic-link-github-at {
214
- background-color: rgba(0, 0, 0, 0.1);
276
+ background-color: rgb(0 0 0 / 0.1);
215
277
  border-radius: 1.5em;
216
278
  width: fit-content;
217
279
  padding-right: 0.6em;
218
280
  transition: background-color 0.35s;
219
281
 
220
282
  &:hover {
221
- background-color: rgba(0, 0, 0, 0.15);
283
+ background-color: rgb(0 0 0 / 0.15);
222
284
  }
223
285
  }
224
286
 
@@ -234,13 +296,13 @@ html.dark .prose .has-focused:hover .line:not(.focused) {
234
296
  }
235
297
 
236
298
  html.dark .prose .markdown-magic-link {
237
- color: rgba(255, 255, 255, 0.55);
299
+ color: rgb(255 255 255 / 0.55);
238
300
 
239
301
  &.markdown-magic-link-github-at {
240
- background-color: rgba(255, 255, 255, 0.1);
302
+ background-color: rgb(255 255 255 / 0.1);
241
303
 
242
304
  &:hover {
243
- background-color: rgba(255, 255, 255, 0.15);
305
+ background-color: rgb(255 255 255 / 0.15);
244
306
  }
245
307
  }
246
308
  }
@@ -284,6 +346,30 @@ html.dark .prose .markdown-magic-link {
284
346
  }
285
347
  }
286
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
+
287
373
  @keyframes living {
288
374
  0% {
289
375
  box-shadow: 0 0 0 0.25rem rgb(var(--prose-li-fg) / 0.3);
@@ -384,3 +470,18 @@ html.dark .prose .markdown-magic-link {
384
470
  width: 1em;
385
471
  height: 1em;
386
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naiheyoung/use",
3
- "version": "0.0.2",
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",
@@ -49,7 +49,8 @@
49
49
  "vitest": "^4.0.16"
50
50
  },
51
51
  "publishConfig": {
52
- "access": "public"
52
+ "access": "public",
53
+ "registry": "https://registry.npmjs.org"
53
54
  },
54
55
  "dependencies": {
55
56
  "@naiheyoung/color": "^1.1.0"