@coywolf/emdash 0.0.0-stage → 0.35.13
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/LICENSE +21 -0
- package/README.md +201 -2
- package/package.json +70 -5
- package/src/admin/admin-css.ts +57 -0
- package/src/admin/ai.tsx +915 -0
- package/src/admin/backups.tsx +613 -0
- package/src/admin/breadcrumbs.tsx +542 -0
- package/src/admin/codeBlocks.tsx +204 -0
- package/src/admin/customBlocks.tsx +321 -0
- package/src/admin/dirty.ts +20 -0
- package/src/admin/discovery.tsx +463 -0
- package/src/admin/download.ts +28 -0
- package/src/admin/feature-switches.tsx +124 -0
- package/src/admin/features.tsx +142 -0
- package/src/admin/files.tsx +791 -0
- package/src/admin/formUploads.tsx +445 -0
- package/src/admin/guides.tsx +18 -0
- package/src/admin/headings.tsx +262 -0
- package/src/admin/images.tsx +825 -0
- package/src/admin/index.tsx +62 -0
- package/src/admin/links.tsx +980 -0
- package/src/admin/performance.tsx +330 -0
- package/src/admin/preview.tsx +63 -0
- package/src/admin/redirects-removed.tsx +266 -0
- package/src/admin/redirects.tsx +470 -0
- package/src/admin/reviews.tsx +232 -0
- package/src/admin/robots-bots.tsx +647 -0
- package/src/admin/robots-shared.tsx +109 -0
- package/src/admin/robots-wizard.tsx +748 -0
- package/src/admin/robots.tsx +911 -0
- package/src/admin/save-bar.tsx +134 -0
- package/src/admin/schema.tsx +1187 -0
- package/src/admin/search.tsx +355 -0
- package/src/admin/settings-ui.tsx +87 -0
- package/src/admin/trash-prompt-core.ts +135 -0
- package/src/admin/trash-prompt.tsx +156 -0
- package/src/admin/usage.tsx +301 -0
- package/src/admin/videos-display.tsx +248 -0
- package/src/admin/videos.tsx +1202 -0
- package/src/admin/wpImport.tsx +1516 -0
- package/src/ai/entities.ts +59 -0
- package/src/ai/export.ts +61 -0
- package/src/ai/logic.test.ts +187 -0
- package/src/ai/logic.ts +606 -0
- package/src/ai/pack.ts +121 -0
- package/src/ai/prompts.ts +87 -0
- package/src/ai/providers.ts +276 -0
- package/src/ai/queue.test.ts +97 -0
- package/src/ai/routes.ts +359 -0
- package/src/ai/store.ts +301 -0
- package/src/ai/wikidata.test.ts +184 -0
- package/src/ai/wikidata.ts +87 -0
- package/src/ai/worker.ts +530 -0
- package/src/astro/astro-modules.d.ts +6 -0
- package/src/astro/breadcrumbs/Breadcrumbs.astro +129 -0
- package/src/astro/breadcrumbs/BreadcrumbsBlock.astro +12 -0
- package/src/astro/codeBlocks/CodeBlock.astro +62 -0
- package/src/astro/codeBlocks/EmDashCode.astro +61 -0
- package/src/astro/customBlocks/CustomBlock.astro +64 -0
- package/src/astro/customBlocks/Details.astro +8 -0
- package/src/astro/customBlocks/Disclosure.astro +8 -0
- package/src/astro/customBlocks/Note.astro +8 -0
- package/src/astro/customBlocks/Podcast.astro +8 -0
- package/src/astro/customBlocks/Quote.astro +8 -0
- package/src/astro/customBlocks/Testimonial.astro +8 -0
- package/src/astro/files/FileCard.astro +103 -0
- package/src/astro/headings/HeadingBlock.astro +129 -0
- package/src/astro/headings/TableOfContents.astro +45 -0
- package/src/astro/headings/request.ts +19 -0
- package/src/astro/images/ResponsiveImage.astro +60 -0
- package/src/astro/index.ts +84 -0
- package/src/astro/reviews/CoywolfReview.astro +27 -0
- package/src/astro/reviews/Review.astro +49 -0
- package/src/astro/search/SearchBox.astro +61 -0
- package/src/astro/search/SearchBoxForm.astro +509 -0
- package/src/astro/tables/CaptionedTable.astro +72 -0
- package/src/astro/videos/CoywolfVideo.astro +448 -0
- package/src/backups/download.ts +112 -0
- package/src/backups/dump.test.mjs +287 -0
- package/src/backups/dump.ts +288 -0
- package/src/backups/module.ts +276 -0
- package/src/backups/pack.ts +33 -0
- package/src/backups/restore.test.mjs +103 -0
- package/src/backups/restore.ts +209 -0
- package/src/backups/store.ts +409 -0
- package/src/breadcrumbs/pack.ts +113 -0
- package/src/breadcrumbs/settings.ts +102 -0
- package/src/breadcrumbs/stamp.ts +40 -0
- package/src/breadcrumbs/trail.ts +123 -0
- package/src/codeBlocks/contrast.ts +179 -0
- package/src/codeBlocks/hljs.d.ts +5 -0
- package/src/codeBlocks/pack.ts +110 -0
- package/src/codeBlocks/render.test.ts +152 -0
- package/src/codeBlocks/render.ts +304 -0
- package/src/codeBlocks/settings.ts +18 -0
- package/src/codeBlocks/themes.generated.ts +304 -0
- package/src/codeBlocks/themes.ts +114 -0
- package/src/core/compose.ts +244 -0
- package/src/core/content-url.ts +888 -0
- package/src/core/csv.ts +119 -0
- package/src/core/d1-batch.ts +65 -0
- package/src/core/entry-docs.ts +175 -0
- package/src/core/features-module.ts +48 -0
- package/src/core/features.ts +392 -0
- package/src/core/generation.ts +88 -0
- package/src/core/guide-content.ts +166 -0
- package/src/core/module.ts +104 -0
- package/src/core/read-failures.ts +57 -0
- package/src/core/request-memo.ts +71 -0
- package/src/core/secrets.ts +83 -0
- package/src/core/settings-enhance.ts +74 -0
- package/src/core/site.ts +36 -0
- package/src/core/storage.ts +27 -0
- package/src/customBlocks/pack.ts +260 -0
- package/src/customBlocks/render.ts +424 -0
- package/src/customBlocks/rich.ts +313 -0
- package/src/customBlocks/settings.ts +46 -0
- package/src/discovery/build.ts +252 -0
- package/src/discovery/feed-build.ts +217 -0
- package/src/discovery/feed.ts +172 -0
- package/src/discovery/indexnow.ts +114 -0
- package/src/discovery/llms.ts +79 -0
- package/src/discovery/markdown.ts +294 -0
- package/src/discovery/memory-cache.ts +97 -0
- package/src/discovery/middleware.ts +186 -0
- package/src/discovery/module.ts +353 -0
- package/src/discovery/news.ts +99 -0
- package/src/discovery/pack.ts +58 -0
- package/src/discovery/settings.ts +91 -0
- package/src/discovery/urls.ts +35 -0
- package/src/env.d.ts +10 -0
- package/src/files/card.ts +231 -0
- package/src/files/counts.test.ts +114 -0
- package/src/files/counts.ts +60 -0
- package/src/files/export.ts +44 -0
- package/src/files/format.test.ts +93 -0
- package/src/files/format.ts +163 -0
- package/src/files/module.ts +596 -0
- package/src/files/pack.ts +92 -0
- package/src/files/r2-rules.test.ts +30 -0
- package/src/files/r2-rules.ts +41 -0
- package/src/files/range.ts +50 -0
- package/src/files/s3.ts +114 -0
- package/src/files/serve.ts +141 -0
- package/src/files/sigv4.test.ts +64 -0
- package/src/files/sigv4.ts +160 -0
- package/src/files/site.ts +137 -0
- package/src/files/walker.ts +58 -0
- package/src/formUploads/lib.ts +266 -0
- package/src/formUploads/pack.ts +55 -0
- package/src/formUploads/wrap.ts +592 -0
- package/src/forms.ts +16 -0
- package/src/headings/headings.test.ts +159 -0
- package/src/headings/pack.ts +154 -0
- package/src/headings/render.ts +139 -0
- package/src/headings/settings.ts +117 -0
- package/src/headings/slug.ts +68 -0
- package/src/headings/stamp.ts +142 -0
- package/src/headings/test-hooks.mjs +14 -0
- package/src/headings/toc.ts +48 -0
- package/src/images/cloudflare.ts +329 -0
- package/src/images/lib.ts +221 -0
- package/src/images/module.ts +372 -0
- package/src/images/pack.ts +804 -0
- package/src/images/pending.ts +37 -0
- package/src/images/settings.ts +48 -0
- package/src/images/setup.ts +192 -0
- package/src/images/variants-estimate.ts +162 -0
- package/src/images/variants-store.ts +475 -0
- package/src/images/variants.ts +311 -0
- package/src/index.ts +143 -0
- package/src/links/check.ts +101 -0
- package/src/links/classify.ts +270 -0
- package/src/links/export.ts +59 -0
- package/src/links/module.ts +652 -0
- package/src/links/pack.ts +43 -0
- package/src/links/pt.ts +325 -0
- package/src/links/store.ts +704 -0
- package/src/middleware.ts +287 -0
- package/src/modules.ts +53 -0
- package/src/options.ts +66 -0
- package/src/pageCache/lib.test.mjs +224 -0
- package/src/pageCache/lib.ts +274 -0
- package/src/pageCache/pack.ts +240 -0
- package/src/pageCache/usage-core.ts +152 -0
- package/src/pageCache/usage.ts +262 -0
- package/src/pageCache/warm.test.mjs +670 -0
- package/src/pageCache/warm.ts +722 -0
- package/src/redirects/middleware.ts +169 -0
- package/src/redirects/module.ts +124 -0
- package/src/redirects/pack.ts +89 -0
- package/src/redirects/removed-core.ts +151 -0
- package/src/redirects/removed.ts +293 -0
- package/src/redirects/rules.ts +355 -0
- package/src/redirects/slug-changes.ts +207 -0
- package/src/redirects/slug-core.test.ts +50 -0
- package/src/redirects/slug-core.ts +49 -0
- package/src/redirects/transfer.ts +92 -0
- package/src/reviews/lib.ts +624 -0
- package/src/reviews/pack.ts +135 -0
- package/src/reviews/schema.ts +128 -0
- package/src/reviews/settings.ts +26 -0
- package/src/robots/bots.ts +321 -0
- package/src/robots/data/bots.json +696 -0
- package/src/robots/data/verified.json +582 -0
- package/src/robots/directory.ts +26 -0
- package/src/robots/explain.ts +191 -0
- package/src/robots/guided.ts +300 -0
- package/src/robots/importer.ts +263 -0
- package/src/robots/middleware.ts +151 -0
- package/src/robots/module.ts +446 -0
- package/src/robots/pack.ts +69 -0
- package/src/robots/radar.ts +129 -0
- package/src/robots/rep.test.ts +335 -0
- package/src/robots/rep.ts +362 -0
- package/src/robots/rules.test.ts +251 -0
- package/src/robots/rules.ts +883 -0
- package/src/robots/transfer.ts +45 -0
- package/src/robots/validate.ts +524 -0
- package/src/schema/catalog.ts +146 -0
- package/src/schema/graph.test.mjs +522 -0
- package/src/schema/graph.ts +791 -0
- package/src/schema/module.ts +1138 -0
- package/src/schema/og-image.ts +100 -0
- package/src/schema/pack.ts +58 -0
- package/src/search/engine.ts +578 -0
- package/src/search/fallback.ts +80 -0
- package/src/search/live-cache.ts +116 -0
- package/src/search/live-client.ts +770 -0
- package/src/search/live-serve.ts +282 -0
- package/src/search/module.ts +261 -0
- package/src/search/pack.ts +57 -0
- package/src/search/query.ts +132 -0
- package/src/search/ratelimit-core.ts +118 -0
- package/src/search/ratelimit.ts +79 -0
- package/src/search/snippet.ts +135 -0
- package/src/search/title-index.ts +139 -0
- package/src/search/title-match.ts +192 -0
- package/src/shared.ts +71 -0
- package/src/version.ts +2 -0
- package/src/videos/date.ts +40 -0
- package/src/videos/engagement.ts +75 -0
- package/src/videos/lib.ts +679 -0
- package/src/videos/module.ts +1160 -0
- package/src/videos/pack.ts +187 -0
- package/src/videos/pause.ts +42 -0
- package/src/videos/poster.ts +324 -0
- package/src/videos/render.ts +336 -0
- package/src/videos/store.ts +551 -0
- package/src/videos/stream.ts +134 -0
- package/src/wpImport/convert.ts +702 -0
- package/src/wpImport/guests.ts +329 -0
- package/src/wpImport/gutenberg.ts +157 -0
- package/src/wpImport/markers.ts +66 -0
- package/src/wpImport/pack.ts +451 -0
- package/src/wpImport/parents.ts +202 -0
- package/src/wpImport/prepare.ts +592 -0
- package/src/wpImport/redirects.ts +358 -0
- package/src/wpImport/sources.ts +67 -0
- package/src/wpImport/stream.ts +160 -0
- package/src/wpImport/urls.ts +354 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// biome-ignore-all format: generated file
|
|
3
|
+
/**
|
|
4
|
+
* GENERATED by scripts/gen-code-themes.mjs from highlight.js 11.11.2
|
|
5
|
+
* (node_modules/highlight.js/styles). Do not edit by hand.
|
|
6
|
+
*
|
|
7
|
+
* Theme stylesheets are rescoped under .cw-code and minified; each theme's
|
|
8
|
+
* original header (author, license) is kept above its entry. highlight.js
|
|
9
|
+
* and its bundled themes are distributed under this license:
|
|
10
|
+
*
|
|
11
|
+
* BSD 3-Clause License
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) 2006, Ivan Sagalaev.
|
|
14
|
+
* All rights reserved.
|
|
15
|
+
*
|
|
16
|
+
* Redistribution and use in source and binary forms, with or without
|
|
17
|
+
* modification, are permitted provided that the following conditions are met:
|
|
18
|
+
*
|
|
19
|
+
* * Redistributions of source code must retain the above copyright notice, this
|
|
20
|
+
* list of conditions and the following disclaimer.
|
|
21
|
+
*
|
|
22
|
+
* * Redistributions in binary form must reproduce the above copyright notice,
|
|
23
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
24
|
+
* and/or other materials provided with the distribution.
|
|
25
|
+
*
|
|
26
|
+
* * Neither the name of the copyright holder nor the names of its
|
|
27
|
+
* contributors may be used to endorse or promote products derived from
|
|
28
|
+
* this software without specific prior written permission.
|
|
29
|
+
*
|
|
30
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
31
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
32
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
33
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
34
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
35
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
36
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
37
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
38
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
39
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
export interface HljsTheme {
|
|
43
|
+
label: string;
|
|
44
|
+
/** Background lightness, used for color-scheme and the auto pairs. */
|
|
45
|
+
scheme: "light" | "dark";
|
|
46
|
+
css: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const HLJS_THEMES: Record<string, HljsTheme> = {
|
|
50
|
+
/**
|
|
51
|
+
* highlight.js styles/github.css
|
|
52
|
+
*
|
|
53
|
+
* Theme: GitHub
|
|
54
|
+
* Description: Light theme as seen on github.com
|
|
55
|
+
* Author: github.com
|
|
56
|
+
* Maintainer: @Hirse
|
|
57
|
+
* Updated: 2021-05-15
|
|
58
|
+
*
|
|
59
|
+
* Outdated base version: https://github.com/primer/github-syntax-light
|
|
60
|
+
* Current colors taken from GitHub's CSS
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
"github": { label: "GitHub", scheme: "light", css: ".cw-code{color:#24292e;background:#ffffff}.cw-code .hljs-doctag,.cw-code .hljs-keyword,.cw-code .hljs-meta .hljs-keyword,.cw-code .hljs-template-tag,.cw-code .hljs-template-variable,.cw-code .hljs-type,.cw-code .hljs-variable.language_{color:#d73a49}.cw-code .hljs-title,.cw-code .hljs-title.class_,.cw-code .hljs-title.class_.inherited__,.cw-code .hljs-title.function_{color:#6f42c1}.cw-code .hljs-attr,.cw-code .hljs-attribute,.cw-code .hljs-literal,.cw-code .hljs-meta,.cw-code .hljs-number,.cw-code .hljs-operator,.cw-code .hljs-variable,.cw-code .hljs-selector-attr,.cw-code .hljs-selector-class,.cw-code .hljs-selector-id{color:#005cc5}.cw-code .hljs-regexp,.cw-code .hljs-string,.cw-code .hljs-meta .hljs-string{color:#032f62}.cw-code .hljs-built_in,.cw-code .hljs-symbol{color:#e36209}.cw-code .hljs-comment,.cw-code .hljs-code,.cw-code .hljs-formula{color:#6a737d}.cw-code .hljs-name,.cw-code .hljs-quote,.cw-code .hljs-selector-tag,.cw-code .hljs-selector-pseudo{color:#22863a}.cw-code .hljs-subst{color:#24292e}.cw-code .hljs-section{color:#005cc5;font-weight:bold}.cw-code .hljs-bullet{color:#735c0f}.cw-code .hljs-emphasis{color:#24292e;font-style:italic}.cw-code .hljs-strong{color:#24292e;font-weight:bold}.cw-code .hljs-addition{color:#22863a;background-color:#f0fff4}.cw-code .hljs-deletion{color:#b31d28;background-color:#ffeef0}" },
|
|
64
|
+
/**
|
|
65
|
+
* highlight.js styles/github-dark.css
|
|
66
|
+
*
|
|
67
|
+
* Theme: GitHub Dark
|
|
68
|
+
* Description: Dark theme as seen on github.com
|
|
69
|
+
* Author: github.com
|
|
70
|
+
* Maintainer: @Hirse
|
|
71
|
+
* Updated: 2021-05-15
|
|
72
|
+
*
|
|
73
|
+
* Outdated base version: https://github.com/primer/github-syntax-dark
|
|
74
|
+
* Current colors taken from GitHub's CSS
|
|
75
|
+
*
|
|
76
|
+
*/
|
|
77
|
+
"github-dark": { label: "GitHub Dark", scheme: "dark", css: ".cw-code{color:#c9d1d9;background:#0d1117}.cw-code .hljs-doctag,.cw-code .hljs-keyword,.cw-code .hljs-meta .hljs-keyword,.cw-code .hljs-template-tag,.cw-code .hljs-template-variable,.cw-code .hljs-type,.cw-code .hljs-variable.language_{color:#ff7b72}.cw-code .hljs-title,.cw-code .hljs-title.class_,.cw-code .hljs-title.class_.inherited__,.cw-code .hljs-title.function_{color:#d2a8ff}.cw-code .hljs-attr,.cw-code .hljs-attribute,.cw-code .hljs-literal,.cw-code .hljs-meta,.cw-code .hljs-number,.cw-code .hljs-operator,.cw-code .hljs-variable,.cw-code .hljs-selector-attr,.cw-code .hljs-selector-class,.cw-code .hljs-selector-id{color:#79c0ff}.cw-code .hljs-regexp,.cw-code .hljs-string,.cw-code .hljs-meta .hljs-string{color:#a5d6ff}.cw-code .hljs-built_in,.cw-code .hljs-symbol{color:#ffa657}.cw-code .hljs-comment,.cw-code .hljs-code,.cw-code .hljs-formula{color:#8b949e}.cw-code .hljs-name,.cw-code .hljs-quote,.cw-code .hljs-selector-tag,.cw-code .hljs-selector-pseudo{color:#7ee787}.cw-code .hljs-subst{color:#c9d1d9}.cw-code .hljs-section{color:#1f6feb;font-weight:bold}.cw-code .hljs-bullet{color:#f2cc60}.cw-code .hljs-emphasis{color:#c9d1d9;font-style:italic}.cw-code .hljs-strong{color:#c9d1d9;font-weight:bold}.cw-code .hljs-addition{color:#aff5b4;background-color:#033a16}.cw-code .hljs-deletion{color:#ffdcd7;background-color:#67060c}" },
|
|
78
|
+
/**
|
|
79
|
+
* highlight.js styles/github-dark-dimmed.css
|
|
80
|
+
*
|
|
81
|
+
* Theme: GitHub Dark Dimmed
|
|
82
|
+
* Description: Dark dimmed theme as seen on github.com
|
|
83
|
+
* Author: github.com
|
|
84
|
+
* Maintainer: @Hirse
|
|
85
|
+
* Updated: 2021-05-15
|
|
86
|
+
*
|
|
87
|
+
* Colors taken from GitHub's CSS
|
|
88
|
+
*
|
|
89
|
+
*/
|
|
90
|
+
"github-dark-dimmed": { label: "GitHub Dark Dimmed", scheme: "dark", css: ".cw-code{color:#adbac7;background:#22272e}.cw-code .hljs-doctag,.cw-code .hljs-keyword,.cw-code .hljs-meta .hljs-keyword,.cw-code .hljs-template-tag,.cw-code .hljs-template-variable,.cw-code .hljs-type,.cw-code .hljs-variable.language_{color:#f47067}.cw-code .hljs-title,.cw-code .hljs-title.class_,.cw-code .hljs-title.class_.inherited__,.cw-code .hljs-title.function_{color:#dcbdfb}.cw-code .hljs-attr,.cw-code .hljs-attribute,.cw-code .hljs-literal,.cw-code .hljs-meta,.cw-code .hljs-number,.cw-code .hljs-operator,.cw-code .hljs-variable,.cw-code .hljs-selector-attr,.cw-code .hljs-selector-class,.cw-code .hljs-selector-id{color:#6cb6ff}.cw-code .hljs-regexp,.cw-code .hljs-string,.cw-code .hljs-meta .hljs-string{color:#96d0ff}.cw-code .hljs-built_in,.cw-code .hljs-symbol{color:#f69d50}.cw-code .hljs-comment,.cw-code .hljs-code,.cw-code .hljs-formula{color:#768390}.cw-code .hljs-name,.cw-code .hljs-quote,.cw-code .hljs-selector-tag,.cw-code .hljs-selector-pseudo{color:#8ddb8c}.cw-code .hljs-subst{color:#adbac7}.cw-code .hljs-section{color:#316dca;font-weight:bold}.cw-code .hljs-bullet{color:#eac55f}.cw-code .hljs-emphasis{color:#adbac7;font-style:italic}.cw-code .hljs-strong{color:#adbac7;font-weight:bold}.cw-code .hljs-addition{color:#b4f1b4;background-color:#1b4721}.cw-code .hljs-deletion{color:#ffd8d3;background-color:#78191b}" },
|
|
91
|
+
/**
|
|
92
|
+
* highlight.js styles/atom-one-light.css
|
|
93
|
+
*
|
|
94
|
+
*
|
|
95
|
+
* Atom One Light by Daniel Gamage
|
|
96
|
+
* Original One Light Syntax theme from https://github.com/atom/one-light-syntax
|
|
97
|
+
*
|
|
98
|
+
* base: #fafafa
|
|
99
|
+
* mono-1: #383a42
|
|
100
|
+
* mono-2: #686b77
|
|
101
|
+
* mono-3: #a0a1a7
|
|
102
|
+
* hue-1: #0184bb
|
|
103
|
+
* hue-2: #4078f2
|
|
104
|
+
* hue-3: #a626a4
|
|
105
|
+
* hue-4: #50a14f
|
|
106
|
+
* hue-5: #e45649
|
|
107
|
+
* hue-5-2: #c91243
|
|
108
|
+
* hue-6: #986801
|
|
109
|
+
* hue-6-2: #c18401
|
|
110
|
+
*
|
|
111
|
+
*
|
|
112
|
+
*/
|
|
113
|
+
"atom-one-light": { label: "Atom One Light", scheme: "light", css: ".cw-code{color:#383a42;background:#fafafa}.cw-code .hljs-comment,.cw-code .hljs-quote{color:#a0a1a7;font-style:italic}.cw-code .hljs-doctag,.cw-code .hljs-keyword,.cw-code .hljs-formula{color:#a626a4}.cw-code .hljs-section,.cw-code .hljs-name,.cw-code .hljs-selector-tag,.cw-code .hljs-deletion,.cw-code .hljs-subst{color:#e45649}.cw-code .hljs-literal{color:#0184bb}.cw-code .hljs-string,.cw-code .hljs-regexp,.cw-code .hljs-addition,.cw-code .hljs-attribute,.cw-code .hljs-meta .hljs-string{color:#50a14f}.cw-code .hljs-attr,.cw-code .hljs-variable,.cw-code .hljs-template-variable,.cw-code .hljs-type,.cw-code .hljs-selector-class,.cw-code .hljs-selector-attr,.cw-code .hljs-selector-pseudo,.cw-code .hljs-number{color:#986801}.cw-code .hljs-symbol,.cw-code .hljs-bullet,.cw-code .hljs-link,.cw-code .hljs-meta,.cw-code .hljs-selector-id,.cw-code .hljs-title{color:#4078f2}.cw-code .hljs-built_in,.cw-code .hljs-title.class_,.cw-code .hljs-class .hljs-title{color:#c18401}.cw-code .hljs-emphasis{font-style:italic}.cw-code .hljs-strong{font-weight:bold}.cw-code .hljs-link{text-decoration:underline}" },
|
|
114
|
+
/**
|
|
115
|
+
* highlight.js styles/atom-one-dark.css
|
|
116
|
+
*
|
|
117
|
+
*
|
|
118
|
+
* Atom One Dark by Daniel Gamage
|
|
119
|
+
* Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
|
|
120
|
+
*
|
|
121
|
+
* base: #282c34
|
|
122
|
+
* mono-1: #abb2bf
|
|
123
|
+
* mono-2: #818896
|
|
124
|
+
* mono-3: #5c6370
|
|
125
|
+
* hue-1: #56b6c2
|
|
126
|
+
* hue-2: #61aeee
|
|
127
|
+
* hue-3: #c678dd
|
|
128
|
+
* hue-4: #98c379
|
|
129
|
+
* hue-5: #e06c75
|
|
130
|
+
* hue-5-2: #be5046
|
|
131
|
+
* hue-6: #d19a66
|
|
132
|
+
* hue-6-2: #e6c07b
|
|
133
|
+
*
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
"atom-one-dark": { label: "Atom One Dark", scheme: "dark", css: ".cw-code{color:#abb2bf;background:#282c34}.cw-code .hljs-comment,.cw-code .hljs-quote{color:#5c6370;font-style:italic}.cw-code .hljs-doctag,.cw-code .hljs-keyword,.cw-code .hljs-formula{color:#c678dd}.cw-code .hljs-section,.cw-code .hljs-name,.cw-code .hljs-selector-tag,.cw-code .hljs-deletion,.cw-code .hljs-subst{color:#e06c75}.cw-code .hljs-literal{color:#56b6c2}.cw-code .hljs-string,.cw-code .hljs-regexp,.cw-code .hljs-addition,.cw-code .hljs-attribute,.cw-code .hljs-meta .hljs-string{color:#98c379}.cw-code .hljs-attr,.cw-code .hljs-variable,.cw-code .hljs-template-variable,.cw-code .hljs-type,.cw-code .hljs-selector-class,.cw-code .hljs-selector-attr,.cw-code .hljs-selector-pseudo,.cw-code .hljs-number{color:#d19a66}.cw-code .hljs-symbol,.cw-code .hljs-bullet,.cw-code .hljs-link,.cw-code .hljs-meta,.cw-code .hljs-selector-id,.cw-code .hljs-title{color:#61aeee}.cw-code .hljs-built_in,.cw-code .hljs-title.class_,.cw-code .hljs-class .hljs-title{color:#e6c07b}.cw-code .hljs-emphasis{font-style:italic}.cw-code .hljs-strong{font-weight:bold}.cw-code .hljs-link{text-decoration:underline}" },
|
|
137
|
+
/**
|
|
138
|
+
* highlight.js styles/a11y-light.css
|
|
139
|
+
*
|
|
140
|
+
* Theme: a11y-light
|
|
141
|
+
* Author: @ericwbailey
|
|
142
|
+
* Maintainer: @ericwbailey
|
|
143
|
+
*
|
|
144
|
+
* Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css
|
|
145
|
+
*
|
|
146
|
+
*/
|
|
147
|
+
"a11y-light": { label: "A11y Light", scheme: "light", css: ".cw-code{background:#fefefe;color:#545454}.cw-code .hljs-comment,.cw-code .hljs-quote{color:#696969}.cw-code .hljs-variable,.cw-code .hljs-template-variable,.cw-code .hljs-tag,.cw-code .hljs-name,.cw-code .hljs-selector-id,.cw-code .hljs-selector-class,.cw-code .hljs-regexp,.cw-code .hljs-deletion{color:#d91e18}.cw-code .hljs-number,.cw-code .hljs-built_in,.cw-code .hljs-literal,.cw-code .hljs-type,.cw-code .hljs-params,.cw-code .hljs-meta,.cw-code .hljs-link{color:#aa5d00}.cw-code .hljs-attribute{color:#aa5d00}.cw-code .hljs-string,.cw-code .hljs-symbol,.cw-code .hljs-bullet,.cw-code .hljs-addition{color:#008000}.cw-code .hljs-title,.cw-code .hljs-section{color:#007faa}.cw-code .hljs-keyword,.cw-code .hljs-selector-tag{color:#7928a1}.cw-code .hljs-emphasis{font-style:italic}.cw-code .hljs-strong{font-weight:bold}" },
|
|
148
|
+
/**
|
|
149
|
+
* highlight.js styles/a11y-dark.css
|
|
150
|
+
*
|
|
151
|
+
* Theme: a11y-dark
|
|
152
|
+
* Author: @ericwbailey
|
|
153
|
+
* Maintainer: @ericwbailey
|
|
154
|
+
*
|
|
155
|
+
* Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css
|
|
156
|
+
*
|
|
157
|
+
*/
|
|
158
|
+
"a11y-dark": { label: "A11y Dark", scheme: "dark", css: ".cw-code{background:#2b2b2b;color:#f8f8f2}.cw-code .hljs-comment,.cw-code .hljs-quote{color:#d4d0ab}.cw-code .hljs-variable,.cw-code .hljs-template-variable,.cw-code .hljs-tag,.cw-code .hljs-name,.cw-code .hljs-selector-id,.cw-code .hljs-selector-class,.cw-code .hljs-regexp,.cw-code .hljs-deletion{color:#ffa07a}.cw-code .hljs-number,.cw-code .hljs-built_in,.cw-code .hljs-literal,.cw-code .hljs-type,.cw-code .hljs-params,.cw-code .hljs-meta,.cw-code .hljs-link{color:#f5ab35}.cw-code .hljs-attribute{color:#ffd700}.cw-code .hljs-string,.cw-code .hljs-symbol,.cw-code .hljs-bullet,.cw-code .hljs-addition{color:#abe338}.cw-code .hljs-title,.cw-code .hljs-section{color:#00e0e0}.cw-code .hljs-keyword,.cw-code .hljs-selector-tag{color:#dcc6e0}.cw-code .hljs-emphasis{font-style:italic}.cw-code .hljs-strong{font-weight:bold}" },
|
|
159
|
+
/**
|
|
160
|
+
* highlight.js styles/vs.css
|
|
161
|
+
*
|
|
162
|
+
*
|
|
163
|
+
* Visual Studio-like style based on original C# coloring by Jason Diamond <jason@diamond.name>
|
|
164
|
+
*
|
|
165
|
+
*
|
|
166
|
+
*/
|
|
167
|
+
"vs": { label: "Visual Studio", scheme: "light", css: ".cw-code{background:white;color:black}.cw-code .hljs-comment,.cw-code .hljs-quote,.cw-code .hljs-variable{color:#008000}.cw-code .hljs-keyword,.cw-code .hljs-selector-tag,.cw-code .hljs-built_in,.cw-code .hljs-name,.cw-code .hljs-tag{color:#00f}.cw-code .hljs-string,.cw-code .hljs-title,.cw-code .hljs-section,.cw-code .hljs-attribute,.cw-code .hljs-literal,.cw-code .hljs-template-tag,.cw-code .hljs-template-variable,.cw-code .hljs-type,.cw-code .hljs-addition{color:#a31515}.cw-code .hljs-deletion,.cw-code .hljs-selector-attr,.cw-code .hljs-selector-pseudo,.cw-code .hljs-meta{color:#2b91af}.cw-code .hljs-doctag{color:#808080}.cw-code .hljs-attr{color:#f00}.cw-code .hljs-symbol,.cw-code .hljs-bullet,.cw-code .hljs-link{color:#00b0e8}.cw-code .hljs-emphasis{font-style:italic}.cw-code .hljs-strong{font-weight:bold}" },
|
|
168
|
+
/**
|
|
169
|
+
* highlight.js styles/vs2015.css
|
|
170
|
+
*
|
|
171
|
+
* Visual Studio 2015 dark style
|
|
172
|
+
* Author: Nicolas LLOBERA <nllobera@gmail.com>
|
|
173
|
+
*
|
|
174
|
+
*/
|
|
175
|
+
"vs2015": { label: "Visual Studio 2015 (dark)", scheme: "dark", css: ".cw-code{background:#1E1E1E;color:#DCDCDC}.cw-code .hljs-keyword,.cw-code .hljs-literal,.cw-code .hljs-symbol,.cw-code .hljs-name{color:#569CD6}.cw-code .hljs-link{color:#569CD6;text-decoration:underline}.cw-code .hljs-built_in,.cw-code .hljs-type{color:#4EC9B0}.cw-code .hljs-number,.cw-code .hljs-class{color:#B8D7A3}.cw-code .hljs-string,.cw-code .hljs-meta .hljs-string{color:#D69D85}.cw-code .hljs-regexp,.cw-code .hljs-template-tag{color:#9A5334}.cw-code .hljs-subst,.cw-code .hljs-function,.cw-code .hljs-title,.cw-code .hljs-params,.cw-code .hljs-formula{color:#DCDCDC}.cw-code .hljs-comment,.cw-code .hljs-quote{color:#57A64A;font-style:italic}.cw-code .hljs-doctag{color:#608B4E}.cw-code .hljs-meta,.cw-code .hljs-meta .hljs-keyword,.cw-code .hljs-tag{color:#9B9B9B}.cw-code .hljs-variable,.cw-code .hljs-template-variable{color:#BD63C5}.cw-code .hljs-attr,.cw-code .hljs-attribute{color:#9CDCFE}.cw-code .hljs-section{color:gold}.cw-code .hljs-emphasis{font-style:italic}.cw-code .hljs-strong{font-weight:bold}.cw-code .hljs-bullet,.cw-code .hljs-selector-tag,.cw-code .hljs-selector-id,.cw-code .hljs-selector-class,.cw-code .hljs-selector-attr,.cw-code .hljs-selector-pseudo{color:#D7BA7D}.cw-code .hljs-addition{background-color:#144212}.cw-code .hljs-deletion{background-color:#600}" },
|
|
176
|
+
/**
|
|
177
|
+
* highlight.js styles/xcode.css
|
|
178
|
+
*
|
|
179
|
+
*
|
|
180
|
+
* XCode style (c) Angel Garcia <angelgarcia.mail@gmail.com>
|
|
181
|
+
*
|
|
182
|
+
*
|
|
183
|
+
*/
|
|
184
|
+
"xcode": { label: "Xcode", scheme: "light", css: ".cw-code{background:#fff;color:black}.cw-code .xml .hljs-meta{color:#c0c0c0}.cw-code .hljs-comment,.cw-code .hljs-quote{color:#007400}.cw-code .hljs-tag,.cw-code .hljs-attribute,.cw-code .hljs-keyword,.cw-code .hljs-selector-tag,.cw-code .hljs-literal,.cw-code .hljs-name{color:#aa0d91}.cw-code .hljs-variable,.cw-code .hljs-template-variable{color:#3F6E74}.cw-code .hljs-code,.cw-code .hljs-string,.cw-code .hljs-meta .hljs-string{color:#c41a16}.cw-code .hljs-regexp,.cw-code .hljs-link{color:#0E0EFF}.cw-code .hljs-title,.cw-code .hljs-symbol,.cw-code .hljs-bullet,.cw-code .hljs-number{color:#1c00cf}.cw-code .hljs-section,.cw-code .hljs-meta{color:#643820}.cw-code .hljs-title.class_,.cw-code .hljs-class .hljs-title,.cw-code .hljs-type,.cw-code .hljs-built_in,.cw-code .hljs-params{color:#5c2699}.cw-code .hljs-attr{color:#836C28}.cw-code .hljs-subst{color:#000}.cw-code .hljs-formula{background-color:#eee;font-style:italic}.cw-code .hljs-addition{background-color:#baeeba}.cw-code .hljs-deletion{background-color:#ffc8bd}.cw-code .hljs-selector-id,.cw-code .hljs-selector-class{color:#9b703f}.cw-code .hljs-doctag,.cw-code .hljs-strong{font-weight:bold}.cw-code .hljs-emphasis{font-style:italic}" },
|
|
185
|
+
/**
|
|
186
|
+
* highlight.js styles/monokai.css
|
|
187
|
+
*
|
|
188
|
+
* Monokai style - ported by Luigi Maselli - http://grigio.org
|
|
189
|
+
*
|
|
190
|
+
*/
|
|
191
|
+
"monokai": { label: "Monokai", scheme: "dark", css: ".cw-code{background:#272822;color:#ddd}.cw-code .hljs-tag,.cw-code .hljs-keyword,.cw-code .hljs-selector-tag,.cw-code .hljs-literal,.cw-code .hljs-strong,.cw-code .hljs-number,.cw-code .hljs-name{color:#f92672}.cw-code .hljs-code{color:#66d9ef}.cw-code .hljs-attribute,.cw-code .hljs-attr,.cw-code .hljs-symbol,.cw-code .hljs-regexp,.cw-code .hljs-link{color:#bf79db}.cw-code .hljs-string,.cw-code .hljs-bullet,.cw-code .hljs-subst,.cw-code .hljs-title,.cw-code .hljs-section,.cw-code .hljs-emphasis,.cw-code .hljs-type,.cw-code .hljs-built_in,.cw-code .hljs-selector-attr,.cw-code .hljs-selector-pseudo,.cw-code .hljs-addition,.cw-code .hljs-variable,.cw-code .hljs-template-tag,.cw-code .hljs-template-variable{color:#a6e22e}.cw-code .hljs-title.class_,.cw-code .hljs-class .hljs-title{color:white}.cw-code .hljs-comment,.cw-code .hljs-quote,.cw-code .hljs-deletion,.cw-code .hljs-meta{color:#75715e}.cw-code .hljs-keyword,.cw-code .hljs-selector-tag,.cw-code .hljs-literal,.cw-code .hljs-doctag,.cw-code .hljs-title,.cw-code .hljs-section,.cw-code .hljs-type,.cw-code .hljs-selector-id{font-weight:bold}" },
|
|
192
|
+
/**
|
|
193
|
+
* highlight.js styles/nord.css
|
|
194
|
+
*
|
|
195
|
+
* Copyright (c) 2017-present Arctic Ice Studio <development@arcticicestudio.com>
|
|
196
|
+
* Copyright (c) 2017-present Sven Greb <development@svengreb.de>
|
|
197
|
+
*
|
|
198
|
+
* Project: Nord highlight.js
|
|
199
|
+
* Version: 0.1.0
|
|
200
|
+
* Repository: https://github.com/arcticicestudio/nord-highlightjs
|
|
201
|
+
* License: MIT
|
|
202
|
+
* References:
|
|
203
|
+
* https://github.com/arcticicestudio/nord
|
|
204
|
+
*
|
|
205
|
+
*/
|
|
206
|
+
"nord": { label: "Nord", scheme: "dark", css: ".cw-code{background:#2E3440}.cw-code,.cw-code .hljs-subst{color:#D8DEE9}.cw-code .hljs-selector-tag{color:#81A1C1}.cw-code .hljs-selector-id{color:#8FBCBB;font-weight:bold}.cw-code .hljs-selector-class{color:#8FBCBB}.cw-code .hljs-selector-attr{color:#8FBCBB}.cw-code .hljs-property{color:#88C0D0}.cw-code .hljs-selector-pseudo{color:#88C0D0}.cw-code .hljs-addition{background-color:rgba(163, 190, 140, 0.5)}.cw-code .hljs-deletion{background-color:rgba(191, 97, 106, 0.5)}.cw-code .hljs-built_in,.cw-code .hljs-type{color:#8FBCBB}.cw-code .hljs-class{color:#8FBCBB}.cw-code .hljs-function{color:#88C0D0}.cw-code .hljs-title.hljs-function,.cw-code .hljs-function > .hljs-title{color:#88C0D0}.cw-code .hljs-keyword,.cw-code .hljs-literal,.cw-code .hljs-symbol{color:#81A1C1}.cw-code .hljs-number{color:#B48EAD}.cw-code .hljs-regexp{color:#EBCB8B}.cw-code .hljs-string{color:#A3BE8C}.cw-code .hljs-title{color:#8FBCBB}.cw-code .hljs-params{color:#D8DEE9}.cw-code .hljs-bullet{color:#81A1C1}.cw-code .hljs-code{color:#8FBCBB}.cw-code .hljs-emphasis{font-style:italic}.cw-code .hljs-formula{color:#8FBCBB}.cw-code .hljs-strong{font-weight:bold}.cw-code .hljs-link:hover{text-decoration:underline}.cw-code .hljs-quote{color:#4C566A}.cw-code .hljs-comment{color:#4C566A}.cw-code .hljs-doctag{color:#8FBCBB}.cw-code .hljs-meta,.cw-code .hljs-meta .hljs-keyword{color:#5E81AC}.cw-code .hljs-meta .hljs-string{color:#A3BE8C}.cw-code .hljs-attr{color:#8FBCBB}.cw-code .hljs-attribute{color:#D8DEE9}.cw-code .hljs-name{color:#81A1C1}.cw-code .hljs-section{color:#88C0D0}.cw-code .hljs-tag{color:#81A1C1}.cw-code .hljs-variable{color:#D8DEE9}.cw-code .hljs-template-variable{color:#D8DEE9}.cw-code .hljs-template-tag{color:#5E81AC}.cw-code .language-abnf .hljs-attribute{color:#88C0D0}.cw-code .language-abnf .hljs-symbol{color:#EBCB8B}.cw-code .language-apache .hljs-attribute{color:#88C0D0}.cw-code .language-apache .hljs-section{color:#81A1C1}.cw-code .language-arduino .hljs-built_in{color:#88C0D0}.cw-code .language-aspectj .hljs-meta{color:#D08770}.cw-code .language-aspectj > .hljs-title{color:#88C0D0}.cw-code .language-bnf .hljs-attribute{color:#8FBCBB}.cw-code .language-clojure .hljs-name{color:#88C0D0}.cw-code .language-clojure .hljs-symbol{color:#EBCB8B}.cw-code .language-coq .hljs-built_in{color:#88C0D0}.cw-code .language-cpp .hljs-meta .hljs-string{color:#8FBCBB}.cw-code .language-css .hljs-built_in{color:#88C0D0}.cw-code .language-css .hljs-keyword{color:#D08770}.cw-code .language-diff .hljs-meta{color:#8FBCBB}.cw-code .language-ebnf .hljs-attribute{color:#8FBCBB}.cw-code .language-glsl .hljs-built_in{color:#88C0D0}.cw-code .language-groovy .hljs-meta:not(:first-child){color:#D08770}.cw-code .language-haxe .hljs-meta{color:#D08770}.cw-code .language-java .hljs-meta{color:#D08770}.cw-code .language-ldif .hljs-attribute{color:#8FBCBB}.cw-code .language-lisp .hljs-name{color:#88C0D0}.cw-code .language-lua .hljs-built_in{color:#88C0D0}.cw-code .language-moonscript .hljs-built_in{color:#88C0D0}.cw-code .language-nginx .hljs-attribute{color:#88C0D0}.cw-code .language-nginx .hljs-section{color:#5E81AC}.cw-code .language-pf .hljs-built_in{color:#88C0D0}.cw-code .language-processing .hljs-built_in{color:#88C0D0}.cw-code .language-scss .hljs-keyword{color:#81A1C1}.cw-code .language-stylus .hljs-keyword{color:#81A1C1}.cw-code .language-swift .hljs-meta{color:#D08770}.cw-code .language-vim .hljs-built_in{color:#88C0D0;font-style:italic}.cw-code .language-yaml .hljs-meta{color:#D08770}" },
|
|
207
|
+
/**
|
|
208
|
+
* highlight.js styles/night-owl.css
|
|
209
|
+
*
|
|
210
|
+
*
|
|
211
|
+
* Night Owl for highlight.js (c) Carl Baxter <carl@cbax.tech>
|
|
212
|
+
*
|
|
213
|
+
* An adaptation of Sarah Drasner's Night Owl VS Code Theme
|
|
214
|
+
* https://github.com/sdras/night-owl-vscode-theme
|
|
215
|
+
*
|
|
216
|
+
* Copyright (c) 2018 Sarah Drasner
|
|
217
|
+
*
|
|
218
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
219
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
220
|
+
* in the Software without restriction, including without limitation the rights
|
|
221
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
222
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
223
|
+
* furnished to do so, subject to the following conditions:
|
|
224
|
+
*
|
|
225
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
226
|
+
* copies or substantial portions of the Software.
|
|
227
|
+
*
|
|
228
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
229
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
230
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
231
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
232
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
233
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
234
|
+
* SOFTWARE.
|
|
235
|
+
*
|
|
236
|
+
*
|
|
237
|
+
*/
|
|
238
|
+
"night-owl": { label: "Night Owl", scheme: "dark", css: ".cw-code{background:#011627;color:#d6deeb}.cw-code .hljs-keyword{color:#c792ea;font-style:italic}.cw-code .hljs-built_in{color:#addb67;font-style:italic}.cw-code .hljs-type{color:#82aaff}.cw-code .hljs-literal{color:#ff5874}.cw-code .hljs-number{color:#F78C6C}.cw-code .hljs-regexp{color:#5ca7e4}.cw-code .hljs-string{color:#ecc48d}.cw-code .hljs-subst{color:#d3423e}.cw-code .hljs-symbol{color:#82aaff}.cw-code .hljs-class{color:#ffcb8b}.cw-code .hljs-function{color:#82AAFF}.cw-code .hljs-title{color:#DCDCAA;font-style:italic}.cw-code .hljs-params{color:#7fdbca}.cw-code .hljs-comment{color:#637777;font-style:italic}.cw-code .hljs-doctag{color:#7fdbca}.cw-code .hljs-meta{color:#82aaff}.cw-code .hljs-meta .hljs-keyword{color:#82aaff}.cw-code .hljs-meta .hljs-string{color:#ecc48d}.cw-code .hljs-section{color:#82b1ff}.cw-code .hljs-tag,.cw-code .hljs-name{color:#7fdbca}.cw-code .hljs-attr{color:#7fdbca}.cw-code .hljs-attribute{color:#80cbc4}.cw-code .hljs-variable{color:#addb67}.cw-code .hljs-bullet{color:#d9f5dd}.cw-code .hljs-code{color:#80CBC4}.cw-code .hljs-emphasis{color:#c792ea;font-style:italic}.cw-code .hljs-strong{color:#addb67;font-weight:bold}.cw-code .hljs-formula{color:#c792ea}.cw-code .hljs-link{color:#ff869a}.cw-code .hljs-quote{color:#697098;font-style:italic}.cw-code .hljs-selector-tag{color:#ff6363}.cw-code .hljs-selector-id{color:#fad430}.cw-code .hljs-selector-class{color:#addb67;font-style:italic}.cw-code .hljs-selector-attr,.cw-code .hljs-selector-pseudo{color:#c792ea;font-style:italic}.cw-code .hljs-template-tag{color:#c792ea}.cw-code .hljs-template-variable{color:#addb67}.cw-code .hljs-addition{color:#addb67ff;font-style:italic}.cw-code .hljs-deletion{color:#EF535090;font-style:italic}" },
|
|
239
|
+
/**
|
|
240
|
+
* highlight.js styles/tokyo-night-light.css
|
|
241
|
+
*
|
|
242
|
+
* Theme: Tokyo-night-light
|
|
243
|
+
* origin: https://github.com/enkia/tokyo-night-vscode-theme
|
|
244
|
+
* Description: Original highlight.js style
|
|
245
|
+
* Author: (c) Henri Vandersleyen <hvandersleyen@gmail.com>
|
|
246
|
+
* License: see project LICENSE
|
|
247
|
+
* Touched: 2022
|
|
248
|
+
*
|
|
249
|
+
*/
|
|
250
|
+
"tokyo-night-light": { label: "Tokyo Night Light", scheme: "light", css: ".cw-code .hljs-meta,.cw-code .hljs-comment{color:#9699a3}.cw-code .hljs-tag,.cw-code .hljs-doctag,.cw-code .hljs-selector-id,.cw-code .hljs-selector-class,.cw-code .hljs-regexp,.cw-code .hljs-template-tag,.cw-code .hljs-selector-pseudo,.cw-code .hljs-selector-attr,.cw-code .hljs-variable.language_,.cw-code .hljs-deletion{color:#8c4351}.cw-code .hljs-variable,.cw-code .hljs-template-variable,.cw-code .hljs-number,.cw-code .hljs-literal,.cw-code .hljs-type,.cw-code .hljs-params,.cw-code .hljs-link{color:#965027}.cw-code .hljs-built_in,.cw-code .hljs-attribute{color:#8f5e15}.cw-code .hljs-selector-tag{color:#166775}.cw-code .hljs-keyword,.cw-code .hljs-title.function_,.cw-code .hljs-title,.cw-code .hljs-title.class_,.cw-code .hljs-title.class_.inherited__,.cw-code .hljs-subst,.cw-code .hljs-property{color:#0f4b6e}.cw-code .hljs-selector-tag{color:#33635c}.cw-code .hljs-quote,.cw-code .hljs-string,.cw-code .hljs-symbol,.cw-code .hljs-bullet,.cw-code .hljs-addition{color:#485e30}.cw-code .hljs-code,.cw-code .hljs-formula,.cw-code .hljs-section{color:#34548a}.cw-code .hljs-name,.cw-code .hljs-keyword,.cw-code .hljs-operator,.cw-code .hljs-keyword,.cw-code .hljs-char.escape_,.cw-code .hljs-attr{color:#5a4a78}.cw-code .hljs-punctuation{color:#343b58}.cw-code{background:#d5d6db;color:#565a6e}.cw-code .hljs-emphasis{font-style:italic}.cw-code .hljs-strong{font-weight:bold}" },
|
|
251
|
+
/**
|
|
252
|
+
* highlight.js styles/tokyo-night-dark.css
|
|
253
|
+
*
|
|
254
|
+
* Theme: Tokyo-night-Dark
|
|
255
|
+
* origin: https://github.com/enkia/tokyo-night-vscode-theme
|
|
256
|
+
* Description: Original highlight.js style
|
|
257
|
+
* Author: (c) Henri Vandersleyen <hvandersleyen@gmail.com>
|
|
258
|
+
* License: see project LICENSE
|
|
259
|
+
* Touched: 2022
|
|
260
|
+
*
|
|
261
|
+
*/
|
|
262
|
+
"tokyo-night-dark": { label: "Tokyo Night Dark", scheme: "dark", css: ".cw-code .hljs-meta,.cw-code .hljs-comment{color:#565f89}.cw-code .hljs-tag,.cw-code .hljs-doctag,.cw-code .hljs-selector-id,.cw-code .hljs-selector-class,.cw-code .hljs-regexp,.cw-code .hljs-template-tag,.cw-code .hljs-selector-pseudo,.cw-code .hljs-selector-attr,.cw-code .hljs-variable.language_,.cw-code .hljs-deletion{color:#f7768e}.cw-code .hljs-variable,.cw-code .hljs-template-variable,.cw-code .hljs-number,.cw-code .hljs-literal,.cw-code .hljs-type,.cw-code .hljs-params,.cw-code .hljs-link{color:#ff9e64}.cw-code .hljs-built_in,.cw-code .hljs-attribute{color:#e0af68}.cw-code .hljs-selector-tag{color:#2ac3de}.cw-code .hljs-keyword,.cw-code .hljs-title.function_,.cw-code .hljs-title,.cw-code .hljs-title.class_,.cw-code .hljs-title.class_.inherited__,.cw-code .hljs-subst,.cw-code .hljs-property{color:#7dcfff}.cw-code .hljs-selector-tag{color:#73daca}.cw-code .hljs-quote,.cw-code .hljs-string,.cw-code .hljs-symbol,.cw-code .hljs-bullet,.cw-code .hljs-addition{color:#9ece6a}.cw-code .hljs-code,.cw-code .hljs-formula,.cw-code .hljs-section{color:#7aa2f7}.cw-code .hljs-name,.cw-code .hljs-keyword,.cw-code .hljs-operator,.cw-code .hljs-keyword,.cw-code .hljs-char.escape_,.cw-code .hljs-attr{color:#bb9af7}.cw-code .hljs-punctuation{color:#c0caf5}.cw-code{background:#1a1b26;color:#9aa5ce}.cw-code .hljs-emphasis{font-style:italic}.cw-code .hljs-strong{font-weight:bold}" },
|
|
263
|
+
/**
|
|
264
|
+
* highlight.js styles/rose-pine.css
|
|
265
|
+
*
|
|
266
|
+
* Theme: Rose Pine
|
|
267
|
+
* Origin: https://rosepinetheme.com/
|
|
268
|
+
*
|
|
269
|
+
*/
|
|
270
|
+
"rose-pine": { label: "Rosé Pine", scheme: "dark", css: ".cw-code .hljs-meta,.cw-code .hljs-comment{color:#6e6a86}.cw-code .hljs-tag,.cw-code .hljs-doctag,.cw-code .hljs-selector-id,.cw-code .hljs-selector-class,.cw-code .hljs-regexp,.cw-code .hljs-template-tag,.cw-code .hljs-selector-pseudo,.cw-code .hljs-selector-attr,.cw-code .hljs-variable.language_,.cw-code .hljs-deletion{color:#eb6f92}.cw-code .hljs-variable,.cw-code .hljs-template-variable,.cw-code .hljs-number,.cw-code .hljs-literal,.cw-code .hljs-type,.cw-code .hljs-params,.cw-code .hljs-link{color:#ebbcba}.cw-code .hljs-built_in,.cw-code .hljs-attribute{color:#f6c177}.cw-code .hljs-selector-tag{color:#31748f}.cw-code .hljs-keyword,.cw-code .hljs-title.function_,.cw-code .hljs-title,.cw-code .hljs-title.class_,.cw-code .hljs-title.class_.inherited__,.cw-code .hljs-subst,.cw-code .hljs-property{color:#9ccfd8}.cw-code .hljs-selector-tag{color:#9ccfd8}.cw-code .hljs-quote,.cw-code .hljs-string,.cw-code .hljs-symbol,.cw-code .hljs-bullet,.cw-code .hljs-addition{color:#31748f}.cw-code .hljs-code,.cw-code .hljs-formula,.cw-code .hljs-section{color:#ebbcba}.cw-code .hljs-name,.cw-code .hljs-keyword,.cw-code .hljs-operator,.cw-code .hljs-keyword,.cw-code .hljs-char.escape_,.cw-code .hljs-attr{color:#c4a7e7}.cw-code .hljs-punctuation{color:#e0def4}.cw-code{background:#191724;color:#6e6a86}.cw-code .hljs-emphasis{font-style:italic}.cw-code .hljs-strong{font-weight:bold}" },
|
|
271
|
+
/**
|
|
272
|
+
* highlight.js styles/base16/dracula.css
|
|
273
|
+
*
|
|
274
|
+
* Theme: Dracula
|
|
275
|
+
* Author: Mike Barkmin (http://github.com/mikebarkmin) based on Dracula Theme (http://github.com/dracula)
|
|
276
|
+
* License: ~ MIT (or more permissive) [via base16-schemes-source]
|
|
277
|
+
* Maintainer: @highlightjs/core-team
|
|
278
|
+
* Version: 2021.09.0
|
|
279
|
+
*
|
|
280
|
+
*/
|
|
281
|
+
"dracula": { label: "Dracula", scheme: "dark", css: ".cw-code{color:#e9e9f4;background:#282936}.cw-code::selection,.cw-code ::selection{background-color:#4d4f68;color:#e9e9f4}.cw-code .hljs-comment{color:#626483}.cw-code .hljs-tag{color:#62d6e8}.cw-code .hljs-subst,.cw-code .hljs-punctuation,.cw-code .hljs-operator{color:#e9e9f4}.cw-code .hljs-operator{opacity:0.7}.cw-code .hljs-bullet,.cw-code .hljs-variable,.cw-code .hljs-template-variable,.cw-code .hljs-selector-tag,.cw-code .hljs-name,.cw-code .hljs-deletion{color:#ea51b2}.cw-code .hljs-symbol,.cw-code .hljs-number,.cw-code .hljs-link,.cw-code .hljs-attr,.cw-code .hljs-variable.constant_,.cw-code .hljs-literal{color:#b45bcf}.cw-code .hljs-title,.cw-code .hljs-class .hljs-title,.cw-code .hljs-title.class_{color:#00f769}.cw-code .hljs-strong{font-weight:bold;color:#00f769}.cw-code .hljs-code,.cw-code .hljs-addition,.cw-code .hljs-title.class_.inherited__,.cw-code .hljs-string{color:#ebff87}.cw-code .hljs-built_in,.cw-code .hljs-doctag,.cw-code .hljs-quote,.cw-code .hljs-keyword.hljs-atrule,.cw-code .hljs-regexp{color:#a1efe4}.cw-code .hljs-function .hljs-title,.cw-code .hljs-attribute,.cw-code .ruby .hljs-property,.cw-code .hljs-title.function_,.cw-code .hljs-section{color:#62d6e8}.cw-code .hljs-type,.cw-code .hljs-template-tag,.cw-code .diff .hljs-meta,.cw-code .hljs-keyword{color:#b45bcf}.cw-code .hljs-emphasis{color:#b45bcf;font-style:italic}.cw-code .hljs-meta,.cw-code .hljs-meta .hljs-keyword,.cw-code .hljs-meta .hljs-string{color:#00f769}.cw-code .hljs-meta .hljs-keyword,.cw-code .hljs-meta-keyword{font-weight:bold}" },
|
|
282
|
+
/**
|
|
283
|
+
* highlight.js styles/base16/solarized-light.css
|
|
284
|
+
*
|
|
285
|
+
* Theme: Solarized Light
|
|
286
|
+
* Author: Ethan Schoonover (modified by aramisgithub)
|
|
287
|
+
* License: ~ MIT (or more permissive) [via base16-schemes-source]
|
|
288
|
+
* Maintainer: @highlightjs/core-team
|
|
289
|
+
* Version: 2021.09.0
|
|
290
|
+
*
|
|
291
|
+
*/
|
|
292
|
+
"solarized-light": { label: "Solarized Light", scheme: "light", css: ".cw-code{color:#586e75;background:#fdf6e3}.cw-code::selection,.cw-code ::selection{background-color:#93a1a1;color:#586e75}.cw-code .hljs-comment{color:#839496}.cw-code .hljs-tag{color:#657b83}.cw-code .hljs-subst,.cw-code .hljs-punctuation,.cw-code .hljs-operator{color:#586e75}.cw-code .hljs-operator{opacity:0.7}.cw-code .hljs-bullet,.cw-code .hljs-variable,.cw-code .hljs-template-variable,.cw-code .hljs-selector-tag,.cw-code .hljs-name,.cw-code .hljs-deletion{color:#dc322f}.cw-code .hljs-symbol,.cw-code .hljs-number,.cw-code .hljs-link,.cw-code .hljs-attr,.cw-code .hljs-variable.constant_,.cw-code .hljs-literal{color:#cb4b16}.cw-code .hljs-title,.cw-code .hljs-class .hljs-title,.cw-code .hljs-title.class_{color:#b58900}.cw-code .hljs-strong{font-weight:bold;color:#b58900}.cw-code .hljs-code,.cw-code .hljs-addition,.cw-code .hljs-title.class_.inherited__,.cw-code .hljs-string{color:#859900}.cw-code .hljs-built_in,.cw-code .hljs-doctag,.cw-code .hljs-quote,.cw-code .hljs-keyword.hljs-atrule,.cw-code .hljs-regexp{color:#2aa198}.cw-code .hljs-function .hljs-title,.cw-code .hljs-attribute,.cw-code .ruby .hljs-property,.cw-code .hljs-title.function_,.cw-code .hljs-section{color:#268bd2}.cw-code .hljs-type,.cw-code .hljs-template-tag,.cw-code .diff .hljs-meta,.cw-code .hljs-keyword{color:#6c71c4}.cw-code .hljs-emphasis{color:#6c71c4;font-style:italic}.cw-code .hljs-meta,.cw-code .hljs-meta .hljs-keyword,.cw-code .hljs-meta .hljs-string{color:#d33682}.cw-code .hljs-meta .hljs-keyword,.cw-code .hljs-meta-keyword{font-weight:bold}" },
|
|
293
|
+
/**
|
|
294
|
+
* highlight.js styles/base16/solarized-dark.css
|
|
295
|
+
*
|
|
296
|
+
* Theme: Solarized Dark
|
|
297
|
+
* Author: Ethan Schoonover (modified by aramisgithub)
|
|
298
|
+
* License: ~ MIT (or more permissive) [via base16-schemes-source]
|
|
299
|
+
* Maintainer: @highlightjs/core-team
|
|
300
|
+
* Version: 2021.09.0
|
|
301
|
+
*
|
|
302
|
+
*/
|
|
303
|
+
"solarized-dark": { label: "Solarized Dark", scheme: "dark", css: ".cw-code{color:#93a1a1;background:#002b36}.cw-code::selection,.cw-code ::selection{background-color:#586e75;color:#93a1a1}.cw-code .hljs-comment{color:#657b83}.cw-code .hljs-tag{color:#839496}.cw-code .hljs-subst,.cw-code .hljs-punctuation,.cw-code .hljs-operator{color:#93a1a1}.cw-code .hljs-operator{opacity:0.7}.cw-code .hljs-bullet,.cw-code .hljs-variable,.cw-code .hljs-template-variable,.cw-code .hljs-selector-tag,.cw-code .hljs-name,.cw-code .hljs-deletion{color:#dc322f}.cw-code .hljs-symbol,.cw-code .hljs-number,.cw-code .hljs-link,.cw-code .hljs-attr,.cw-code .hljs-variable.constant_,.cw-code .hljs-literal{color:#cb4b16}.cw-code .hljs-title,.cw-code .hljs-class .hljs-title,.cw-code .hljs-title.class_{color:#b58900}.cw-code .hljs-strong{font-weight:bold;color:#b58900}.cw-code .hljs-code,.cw-code .hljs-addition,.cw-code .hljs-title.class_.inherited__,.cw-code .hljs-string{color:#859900}.cw-code .hljs-built_in,.cw-code .hljs-doctag,.cw-code .hljs-quote,.cw-code .hljs-keyword.hljs-atrule,.cw-code .hljs-regexp{color:#2aa198}.cw-code .hljs-function .hljs-title,.cw-code .hljs-attribute,.cw-code .ruby .hljs-property,.cw-code .hljs-title.function_,.cw-code .hljs-section{color:#268bd2}.cw-code .hljs-type,.cw-code .hljs-template-tag,.cw-code .diff .hljs-meta,.cw-code .hljs-keyword{color:#6c71c4}.cw-code .hljs-emphasis{color:#6c71c4;font-style:italic}.cw-code .hljs-meta,.cw-code .hljs-meta .hljs-keyword,.cw-code .hljs-meta .hljs-string{color:#d33682}.cw-code .hljs-meta .hljs-keyword,.cw-code .hljs-meta-keyword{font-weight:bold}" },
|
|
304
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code block themes: Coywolf's own palette (auto / light / dark), a few
|
|
3
|
+
* light+dark pairs that follow the visitor's system setting, and a curated
|
|
4
|
+
* set of highlight.js themes (themes.generated.ts), with any color under
|
|
5
|
+
* 4.5:1 against its background darkened or lightened to pass (contrast.ts).
|
|
6
|
+
* Only the active theme's CSS is sent, and only on pages that render a code block.
|
|
7
|
+
*/
|
|
8
|
+
import { LABEL_OPACITY, LINE_OPACITY, fadedColor, mutedColor, parseColor, readableThemeCss } from "./contrast.js";
|
|
9
|
+
import { HLJS_THEMES } from "./themes.generated.js";
|
|
10
|
+
|
|
11
|
+
export const THEME_SETTING = "codeBlocksTheme";
|
|
12
|
+
export const DEFAULT_THEME = "coywolf-auto";
|
|
13
|
+
|
|
14
|
+
export interface ThemeOption {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
group: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const DARK = "@media (prefers-color-scheme:dark)";
|
|
21
|
+
const LIGHT = "@media not all and (prefers-color-scheme:dark)";
|
|
22
|
+
|
|
23
|
+
/** Light and dark pairs that switch with the visitor's system setting. */
|
|
24
|
+
const AUTO_PAIRS: Record<string, { label: string; light: string; dark: string }> = {
|
|
25
|
+
"github-auto": { label: "GitHub (light/dark by system)", light: "github", dark: "github-dark" },
|
|
26
|
+
"atom-one-auto": { label: "Atom One (light/dark by system)", light: "atom-one-light", dark: "atom-one-dark" },
|
|
27
|
+
"a11y-auto": { label: "A11y (light/dark by system)", light: "a11y-light", dark: "a11y-dark" },
|
|
28
|
+
"tokyo-night-auto": { label: "Tokyo Night (light/dark by system)", light: "tokyo-night-light", dark: "tokyo-night-dark" },
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// ── Coywolf palette (ported from Code Block Enhancer's default theme) ──
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A palette plus its line-number and label colors (--cw-line, --cw-label):
|
|
35
|
+
* the text color at the opacity each used to have, raised to 4.5:1 only where
|
|
36
|
+
* that's too faint.
|
|
37
|
+
*/
|
|
38
|
+
function withMuted(palette: string): string {
|
|
39
|
+
const v = (name: string) => parseColor(new RegExp(`--cw-${name}:(#[0-9a-f]{3,6})`).exec(palette)?.[1] ?? "") ?? [0, 0, 0, 1];
|
|
40
|
+
const [fg, bg] = [v("fg"), v("bg")];
|
|
41
|
+
return `${palette};--cw-line:${fadedColor(fg, bg, LINE_OPACITY)};--cw-label:${fadedColor(fg, bg, LABEL_OPACITY)}`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const COYWOLF_LIGHT = withMuted(
|
|
45
|
+
"--cw-bg:#fff;--cw-fg:#1f2328;--cw-comment:#4b5563;--cw-punct:#374151;--cw-keyword:#7e22ce;--cw-function:#1d4ed8;--cw-string:#166534;--cw-variable:#9a3412;--cw-number:#155e75;--cw-operator:#111827;--cw-del:#b91c1c",
|
|
46
|
+
);
|
|
47
|
+
const COYWOLF_DARK = withMuted(
|
|
48
|
+
"--cw-bg:#050520;--cw-fg:#e6edf3;--cw-comment:#8b949e;--cw-punct:#c9d1d9;--cw-keyword:#c084fc;--cw-function:#60a5fa;--cw-string:#4ade80;--cw-variable:#fb923c;--cw-number:#22d3ee;--cw-operator:#e6edf3;--cw-del:#f87171",
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const COYWOLF_TOKENS = [
|
|
52
|
+
".cw-code{background:var(--cw-bg);color:var(--cw-fg)}",
|
|
53
|
+
".cw-code .hljs-comment,.cw-code .hljs-quote,.cw-code .hljs-meta{color:var(--cw-comment)}",
|
|
54
|
+
".cw-code .hljs-comment,.cw-code .hljs-quote{font-style:italic}",
|
|
55
|
+
".cw-code .hljs-punctuation,.cw-code .hljs-tag{color:var(--cw-punct)}",
|
|
56
|
+
".cw-code .hljs-keyword,.cw-code .hljs-built_in,.cw-code .hljs-selector-tag,.cw-code .hljs-doctag,.cw-code .hljs-meta .hljs-keyword,.cw-code .hljs-type{color:var(--cw-keyword)}",
|
|
57
|
+
".cw-code .hljs-title,.cw-code .hljs-section,.cw-code .hljs-name,.cw-code .hljs-selector-id,.cw-code .hljs-selector-class,.cw-code .hljs-selector-pseudo{color:var(--cw-function)}",
|
|
58
|
+
".cw-code .hljs-string,.cw-code .hljs-regexp,.cw-code .hljs-addition,.cw-code .hljs-meta .hljs-string,.cw-code .hljs-char.escape_{color:var(--cw-string)}",
|
|
59
|
+
".cw-code .hljs-variable,.cw-code .hljs-template-variable,.cw-code .hljs-attr,.cw-code .hljs-attribute,.cw-code .hljs-property,.cw-code .hljs-params,.cw-code .hljs-selector-attr{color:var(--cw-variable)}",
|
|
60
|
+
".cw-code .hljs-number,.cw-code .hljs-literal,.cw-code .hljs-symbol,.cw-code .hljs-bullet,.cw-code .hljs-variable.constant_{color:var(--cw-number)}",
|
|
61
|
+
".cw-code .hljs-operator,.cw-code .hljs-link,.cw-code .hljs-subst{color:var(--cw-operator)}",
|
|
62
|
+
".cw-code .hljs-deletion{color:var(--cw-del)}",
|
|
63
|
+
".cw-code .hljs-emphasis{font-style:italic}.cw-code .hljs-strong{font-weight:bold}",
|
|
64
|
+
].join("");
|
|
65
|
+
|
|
66
|
+
function coywolfCss(mode: "auto" | "light" | "dark"): string {
|
|
67
|
+
if (mode === "light") return `.cw-code{${COYWOLF_LIGHT};color-scheme:light}${COYWOLF_TOKENS}`;
|
|
68
|
+
if (mode === "dark") return `.cw-code{${COYWOLF_DARK};color-scheme:dark}${COYWOLF_TOKENS}`;
|
|
69
|
+
return `.cw-code{${COYWOLF_LIGHT};color-scheme:light}${DARK}{.cw-code{${COYWOLF_DARK};color-scheme:dark}}${COYWOLF_TOKENS}`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const COYWOLF: Record<string, { label: string; mode: "auto" | "light" | "dark" }> = {
|
|
73
|
+
"coywolf-auto": { label: "Coywolf Auto (light/dark by system)", mode: "auto" },
|
|
74
|
+
"coywolf-light": { label: "Coywolf — Always light", mode: "light" },
|
|
75
|
+
"coywolf-dark": { label: "Coywolf — Always dark", mode: "dark" },
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/** Per-isolate: each theme's CSS with its low-contrast colors fixed (see contrast.ts). */
|
|
79
|
+
const readable = new Map<string, string>();
|
|
80
|
+
|
|
81
|
+
function hljsCss(id: string): string {
|
|
82
|
+
const theme = HLJS_THEMES[id];
|
|
83
|
+
if (!theme) return "";
|
|
84
|
+
let css = readable.get(id);
|
|
85
|
+
if (css === undefined) {
|
|
86
|
+
const fixed = readableThemeCss(theme.css);
|
|
87
|
+
// --cw-line and --cw-label: line numbers and the language label (render.ts), muted but still 4.5:1.
|
|
88
|
+
css = `${fixed}.cw-code{--cw-line:${mutedColor(fixed, LINE_OPACITY)};--cw-label:${mutedColor(fixed, LABEL_OPACITY)}}`;
|
|
89
|
+
readable.set(id, css);
|
|
90
|
+
}
|
|
91
|
+
return `.cw-code{color-scheme:${theme.scheme}}${css}`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function themeOptions(): ThemeOption[] {
|
|
95
|
+
return [
|
|
96
|
+
...Object.entries(COYWOLF).map(([id, t]) => ({ id, label: t.label, group: "Coywolf" })),
|
|
97
|
+
...Object.entries(AUTO_PAIRS).map(([id, t]) => ({ id, label: t.label, group: "Light/dark pairs" })),
|
|
98
|
+
...Object.entries(HLJS_THEMES).map(([id, t]) => ({ id, label: t.label, group: t.scheme === "dark" ? "Dark themes" : "Light themes" })),
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function isTheme(id: unknown): id is string {
|
|
103
|
+
return typeof id === "string" && (id in COYWOLF || id in AUTO_PAIRS || id in HLJS_THEMES);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** The CSS for one theme (falls back to the default for unknown ids). */
|
|
107
|
+
export function themeCss(id: string | null | undefined): string {
|
|
108
|
+
const key = isTheme(id) ? id : DEFAULT_THEME;
|
|
109
|
+
const coywolf = COYWOLF[key];
|
|
110
|
+
if (coywolf) return coywolfCss(coywolf.mode);
|
|
111
|
+
const pair = AUTO_PAIRS[key];
|
|
112
|
+
if (pair) return `${LIGHT}{${hljsCss(pair.light)}}${DARK}{${hljsCss(pair.dark)}}`;
|
|
113
|
+
return hljsCss(key);
|
|
114
|
+
}
|