@xylabs/promise 2.9.2 → 2.10.0

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.
Files changed (58) hide show
  1. package/dist/fulfilled.d.mts +8 -0
  2. package/dist/fulfilled.d.ts +8 -0
  3. package/dist/fulfilled.js +33 -0
  4. package/dist/fulfilled.js.map +1 -0
  5. package/dist/fulfilled.mjs +8 -0
  6. package/dist/fulfilled.mjs.map +1 -0
  7. package/dist/{esm/fulfilledValues.js → fulfilledValues.d.mts} +3 -6
  8. package/dist/{types/fulfilledValues.d.ts → fulfilledValues.d.ts} +3 -2
  9. package/dist/fulfilledValues.js +35 -0
  10. package/dist/fulfilledValues.js.map +1 -0
  11. package/dist/fulfilledValues.mjs +10 -0
  12. package/dist/fulfilledValues.mjs.map +1 -0
  13. package/dist/index.d.mts +3 -0
  14. package/dist/index.d.ts +3 -0
  15. package/dist/index.js +51 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/index.mjs +22 -0
  18. package/dist/index.mjs.map +1 -0
  19. package/dist/rejected.d.mts +8 -0
  20. package/dist/rejected.d.ts +8 -0
  21. package/dist/rejected.js +33 -0
  22. package/dist/rejected.js.map +1 -0
  23. package/dist/rejected.mjs +8 -0
  24. package/dist/rejected.mjs.map +1 -0
  25. package/package.json +28 -14
  26. package/tsup.config.ts +14 -0
  27. package/dist/cjs/fulfilled.js +0 -13
  28. package/dist/cjs/fulfilled.js.map +0 -1
  29. package/dist/cjs/fulfilledValues.js +0 -28
  30. package/dist/cjs/fulfilledValues.js.map +0 -1
  31. package/dist/cjs/index.js +0 -10
  32. package/dist/cjs/index.js.map +0 -1
  33. package/dist/cjs/rejected.js +0 -13
  34. package/dist/cjs/rejected.js.map +0 -1
  35. package/dist/docs.json +0 -430
  36. package/dist/esm/fulfilled.js +0 -9
  37. package/dist/esm/fulfilled.js.map +0 -1
  38. package/dist/esm/fulfilledValues.js.map +0 -1
  39. package/dist/esm/index.js +0 -5
  40. package/dist/esm/index.js.map +0 -1
  41. package/dist/esm/rejected.js +0 -9
  42. package/dist/esm/rejected.js.map +0 -1
  43. package/dist/types/fulfilled.d.ts +0 -7
  44. package/dist/types/fulfilled.d.ts.map +0 -1
  45. package/dist/types/fulfilledValues.d.ts.map +0 -1
  46. package/dist/types/index.d.ts +0 -5
  47. package/dist/types/index.d.ts.map +0 -1
  48. package/dist/types/rejected.d.ts +0 -7
  49. package/dist/types/rejected.d.ts.map +0 -1
  50. package/docs/assets/highlight.css +0 -85
  51. package/docs/assets/main.js +0 -58
  52. package/docs/assets/search.js +0 -1
  53. package/docs/assets/style.css +0 -1367
  54. package/docs/functions/fulfilled.html +0 -61
  55. package/docs/functions/fulfilledValues.html +0 -72
  56. package/docs/functions/rejected.html +0 -61
  57. package/docs/index.html +0 -84
  58. package/docs/modules.html +0 -46
package/dist/docs.json DELETED
@@ -1,430 +0,0 @@
1
- {
2
- "id": 0,
3
- "name": "@xylabs/promise",
4
- "variant": "project",
5
- "kind": 1,
6
- "flags": {},
7
- "children": [
8
- {
9
- "id": 1,
10
- "name": "fulfilled",
11
- "variant": "declaration",
12
- "kind": 64,
13
- "flags": {},
14
- "sources": [
15
- {
16
- "fileName": "fulfilled.ts",
17
- "line": 6,
18
- "character": 13,
19
- "url": "https://github.com/xylabs/sdk-js/blob/88ada5a/packages/promise/src/fulfilled.ts#L6"
20
- }
21
- ],
22
- "signatures": [
23
- {
24
- "id": 2,
25
- "name": "fulfilled",
26
- "variant": "signature",
27
- "kind": 4096,
28
- "flags": {},
29
- "comment": {
30
- "summary": [
31
- {
32
- "kind": "text",
33
- "text": "For use with Promise.allSettled to filter only successful results"
34
- }
35
- ],
36
- "blockTags": [
37
- {
38
- "tag": "@returns",
39
- "content": []
40
- }
41
- ]
42
- },
43
- "sources": [
44
- {
45
- "fileName": "fulfilled.ts",
46
- "line": 6,
47
- "character": 25,
48
- "url": "https://github.com/xylabs/sdk-js/blob/88ada5a/packages/promise/src/fulfilled.ts#L6"
49
- }
50
- ],
51
- "typeParameter": [
52
- {
53
- "id": 3,
54
- "name": "T",
55
- "variant": "typeParam",
56
- "kind": 131072,
57
- "flags": {}
58
- }
59
- ],
60
- "parameters": [
61
- {
62
- "id": 4,
63
- "name": "val",
64
- "variant": "param",
65
- "kind": 32768,
66
- "flags": {},
67
- "type": {
68
- "type": "reference",
69
- "target": {
70
- "sourceFileName": "../../node_modules/typescript/lib/lib.es2020.promise.d.ts",
71
- "qualifiedName": "PromiseSettledResult"
72
- },
73
- "typeArguments": [
74
- {
75
- "type": "reference",
76
- "target": -1,
77
- "name": "T",
78
- "refersToTypeParameter": true
79
- }
80
- ],
81
- "name": "PromiseSettledResult",
82
- "package": "typescript"
83
- }
84
- }
85
- ],
86
- "type": {
87
- "type": "predicate",
88
- "name": "val",
89
- "asserts": false,
90
- "targetType": {
91
- "type": "reference",
92
- "target": {
93
- "sourceFileName": "../../node_modules/typescript/lib/lib.es2020.promise.d.ts",
94
- "qualifiedName": "PromiseFulfilledResult"
95
- },
96
- "typeArguments": [
97
- {
98
- "type": "reference",
99
- "target": -1,
100
- "name": "T",
101
- "refersToTypeParameter": true
102
- }
103
- ],
104
- "name": "PromiseFulfilledResult",
105
- "package": "typescript"
106
- }
107
- }
108
- }
109
- ]
110
- },
111
- {
112
- "id": 5,
113
- "name": "fulfilledValues",
114
- "variant": "declaration",
115
- "kind": 64,
116
- "flags": {},
117
- "sources": [
118
- {
119
- "fileName": "fulfilledValues.ts",
120
- "line": 19,
121
- "character": 13,
122
- "url": "https://github.com/xylabs/sdk-js/blob/88ada5a/packages/promise/src/fulfilledValues.ts#L19"
123
- }
124
- ],
125
- "signatures": [
126
- {
127
- "id": 6,
128
- "name": "fulfilledValues",
129
- "variant": "signature",
130
- "kind": 4096,
131
- "flags": {},
132
- "comment": {
133
- "summary": [
134
- {
135
- "kind": "text",
136
- "text": "For use with Promise.allSettled to reduce to only successful result values"
137
- }
138
- ],
139
- "blockTags": [
140
- {
141
- "tag": "@example",
142
- "content": [
143
- {
144
- "kind": "text",
145
- "text": "Casting the initialValue provided to reduce\n"
146
- },
147
- {
148
- "kind": "code",
149
- "text": "```ts\nconst resolved = Promise.resolve('resolved')\nconst rejected = Promise.reject('rejected')\nconst settled = await Promise.allSettled([resolved, rejected])\nconst results = settled.reduce(fulfilledValues, [] as string[])\n// results === [ 'resolved' ]\n```"
150
- }
151
- ]
152
- },
153
- {
154
- "tag": "@example",
155
- "content": [
156
- {
157
- "kind": "text",
158
- "text": "Providing type parameter to reduce and initialValue type can be inferred\n"
159
- },
160
- {
161
- "kind": "code",
162
- "text": "```ts\nconst resolved = Promise.resolve('resolved')\nconst rejected = Promise.reject('rejected')\nconst settled = await Promise.allSettled([resolved, rejected])\nconst results = settled.reduce<string[]>(fulfilledValues, [])\n// results === [ 'resolved' ]\n```"
163
- }
164
- ]
165
- },
166
- {
167
- "tag": "@returns",
168
- "content": []
169
- }
170
- ]
171
- },
172
- "sources": [
173
- {
174
- "fileName": "fulfilledValues.ts",
175
- "line": 19,
176
- "character": 31,
177
- "url": "https://github.com/xylabs/sdk-js/blob/88ada5a/packages/promise/src/fulfilledValues.ts#L19"
178
- }
179
- ],
180
- "typeParameter": [
181
- {
182
- "id": 7,
183
- "name": "T",
184
- "variant": "typeParam",
185
- "kind": 131072,
186
- "flags": {}
187
- }
188
- ],
189
- "parameters": [
190
- {
191
- "id": 8,
192
- "name": "previousValue",
193
- "variant": "param",
194
- "kind": 32768,
195
- "flags": {},
196
- "type": {
197
- "type": "array",
198
- "elementType": {
199
- "type": "reference",
200
- "target": -1,
201
- "name": "T",
202
- "refersToTypeParameter": true
203
- }
204
- }
205
- },
206
- {
207
- "id": 9,
208
- "name": "currentValue",
209
- "variant": "param",
210
- "kind": 32768,
211
- "flags": {},
212
- "type": {
213
- "type": "reference",
214
- "target": {
215
- "sourceFileName": "../../node_modules/typescript/lib/lib.es2020.promise.d.ts",
216
- "qualifiedName": "PromiseSettledResult"
217
- },
218
- "typeArguments": [
219
- {
220
- "type": "reference",
221
- "target": -1,
222
- "name": "T",
223
- "refersToTypeParameter": true
224
- }
225
- ],
226
- "name": "PromiseSettledResult",
227
- "package": "typescript"
228
- }
229
- }
230
- ],
231
- "type": {
232
- "type": "array",
233
- "elementType": {
234
- "type": "reference",
235
- "target": -1,
236
- "name": "T",
237
- "refersToTypeParameter": true
238
- }
239
- }
240
- }
241
- ]
242
- },
243
- {
244
- "id": 10,
245
- "name": "rejected",
246
- "variant": "declaration",
247
- "kind": 64,
248
- "flags": {},
249
- "sources": [
250
- {
251
- "fileName": "rejected.ts",
252
- "line": 6,
253
- "character": 13,
254
- "url": "https://github.com/xylabs/sdk-js/blob/88ada5a/packages/promise/src/rejected.ts#L6"
255
- }
256
- ],
257
- "signatures": [
258
- {
259
- "id": 11,
260
- "name": "rejected",
261
- "variant": "signature",
262
- "kind": 4096,
263
- "flags": {},
264
- "comment": {
265
- "summary": [
266
- {
267
- "kind": "text",
268
- "text": "For use with Promise.allSettled to filter only rejected results"
269
- }
270
- ],
271
- "blockTags": [
272
- {
273
- "tag": "@returns",
274
- "content": []
275
- }
276
- ]
277
- },
278
- "sources": [
279
- {
280
- "fileName": "rejected.ts",
281
- "line": 6,
282
- "character": 24,
283
- "url": "https://github.com/xylabs/sdk-js/blob/88ada5a/packages/promise/src/rejected.ts#L6"
284
- }
285
- ],
286
- "typeParameter": [
287
- {
288
- "id": 12,
289
- "name": "T",
290
- "variant": "typeParam",
291
- "kind": 131072,
292
- "flags": {}
293
- }
294
- ],
295
- "parameters": [
296
- {
297
- "id": 13,
298
- "name": "val",
299
- "variant": "param",
300
- "kind": 32768,
301
- "flags": {},
302
- "type": {
303
- "type": "reference",
304
- "target": {
305
- "sourceFileName": "../../node_modules/typescript/lib/lib.es2020.promise.d.ts",
306
- "qualifiedName": "PromiseSettledResult"
307
- },
308
- "typeArguments": [
309
- {
310
- "type": "reference",
311
- "target": -1,
312
- "name": "T",
313
- "refersToTypeParameter": true
314
- }
315
- ],
316
- "name": "PromiseSettledResult",
317
- "package": "typescript"
318
- }
319
- }
320
- ],
321
- "type": {
322
- "type": "predicate",
323
- "name": "val",
324
- "asserts": false,
325
- "targetType": {
326
- "type": "reference",
327
- "target": {
328
- "sourceFileName": "../../node_modules/typescript/lib/lib.es2020.promise.d.ts",
329
- "qualifiedName": "PromiseRejectedResult"
330
- },
331
- "name": "PromiseRejectedResult",
332
- "package": "typescript"
333
- }
334
- }
335
- }
336
- ]
337
- }
338
- ],
339
- "groups": [
340
- {
341
- "title": "Functions",
342
- "children": [
343
- 1,
344
- 5,
345
- 10
346
- ]
347
- }
348
- ],
349
- "packageName": "@xylabs/promise",
350
- "readme": [
351
- {
352
- "kind": "text",
353
- "text": "[![logo][]](https://xylabs.com)\n\n# @xylabs/sdk-js\n\n[![main-build][]][main-build-link]\n[![beta-build][]][beta-build-link]\n[![npm-badge][]][npm-link]\n[![bch-badge][]][bch-link]\n[![codacy-badge][]][codacy-link]\n[![codeclimate-badge][]][codeclimate-link]\n[![snyk-badge][]][snyk-link]\n\n## Table of Contents\n\n- [Description](#description)\n- [Install](#install)\n- [Scripts](#scripts)\n- [Maintainers](#maintainers)\n- [License](#license)\n- [Credits](#credits)\n\n## Description\n\nSDK for base code for Typescript and Javascript Libraries.\n\n## Install\n\nUsing npm:\n\n"
354
- },
355
- {
356
- "kind": "code",
357
- "text": "```sh\nnpm i --save @xylabs/sdk-js\n```"
358
- },
359
- {
360
- "kind": "text",
361
- "text": "\n\nUsing yarn:\n\n"
362
- },
363
- {
364
- "kind": "code",
365
- "text": "```sh\nyarn add @xylabs/sdk-js\n```"
366
- },
367
- {
368
- "kind": "text",
369
- "text": "\n\n## Scripts\n\nSee [ts-scripts](https://github.com/xylabs/ts-scripts/blob/main/README.md)\nfor list of shared scripts.\n\n## Maintainers\n\n- [Arie Trouw](https://github.com/arietrouw) (<https://arietrouw.com>)\n\n## License\n\nSee the [LICENSE](LICENSE) file for license details\n\n## Credits\n\n[Made with 🔥 and ❄️ by XY Labs](https://xylabs.com)\n\n[logo]: https://cdn.xy.company/img/brand/XYPersistentCompany_Logo_Icon_Colored.svg\n[main-build]: https://github.com/xylabs/sdk-js/actions/workflows/build-main.yml/badge.svg\n[main-build-link]: https://github.com/xylabs/sdk-js/actions/workflows/build-main.yml\n[beta-build]: https://github.com/xylabs/sdk-js/actions/workflows/build-beta.yml/badge.svg\n[beta-build-link]: https://github.com/xylabs/sdk-js/actions/workflows/build-beta.yml\n[npm-badge]: https://img.shields.io/npm/v/@xylabs/sdk-js.svg\n[npm-link]: https://www.npmjs.com/package/@xylabs/sdk-js\n[bch-badge]: https://bettercodehub.com/edge/badge/xylabs/sdk-js?branch=main\n[bch-link]: https://bettercodehub.com/results/xylabs/sdk-js\n[codacy-badge]: https://app.codacy.com/project/badge/Grade/c8e15e14f37741c18cfb47ac7245c698\n[codacy-link]: https://www.codacy.com/gh/xylabs/sdk-js/dashboard?utm_source=github.com&utm_medium=referral&utm_content=xylabs/sdk-js&utm_campaign=Badge_Grade\n[codeclimate-badge]: https://api.codeclimate.com/v1/badges/c5eb068f806f0b047ea7/maintainability\n[codeclimate-link]: https://codeclimate.com/github/xylabs/sdk-js/maintainability\n[snyk-badge]: https://snyk.io/test/github/xylabs/sdk-js/badge.svg?targetFile=package.json\n[snyk-link]: https://snyk.io/test/github/xylabs/sdk-js?targetFile=package.json"
370
- }
371
- ],
372
- "symbolIdMap": {
373
- "0": {
374
- "sourceFileName": "src/index.ts",
375
- "qualifiedName": ""
376
- },
377
- "1": {
378
- "sourceFileName": "src/fulfilled.ts",
379
- "qualifiedName": "fulfilled"
380
- },
381
- "2": {
382
- "sourceFileName": "src/fulfilled.ts",
383
- "qualifiedName": "fulfilled"
384
- },
385
- "3": {
386
- "sourceFileName": "src/fulfilled.ts",
387
- "qualifiedName": "T"
388
- },
389
- "4": {
390
- "sourceFileName": "src/fulfilled.ts",
391
- "qualifiedName": "val"
392
- },
393
- "5": {
394
- "sourceFileName": "src/fulfilledValues.ts",
395
- "qualifiedName": "fulfilledValues"
396
- },
397
- "6": {
398
- "sourceFileName": "src/fulfilledValues.ts",
399
- "qualifiedName": "fulfilledValues"
400
- },
401
- "7": {
402
- "sourceFileName": "src/fulfilledValues.ts",
403
- "qualifiedName": "T"
404
- },
405
- "8": {
406
- "sourceFileName": "src/fulfilledValues.ts",
407
- "qualifiedName": "previousValue"
408
- },
409
- "9": {
410
- "sourceFileName": "src/fulfilledValues.ts",
411
- "qualifiedName": "currentValue"
412
- },
413
- "10": {
414
- "sourceFileName": "src/rejected.ts",
415
- "qualifiedName": "rejected"
416
- },
417
- "11": {
418
- "sourceFileName": "src/rejected.ts",
419
- "qualifiedName": "rejected"
420
- },
421
- "12": {
422
- "sourceFileName": "src/rejected.ts",
423
- "qualifiedName": "T"
424
- },
425
- "13": {
426
- "sourceFileName": "src/rejected.ts",
427
- "qualifiedName": "val"
428
- }
429
- }
430
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * For use with Promise.allSettled to filter only successful results
3
- * @param val
4
- * @returns
5
- */
6
- export const fulfilled = (val) => {
7
- return val.status === 'fulfilled';
8
- };
9
- //# sourceMappingURL=fulfilled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fulfilled.js","sourceRoot":"","sources":["../../src/fulfilled.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAI,GAA4B,EAAoC,EAAE;IAC7F,OAAO,GAAG,CAAC,MAAM,KAAK,WAAW,CAAA;AACnC,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"fulfilledValues.js","sourceRoot":"","sources":["../../src/fulfilledValues.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAI,aAAkB,EAAE,YAAqC,EAAO,EAAE;IACnG,IAAI,YAAY,CAAC,MAAM,KAAK,WAAW;QAAE,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;IAC/E,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA"}
package/dist/esm/index.js DELETED
@@ -1,5 +0,0 @@
1
- import { fulfilled } from './fulfilled';
2
- import { fulfilledValues } from './fulfilledValues';
3
- import { rejected } from './rejected';
4
- export { fulfilled, fulfilledValues, rejected };
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAA"}
@@ -1,9 +0,0 @@
1
- /**
2
- * For use with Promise.allSettled to filter only rejected results
3
- * @param val
4
- * @returns
5
- */
6
- export const rejected = (val) => {
7
- return val.status === 'rejected';
8
- };
9
- //# sourceMappingURL=rejected.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rejected.js","sourceRoot":"","sources":["../../src/rejected.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAI,GAA4B,EAAgC,EAAE;IACxF,OAAO,GAAG,CAAC,MAAM,KAAK,UAAU,CAAA;AAClC,CAAC,CAAA"}
@@ -1,7 +0,0 @@
1
- /**
2
- * For use with Promise.allSettled to filter only successful results
3
- * @param val
4
- * @returns
5
- */
6
- export declare const fulfilled: <T>(val: PromiseSettledResult<T>) => val is PromiseFulfilledResult<T>;
7
- //# sourceMappingURL=fulfilled.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fulfilled.d.ts","sourceRoot":"","sources":["../../src/fulfilled.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,SAAS,uEAErB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"fulfilledValues.d.ts","sourceRoot":"","sources":["../../src/fulfilledValues.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,uEAG3B,CAAA"}
@@ -1,5 +0,0 @@
1
- import { fulfilled } from './fulfilled';
2
- import { fulfilledValues } from './fulfilledValues';
3
- import { rejected } from './rejected';
4
- export { fulfilled, fulfilledValues, rejected };
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAA"}
@@ -1,7 +0,0 @@
1
- /**
2
- * For use with Promise.allSettled to filter only rejected results
3
- * @param val
4
- * @returns
5
- */
6
- export declare const rejected: <T>(val: PromiseSettledResult<T>) => val is PromiseRejectedResult;
7
- //# sourceMappingURL=rejected.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rejected.d.ts","sourceRoot":"","sources":["../../src/rejected.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,mEAEpB,CAAA"}
@@ -1,85 +0,0 @@
1
- :root {
2
- --light-hl-0: #795E26;
3
- --dark-hl-0: #DCDCAA;
4
- --light-hl-1: #000000;
5
- --dark-hl-1: #D4D4D4;
6
- --light-hl-2: #A31515;
7
- --dark-hl-2: #CE9178;
8
- --light-hl-3: #0000FF;
9
- --dark-hl-3: #569CD6;
10
- --light-hl-4: #0070C1;
11
- --dark-hl-4: #4FC1FF;
12
- --light-hl-5: #267F99;
13
- --dark-hl-5: #4EC9B0;
14
- --light-hl-6: #AF00DB;
15
- --dark-hl-6: #C586C0;
16
- --light-hl-7: #001080;
17
- --dark-hl-7: #9CDCFE;
18
- --light-hl-8: #008000;
19
- --dark-hl-8: #6A9955;
20
- --light-code-background: #FFFFFF;
21
- --dark-code-background: #1E1E1E;
22
- }
23
-
24
- @media (prefers-color-scheme: light) { :root {
25
- --hl-0: var(--light-hl-0);
26
- --hl-1: var(--light-hl-1);
27
- --hl-2: var(--light-hl-2);
28
- --hl-3: var(--light-hl-3);
29
- --hl-4: var(--light-hl-4);
30
- --hl-5: var(--light-hl-5);
31
- --hl-6: var(--light-hl-6);
32
- --hl-7: var(--light-hl-7);
33
- --hl-8: var(--light-hl-8);
34
- --code-background: var(--light-code-background);
35
- } }
36
-
37
- @media (prefers-color-scheme: dark) { :root {
38
- --hl-0: var(--dark-hl-0);
39
- --hl-1: var(--dark-hl-1);
40
- --hl-2: var(--dark-hl-2);
41
- --hl-3: var(--dark-hl-3);
42
- --hl-4: var(--dark-hl-4);
43
- --hl-5: var(--dark-hl-5);
44
- --hl-6: var(--dark-hl-6);
45
- --hl-7: var(--dark-hl-7);
46
- --hl-8: var(--dark-hl-8);
47
- --code-background: var(--dark-code-background);
48
- } }
49
-
50
- :root[data-theme='light'] {
51
- --hl-0: var(--light-hl-0);
52
- --hl-1: var(--light-hl-1);
53
- --hl-2: var(--light-hl-2);
54
- --hl-3: var(--light-hl-3);
55
- --hl-4: var(--light-hl-4);
56
- --hl-5: var(--light-hl-5);
57
- --hl-6: var(--light-hl-6);
58
- --hl-7: var(--light-hl-7);
59
- --hl-8: var(--light-hl-8);
60
- --code-background: var(--light-code-background);
61
- }
62
-
63
- :root[data-theme='dark'] {
64
- --hl-0: var(--dark-hl-0);
65
- --hl-1: var(--dark-hl-1);
66
- --hl-2: var(--dark-hl-2);
67
- --hl-3: var(--dark-hl-3);
68
- --hl-4: var(--dark-hl-4);
69
- --hl-5: var(--dark-hl-5);
70
- --hl-6: var(--dark-hl-6);
71
- --hl-7: var(--dark-hl-7);
72
- --hl-8: var(--dark-hl-8);
73
- --code-background: var(--dark-code-background);
74
- }
75
-
76
- .hl-0 { color: var(--hl-0); }
77
- .hl-1 { color: var(--hl-1); }
78
- .hl-2 { color: var(--hl-2); }
79
- .hl-3 { color: var(--hl-3); }
80
- .hl-4 { color: var(--hl-4); }
81
- .hl-5 { color: var(--hl-5); }
82
- .hl-6 { color: var(--hl-6); }
83
- .hl-7 { color: var(--hl-7); }
84
- .hl-8 { color: var(--hl-8); }
85
- pre, code { background: var(--code-background); }