colorfulcode 0.0.1 → 0.1.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.
package/README.md CHANGED
@@ -1,3 +1,24 @@
1
1
  # colorfulcode
2
2
 
3
- Placeholder release. Use 0.1.0 or later, see https://github.com/Darker-Ink/colorfulcode
3
+ Fast syntax highlighting for 200 languages, written in Rust and running as WebAssembly. Synchronous, no setup, works in React, Node, Deno, Bun and every bundler.
4
+
5
+ ```bash
6
+ npm install colorfulcode
7
+ ```
8
+
9
+ ```tsx
10
+ import { Code } from "colorfulcode/react";
11
+
12
+ <Code code={source} language="tsx" theme="tokyo-night" lineNumbers />;
13
+ ```
14
+
15
+ ```js
16
+ import { highlight, tokenize } from "colorfulcode";
17
+
18
+ highlight("const answer = 42;", "js", { theme: "dracula" }); // HTML with inline styles
19
+ tokenize("const answer = 42;", "js"); // [{ start, end, kind, text }, ...]
20
+ ```
21
+
22
+ `colorfulcode/common` (and `colorfulcode/common/react`) is the same API with the 55 most used languages in a smaller module.
23
+
24
+ Full documentation, themes, custom themes and benchmarks: https://github.com/Darker-Ink/colorfulcode
@@ -0,0 +1,2 @@
1
+ export * from "./react.js";
2
+ export { default } from "./react.js";
@@ -0,0 +1,76 @@
1
+ import { createElement, useMemo } from "react";
2
+ import { detectLanguage, getLanguage, getTheme, highlight, tokenizeLines } from "./common.js";
3
+
4
+ export * from "./common.js";
5
+
6
+ /** Memoized `highlight()`: returns the HTML for `code`. */
7
+ export function useHighlight(code, language, options = {}) {
8
+ const { theme, lines, lineNumbers, highlightLines } = options;
9
+ const marked = highlightLines ? highlightLines.join(",") : "";
10
+ return useMemo(
11
+ () => highlight(code, language, { theme, lines, lineNumbers, highlightLines, pre: false }),
12
+ // eslint-disable-next-line react-hooks/exhaustive-deps
13
+ [code, language, theme, lines, lineNumbers, marked],
14
+ );
15
+ }
16
+
17
+ /** Memoized `tokenizeLines()`, for rendering tokens with your own components. */
18
+ export function useTokens(code, language) {
19
+ return useMemo(() => tokenizeLines(code, language), [code, language]);
20
+ }
21
+
22
+ /**
23
+ * Renders highlighted code.
24
+ *
25
+ * `<Code code={source} language="tsx" theme="dracula" lineNumbers />`
26
+ *
27
+ * The code can also be passed as a string child. With a theme (default
28
+ * "colorful") everything is styled inline and no CSS is required. Pass
29
+ * `theme={false}` to get class names for your own stylesheet, and
30
+ * `language="auto"` to guess the language from the code.
31
+ */
32
+ export function Code({
33
+ code,
34
+ children,
35
+ language = "text",
36
+ theme = "colorful",
37
+ lineNumbers = false,
38
+ highlightLines,
39
+ inline = false,
40
+ className,
41
+ style,
42
+ ...rest
43
+ }) {
44
+ const source = code ?? (typeof children === "string" ? children : "");
45
+ // Guess once here, so the highlighting and `data-language` agree.
46
+ const resolved = useMemo(
47
+ () => (language === "auto" ? (detectLanguage({ code: source, guess: true }) ?? "text") : language),
48
+ [source, language],
49
+ );
50
+ const html = useHighlight(source, resolved, { theme, lineNumbers, highlightLines });
51
+ const colors = theme === false ? undefined : getTheme(theme);
52
+ const lang = getLanguage(resolved);
53
+ const classes = className ? `cc ${className}` : "cc";
54
+ const themed = colors ? { background: colors.background, color: colors.foreground } : undefined;
55
+ if (inline) {
56
+ return createElement("code", {
57
+ ...rest,
58
+ className: classes,
59
+ "data-language": lang?.id,
60
+ style: themed ? { padding: "0.15em 0.35em", borderRadius: "0.3em", ...themed, ...style } : style,
61
+ dangerouslySetInnerHTML: { __html: html },
62
+ });
63
+ }
64
+ return createElement(
65
+ "pre",
66
+ {
67
+ ...rest,
68
+ className: classes,
69
+ "data-language": lang?.id,
70
+ style: themed ? { padding: "1em", overflowX: "auto", borderRadius: "0.5em", ...themed, ...style } : style,
71
+ },
72
+ createElement("code", { dangerouslySetInnerHTML: { __html: html } }),
73
+ );
74
+ }
75
+
76
+ export default Code;
@@ -0,0 +1 @@
1
+ export * from "./index.js";
package/dist/common.js ADDED
@@ -0,0 +1,262 @@
1
+ import wasmBase64 from "./wasm-common.js";
2
+
3
+ const encoder = new TextEncoder();
4
+ const decoder = new TextDecoder();
5
+
6
+ let wasm;
7
+ let metadata;
8
+ const languageCache = new Map();
9
+
10
+ function decodeBase64(text) {
11
+ if (typeof Buffer === "function") return Buffer.from(text, "base64");
12
+ const binary = atob(text);
13
+ const bytes = new Uint8Array(binary.length);
14
+ for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
15
+ return bytes;
16
+ }
17
+
18
+ /** Instantiates the module on first use. Synchronous, so it works during SSR too. */
19
+ function instance() {
20
+ if (!wasm) {
21
+ const module = new WebAssembly.Module(decodeBase64(wasmBase64));
22
+ wasm = new WebAssembly.Instance(module, {}).exports;
23
+ }
24
+ return wasm;
25
+ }
26
+
27
+ /** Writes a string into the input buffer and returns its length in bytes. */
28
+ function writeInput(text) {
29
+ const w = instance();
30
+ const capacity = text.length * 3;
31
+ const ptr = w.cc_input(capacity);
32
+ return encoder.encodeInto(text, new Uint8Array(w.memory.buffer, ptr, capacity)).written;
33
+ }
34
+
35
+ // Node's Buffer decodes UTF-8 several times faster than its TextDecoder.
36
+ const NodeBuffer = typeof Buffer === "function" && typeof Buffer.from === "function" ? Buffer : undefined;
37
+
38
+ function readOutput(length) {
39
+ const w = instance();
40
+ const ptr = w.cc_output_ptr();
41
+ if (NodeBuffer) return NodeBuffer.from(w.memory.buffer, ptr, length).toString("utf8");
42
+ return decoder.decode(new Uint8Array(w.memory.buffer, ptr, length));
43
+ }
44
+
45
+ function meta() {
46
+ if (!metadata) {
47
+ metadata = JSON.parse(readOutput(instance().cc_metadata()));
48
+ metadata.themeIndex = new Map(metadata.themes.map((t, i) => [t.name, i]));
49
+ }
50
+ return metadata;
51
+ }
52
+
53
+ /** Detection only reads the first few KB, so there is no point copying more. */
54
+ const DETECT_CHARS = 4096;
55
+
56
+ /** Guesses a language index from the code alone, or -1. */
57
+ function guessLanguage(code) {
58
+ return instance().cc_language_detect(writeInput(code.slice(0, DETECT_CHARS)));
59
+ }
60
+
61
+ /** The index of a language name, or of the guess for `code` when the name is "auto". */
62
+ function languageFor(name, code) {
63
+ return name === "auto" ? guessLanguage(code) : resolveLanguage(name);
64
+ }
65
+
66
+ function resolveLanguage(name) {
67
+ if (typeof name !== "string" || name === "") return -1;
68
+ let index = languageCache.get(name);
69
+ if (index === undefined) {
70
+ index = instance().cc_language_find(writeInput(name));
71
+ languageCache.set(name, index);
72
+ }
73
+ return index;
74
+ }
75
+
76
+ const definedThemes = new WeakMap();
77
+
78
+ /** The name of a theme given by name or as an object (registered on first use). */
79
+ function themeName(theme) {
80
+ if (typeof theme !== "object") return theme;
81
+ let name = definedThemes.get(theme);
82
+ if (name === undefined) {
83
+ name = defineTheme(theme);
84
+ definedThemes.set(theme, name);
85
+ }
86
+ return name;
87
+ }
88
+
89
+ function resolveTheme(theme) {
90
+ if (theme === false || theme === null) return -1;
91
+ theme = themeName(theme);
92
+ const index = meta().themeIndex.get(theme ?? "colorful");
93
+ if (index === undefined) throw new Error(`colorfulcode: unknown theme "${theme}"`);
94
+ return index;
95
+ }
96
+
97
+ const WRAP = 1;
98
+ const LINES = 2;
99
+ const LINE_NUMBERS = 4;
100
+
101
+ /**
102
+ * Highlights code and returns HTML.
103
+ *
104
+ * With a theme (the default is "colorful") the HTML uses inline styles and
105
+ * needs no CSS. Pass `theme: false` to get class names instead and style them
106
+ * with `themeCss()` or `colorfulcode/css/<name>.css`.
107
+ *
108
+ * Pass `"auto"` as the language to guess it from the code first.
109
+ */
110
+ export function highlight(code, language, options = {}) {
111
+ const w = instance();
112
+ const { theme, pre = true, lines = false, lineNumbers = false, highlightLines } = options;
113
+ const themeIndex = resolveTheme(theme);
114
+ const languageIndex = languageFor(language, code);
115
+ let lineCount = 0;
116
+ if (highlightLines && highlightLines.length) {
117
+ lineCount = highlightLines.length;
118
+ new Uint32Array(w.memory.buffer, w.cc_lines(lineCount), lineCount).set(highlightLines);
119
+ }
120
+ const flags = (pre ? WRAP : 0) | (lines ? LINES : 0) | (lineNumbers ? LINE_NUMBERS : 0);
121
+ const length = writeInput(code);
122
+ return readOutput(w.cc_highlight(length, languageIndex, themeIndex, flags, lineCount));
123
+ }
124
+
125
+ /**
126
+ * Tokenizes code. Every token has `start` and `end` offsets into the string
127
+ * (UTF-16, like `String.prototype.slice`), its `kind` and its `text`. The
128
+ * tokens cover the whole input. The language can be `"auto"`, as in `highlight()`.
129
+ */
130
+ export function tokenize(code, language) {
131
+ const w = instance();
132
+ // Resolve names first: lookups reuse the input and output buffers.
133
+ const kinds = meta().kinds;
134
+ const languageIndex = languageFor(language, code);
135
+ const count = w.cc_tokenize(writeInput(code), languageIndex);
136
+ const raw = new Uint32Array(w.memory.buffer, w.cc_output_ptr(), count * 3);
137
+ const tokens = new Array(count);
138
+ for (let i = 0, j = 0; i < count; i++, j += 3) {
139
+ const start = raw[j];
140
+ const end = raw[j + 1];
141
+ tokens[i] = { start, end, kind: kinds[raw[j + 2]], text: code.slice(start, end) };
142
+ }
143
+ return tokens;
144
+ }
145
+
146
+ /** Like `tokenize`, but split into lines of `{ text, kind }` without line breaks. */
147
+ export function tokenizeLines(code, language) {
148
+ const lines = [[]];
149
+ for (const { text, kind } of tokenize(code, language)) {
150
+ const parts = text.split("\n");
151
+ for (let i = 0; i < parts.length; i++) {
152
+ if (i > 0) lines.push([]);
153
+ const part = parts[i].endsWith("\r") ? parts[i].slice(0, -1) : parts[i];
154
+ if (part) lines[lines.length - 1].push({ text: part, kind });
155
+ }
156
+ }
157
+ return lines;
158
+ }
159
+
160
+ /** Every supported language. */
161
+ export function listLanguages() {
162
+ return meta().languages;
163
+ }
164
+
165
+ /** Every built in theme with its colors. */
166
+ export function listThemes() {
167
+ return meta().themes;
168
+ }
169
+
170
+ /** Finds a language by id, alias, name or extension. */
171
+ export function getLanguage(name) {
172
+ const index = resolveLanguage(name);
173
+ return index < 0 ? undefined : meta().languages[index];
174
+ }
175
+
176
+ /**
177
+ * Registers a custom theme and returns its name, which then works anywhere a
178
+ * built in theme name does. Kinds you leave out inherit a sensible style, so
179
+ * a handful of colors is enough:
180
+ *
181
+ * defineTheme({
182
+ * name: "discord",
183
+ * background: "#2b2d31",
184
+ * foreground: "#dbdee1",
185
+ * styles: { keyword: "#ff7ab2", comment: { color: "#80848e", italic: true } },
186
+ * });
187
+ */
188
+ export function defineTheme(theme) {
189
+ const { name, dark, background, foreground, styles = {} } = theme;
190
+ if (!name || !background || !foreground) {
191
+ throw new Error("colorfulcode: a theme needs a name, a background and a foreground");
192
+ }
193
+ const lines = [name, (dark ?? isDark(background)) ? "dark" : "light", `${background} ${foreground}`];
194
+ for (const [kind, value] of Object.entries(styles)) {
195
+ const style = typeof value === "string" ? { color: value } : value;
196
+ const flags = (style.bold ? "b" : "") + (style.italic ? "i" : "") + (style.underline ? "u" : "");
197
+ lines.push(`${kind} ${style.color} ${flags}`);
198
+ }
199
+ if (instance().cc_theme_define(writeInput(lines.join("\n"))) < 0) {
200
+ throw new Error(`colorfulcode: invalid theme "${name}" (colors must be #rrggbb)`);
201
+ }
202
+ metadata = undefined; // Reload so listThemes() and getTheme() include it.
203
+ return name;
204
+ }
205
+
206
+ function isDark(hex) {
207
+ const n = parseInt(hex.replace("#", ""), 16);
208
+ const luma = 0.299 * (n >> 16) + 0.587 * ((n >> 8) & 255) + 0.114 * (n & 255);
209
+ return luma < 128;
210
+ }
211
+
212
+ /** Finds a theme by name, or returns the colors of a theme object. */
213
+ export function getTheme(name) {
214
+ if (name && typeof name === "object") name = themeName(name);
215
+ const index = meta().themeIndex.get(name);
216
+ return index === undefined ? undefined : meta().themes[index];
217
+ }
218
+
219
+ /**
220
+ * Guesses a language id from a file path, then from a shebang or doctype in
221
+ * the code. With `guess: true` the code itself is scored against every
222
+ * language too. Returns undefined when unsure.
223
+ */
224
+ export function detectLanguage({ path, code, guess = false } = {}) {
225
+ const w = instance();
226
+ let index = -1;
227
+ if (path) index = w.cc_language_from_path(writeInput(path));
228
+ if (index < 0 && code) {
229
+ index = guess ? guessLanguage(code) : w.cc_language_from_content(writeInput(code.slice(0, 256)));
230
+ }
231
+ return index < 0 ? undefined : meta().languages[index].id;
232
+ }
233
+
234
+ /** CSS for the class based output (`theme: false`), scoped to `selector`. */
235
+ export function themeCss(theme = "colorful", selector = ".cc") {
236
+ const themeIndex = resolveTheme(theme);
237
+ return readOutput(instance().cc_theme_css(themeIndex, writeInput(selector)));
238
+ }
239
+
240
+ /**
241
+ * Highlights every `<code class="language-xyz">` inside `root` in place.
242
+ * Handy for static pages and Markdown output.
243
+ */
244
+ export function highlightAll(options = {}, root = globalThis.document) {
245
+ for (const el of root.querySelectorAll('code[class*="language-"], code[class*="lang-"]')) {
246
+ highlightElement(el, options);
247
+ }
248
+ }
249
+
250
+ /** Highlights a single `<code>` element in place using its `language-xyz` class. */
251
+ export function highlightElement(el, options = {}) {
252
+ const match = /(?:^|\s)lang(?:uage)?-([\w+#.-]+)/.exec(el.className);
253
+ const language = options.language ?? (match ? match[1] : "text");
254
+ el.innerHTML = highlight(el.textContent ?? "", language, { ...options, pre: false });
255
+ const theme = options.theme === false ? undefined : getTheme(options.theme ?? "colorful");
256
+ const target = el.parentElement && el.parentElement.tagName === "PRE" ? el.parentElement : el;
257
+ target.classList.add("cc");
258
+ if (theme) {
259
+ target.style.background = theme.background;
260
+ target.style.color = theme.foreground;
261
+ }
262
+ }
@@ -0,0 +1,25 @@
1
+ .cc{background:#eff1f5;color:#4c4f69}
2
+ .cc .cc-comment{color:#7c7f93;font-style:italic}
3
+ .cc .cc-keyword{color:#8839ef}
4
+ .cc .cc-string{color:#40a02b}
5
+ .cc .cc-escape{color:#ea76cb}
6
+ .cc .cc-number{color:#fe640b}
7
+ .cc .cc-constant{color:#fe640b}
8
+ .cc .cc-function{color:#1e66f5}
9
+ .cc .cc-type{color:#df8e1d}
10
+ .cc .cc-variable{color:#d20f39}
11
+ .cc .cc-property{color:#7287fd}
12
+ .cc .cc-builtin{color:#04a5e5}
13
+ .cc .cc-operator{color:#04a5e5}
14
+ .cc .cc-punctuation{color:#7c7f93}
15
+ .cc .cc-tag{color:#1e66f5}
16
+ .cc .cc-attribute{color:#df8e1d}
17
+ .cc .cc-meta{color:#fe640b}
18
+ .cc .cc-regex{color:#ea76cb}
19
+ .cc .cc-heading{color:#d20f39;font-weight:bold}
20
+ .cc .cc-emphasis{color:#4c4f69;font-style:italic}
21
+ .cc .cc-strong{color:#4c4f69;font-weight:bold}
22
+ .cc .cc-link{color:#1e66f5;text-decoration:underline}
23
+ .cc .cc-inserted{color:#40a02b}
24
+ .cc .cc-deleted{color:#d20f39}
25
+ .cc .cc-parameter{color:#e64553;font-style:italic}
@@ -0,0 +1,25 @@
1
+ .cc{background:#1e1e2e;color:#cdd6f4}
2
+ .cc .cc-comment{color:#9399b2;font-style:italic}
3
+ .cc .cc-keyword{color:#cba6f7}
4
+ .cc .cc-string{color:#a6e3a1}
5
+ .cc .cc-escape{color:#f5c2e7}
6
+ .cc .cc-number{color:#fab387}
7
+ .cc .cc-constant{color:#fab387}
8
+ .cc .cc-function{color:#89b4fa}
9
+ .cc .cc-type{color:#f9e2af}
10
+ .cc .cc-variable{color:#f38ba8}
11
+ .cc .cc-property{color:#b4befe}
12
+ .cc .cc-builtin{color:#89dceb}
13
+ .cc .cc-operator{color:#89dceb}
14
+ .cc .cc-punctuation{color:#9399b2}
15
+ .cc .cc-tag{color:#89b4fa}
16
+ .cc .cc-attribute{color:#f9e2af}
17
+ .cc .cc-meta{color:#fab387}
18
+ .cc .cc-regex{color:#f5c2e7}
19
+ .cc .cc-heading{color:#f38ba8;font-weight:bold}
20
+ .cc .cc-emphasis{color:#cdd6f4;font-style:italic}
21
+ .cc .cc-strong{color:#cdd6f4;font-weight:bold}
22
+ .cc .cc-link{color:#89b4fa;text-decoration:underline}
23
+ .cc .cc-inserted{color:#a6e3a1}
24
+ .cc .cc-deleted{color:#f38ba8}
25
+ .cc .cc-parameter{color:#eba0ac;font-style:italic}
@@ -0,0 +1,25 @@
1
+ .cc{background:#fbfbfd;color:#24273a}
2
+ .cc .cc-comment{color:#8a8fa8;font-style:italic}
3
+ .cc .cc-keyword{color:#d6246e}
4
+ .cc .cc-string{color:#2e8b3a}
5
+ .cc .cc-escape{color:#b8860b}
6
+ .cc .cc-number{color:#c2570c}
7
+ .cc .cc-constant{color:#c2570c}
8
+ .cc .cc-function{color:#1f6feb}
9
+ .cc .cc-type{color:#a15c00}
10
+ .cc .cc-variable{color:#9c27b0}
11
+ .cc .cc-property{color:#6639ba}
12
+ .cc .cc-builtin{color:#0e7c86}
13
+ .cc .cc-operator{color:#d6246e}
14
+ .cc .cc-punctuation{color:#5c6075}
15
+ .cc .cc-tag{color:#d6246e}
16
+ .cc .cc-attribute{color:#6639ba}
17
+ .cc .cc-meta{color:#6639ba}
18
+ .cc .cc-regex{color:#b3401b}
19
+ .cc .cc-heading{color:#1f6feb;font-weight:bold}
20
+ .cc .cc-emphasis{color:#24273a;font-style:italic}
21
+ .cc .cc-strong{color:#24273a;font-weight:bold}
22
+ .cc .cc-link{color:#0e7c86;text-decoration:underline}
23
+ .cc .cc-inserted{color:#2e8b3a}
24
+ .cc .cc-deleted{color:#d1242f}
25
+ .cc .cc-parameter{color:#9c27b0;font-style:italic}
@@ -0,0 +1,25 @@
1
+ .cc{background:#12131c;color:#e4e6f1}
2
+ .cc .cc-comment{color:#6b7194;font-style:italic}
3
+ .cc .cc-keyword{color:#ff6ac1}
4
+ .cc .cc-string{color:#8ee59c}
5
+ .cc .cc-escape{color:#ffd166}
6
+ .cc .cc-number{color:#ffb86c}
7
+ .cc .cc-constant{color:#ff9e64}
8
+ .cc .cc-function{color:#61d4ff}
9
+ .cc .cc-type{color:#ffd166}
10
+ .cc .cc-variable{color:#f2a7ff}
11
+ .cc .cc-property{color:#9fb4ff}
12
+ .cc .cc-builtin{color:#4fe0c4}
13
+ .cc .cc-operator{color:#ff8fa3}
14
+ .cc .cc-punctuation{color:#a3a8c3}
15
+ .cc .cc-tag{color:#ff6ac1}
16
+ .cc .cc-attribute{color:#c792ea}
17
+ .cc .cc-meta{color:#c792ea}
18
+ .cc .cc-regex{color:#f78c6c}
19
+ .cc .cc-heading{color:#61d4ff;font-weight:bold}
20
+ .cc .cc-emphasis{color:#e4e6f1;font-style:italic}
21
+ .cc .cc-strong{color:#e4e6f1;font-weight:bold}
22
+ .cc .cc-link{color:#4fe0c4;text-decoration:underline}
23
+ .cc .cc-inserted{color:#8ee59c}
24
+ .cc .cc-deleted{color:#ff6b6b}
25
+ .cc .cc-parameter{color:#f2a7ff;font-style:italic}
@@ -0,0 +1,25 @@
1
+ .cc{background:#282a36;color:#f8f8f2}
2
+ .cc .cc-comment{color:#6272a4}
3
+ .cc .cc-keyword{color:#ff79c6}
4
+ .cc .cc-string{color:#f1fa8c}
5
+ .cc .cc-escape{color:#ff79c6}
6
+ .cc .cc-number{color:#bd93f9}
7
+ .cc .cc-constant{color:#bd93f9}
8
+ .cc .cc-function{color:#50fa7b}
9
+ .cc .cc-type{color:#8be9fd;font-style:italic}
10
+ .cc .cc-variable{color:#ffb86c;font-style:italic}
11
+ .cc .cc-property{color:#f8f8f2}
12
+ .cc .cc-builtin{color:#8be9fd}
13
+ .cc .cc-operator{color:#ff79c6}
14
+ .cc .cc-punctuation{color:#f8f8f2}
15
+ .cc .cc-tag{color:#ff79c6}
16
+ .cc .cc-attribute{color:#50fa7b;font-style:italic}
17
+ .cc .cc-meta{color:#50fa7b;font-style:italic}
18
+ .cc .cc-regex{color:#ff5555}
19
+ .cc .cc-heading{color:#bd93f9;font-weight:bold}
20
+ .cc .cc-emphasis{color:#f8f8f2;font-style:italic}
21
+ .cc .cc-strong{color:#f8f8f2;font-weight:bold}
22
+ .cc .cc-link{color:#8be9fd;text-decoration:underline}
23
+ .cc .cc-inserted{color:#50fa7b}
24
+ .cc .cc-deleted{color:#ff5555}
25
+ .cc .cc-parameter{color:#ffb86c;font-style:italic}
@@ -0,0 +1,25 @@
1
+ .cc{background:#0d1117;color:#e6edf3}
2
+ .cc .cc-comment{color:#8b949e}
3
+ .cc .cc-keyword{color:#ff7b72}
4
+ .cc .cc-string{color:#a5d6ff}
5
+ .cc .cc-escape{color:#79c0ff}
6
+ .cc .cc-number{color:#79c0ff}
7
+ .cc .cc-constant{color:#79c0ff}
8
+ .cc .cc-function{color:#d2a8ff}
9
+ .cc .cc-type{color:#ffa657}
10
+ .cc .cc-variable{color:#ffa657}
11
+ .cc .cc-property{color:#79c0ff}
12
+ .cc .cc-builtin{color:#79c0ff}
13
+ .cc .cc-operator{color:#ff7b72}
14
+ .cc .cc-punctuation{color:#e6edf3}
15
+ .cc .cc-tag{color:#7ee787}
16
+ .cc .cc-attribute{color:#79c0ff}
17
+ .cc .cc-meta{color:#d2a8ff}
18
+ .cc .cc-regex{color:#a5d6ff}
19
+ .cc .cc-heading{color:#1f6feb;font-weight:bold}
20
+ .cc .cc-emphasis{color:#e6edf3;font-style:italic}
21
+ .cc .cc-strong{color:#e6edf3;font-weight:bold}
22
+ .cc .cc-link{color:#a5d6ff;text-decoration:underline}
23
+ .cc .cc-inserted{color:#aff5b4}
24
+ .cc .cc-deleted{color:#ffdcd7}
25
+ .cc .cc-parameter{color:#ffa657}
@@ -0,0 +1,25 @@
1
+ .cc{background:#ffffff;color:#1f2328}
2
+ .cc .cc-comment{color:#6e7781}
3
+ .cc .cc-keyword{color:#cf222e}
4
+ .cc .cc-string{color:#0a3069}
5
+ .cc .cc-escape{color:#0550ae}
6
+ .cc .cc-number{color:#0550ae}
7
+ .cc .cc-constant{color:#0550ae}
8
+ .cc .cc-function{color:#8250df}
9
+ .cc .cc-type{color:#953800}
10
+ .cc .cc-variable{color:#953800}
11
+ .cc .cc-property{color:#0550ae}
12
+ .cc .cc-builtin{color:#0550ae}
13
+ .cc .cc-operator{color:#cf222e}
14
+ .cc .cc-punctuation{color:#1f2328}
15
+ .cc .cc-tag{color:#116329}
16
+ .cc .cc-attribute{color:#0550ae}
17
+ .cc .cc-meta{color:#8250df}
18
+ .cc .cc-regex{color:#0a3069}
19
+ .cc .cc-heading{color:#0550ae;font-weight:bold}
20
+ .cc .cc-emphasis{color:#1f2328;font-style:italic}
21
+ .cc .cc-strong{color:#1f2328;font-weight:bold}
22
+ .cc .cc-link{color:#0a3069;text-decoration:underline}
23
+ .cc .cc-inserted{color:#116329}
24
+ .cc .cc-deleted{color:#82071e}
25
+ .cc .cc-parameter{color:#953800}
@@ -0,0 +1,25 @@
1
+ .cc{background:#282828;color:#ebdbb2}
2
+ .cc .cc-comment{color:#928374;font-style:italic}
3
+ .cc .cc-keyword{color:#fb4934}
4
+ .cc .cc-string{color:#b8bb26}
5
+ .cc .cc-escape{color:#fe8019}
6
+ .cc .cc-number{color:#d3869b}
7
+ .cc .cc-constant{color:#d3869b}
8
+ .cc .cc-function{color:#8ec07c}
9
+ .cc .cc-type{color:#fabd2f}
10
+ .cc .cc-variable{color:#83a598}
11
+ .cc .cc-property{color:#83a598}
12
+ .cc .cc-builtin{color:#fe8019}
13
+ .cc .cc-operator{color:#fe8019}
14
+ .cc .cc-punctuation{color:#a89984}
15
+ .cc .cc-tag{color:#fb4934}
16
+ .cc .cc-attribute{color:#8ec07c}
17
+ .cc .cc-meta{color:#fe8019}
18
+ .cc .cc-regex{color:#b8bb26}
19
+ .cc .cc-heading{color:#fabd2f;font-weight:bold}
20
+ .cc .cc-emphasis{color:#ebdbb2;font-style:italic}
21
+ .cc .cc-strong{color:#ebdbb2;font-weight:bold}
22
+ .cc .cc-link{color:#83a598;text-decoration:underline}
23
+ .cc .cc-inserted{color:#b8bb26}
24
+ .cc .cc-deleted{color:#fb4934}
25
+ .cc .cc-parameter{color:#83a598}
@@ -0,0 +1,25 @@
1
+ .cc{background:#272822;color:#f8f8f2}
2
+ .cc .cc-comment{color:#75715e}
3
+ .cc .cc-keyword{color:#f92672}
4
+ .cc .cc-string{color:#e6db74}
5
+ .cc .cc-escape{color:#ae81ff}
6
+ .cc .cc-number{color:#ae81ff}
7
+ .cc .cc-constant{color:#ae81ff}
8
+ .cc .cc-function{color:#a6e22e}
9
+ .cc .cc-type{color:#66d9ef;font-style:italic}
10
+ .cc .cc-variable{color:#fd971f}
11
+ .cc .cc-property{color:#f8f8f2}
12
+ .cc .cc-builtin{color:#66d9ef}
13
+ .cc .cc-operator{color:#f92672}
14
+ .cc .cc-punctuation{color:#f8f8f2}
15
+ .cc .cc-tag{color:#f92672}
16
+ .cc .cc-attribute{color:#a6e22e}
17
+ .cc .cc-meta{color:#a6e22e}
18
+ .cc .cc-regex{color:#e6db74}
19
+ .cc .cc-heading{color:#a6e22e;font-weight:bold}
20
+ .cc .cc-emphasis{color:#f8f8f2;font-style:italic}
21
+ .cc .cc-strong{color:#f8f8f2;font-weight:bold}
22
+ .cc .cc-link{color:#66d9ef;text-decoration:underline}
23
+ .cc .cc-inserted{color:#a6e22e}
24
+ .cc .cc-deleted{color:#f92672}
25
+ .cc .cc-parameter{color:#fd971f;font-style:italic}
@@ -0,0 +1,25 @@
1
+ .cc{background:#2e3440;color:#d8dee9}
2
+ .cc .cc-comment{color:#616e88;font-style:italic}
3
+ .cc .cc-keyword{color:#81a1c1}
4
+ .cc .cc-string{color:#a3be8c}
5
+ .cc .cc-escape{color:#ebcb8b}
6
+ .cc .cc-number{color:#b48ead}
7
+ .cc .cc-constant{color:#81a1c1}
8
+ .cc .cc-function{color:#88c0d0}
9
+ .cc .cc-type{color:#8fbcbb}
10
+ .cc .cc-variable{color:#d8dee9}
11
+ .cc .cc-property{color:#d8dee9}
12
+ .cc .cc-builtin{color:#88c0d0}
13
+ .cc .cc-operator{color:#81a1c1}
14
+ .cc .cc-punctuation{color:#eceff4}
15
+ .cc .cc-tag{color:#81a1c1}
16
+ .cc .cc-attribute{color:#8fbcbb}
17
+ .cc .cc-meta{color:#d08770}
18
+ .cc .cc-regex{color:#ebcb8b}
19
+ .cc .cc-heading{color:#88c0d0;font-weight:bold}
20
+ .cc .cc-emphasis{color:#d8dee9;font-style:italic}
21
+ .cc .cc-strong{color:#d8dee9;font-weight:bold}
22
+ .cc .cc-link{color:#88c0d0;text-decoration:underline}
23
+ .cc .cc-inserted{color:#a3be8c}
24
+ .cc .cc-deleted{color:#bf616a}
25
+ .cc .cc-parameter{color:#d8dee9}
@@ -0,0 +1,25 @@
1
+ .cc{background:#282c34;color:#abb2bf}
2
+ .cc .cc-comment{color:#5c6370;font-style:italic}
3
+ .cc .cc-keyword{color:#c678dd}
4
+ .cc .cc-string{color:#98c379}
5
+ .cc .cc-escape{color:#56b6c2}
6
+ .cc .cc-number{color:#d19a66}
7
+ .cc .cc-constant{color:#d19a66}
8
+ .cc .cc-function{color:#61afef}
9
+ .cc .cc-type{color:#e5c07b}
10
+ .cc .cc-variable{color:#e06c75}
11
+ .cc .cc-property{color:#e06c75}
12
+ .cc .cc-builtin{color:#56b6c2}
13
+ .cc .cc-operator{color:#56b6c2}
14
+ .cc .cc-punctuation{color:#abb2bf}
15
+ .cc .cc-tag{color:#e06c75}
16
+ .cc .cc-attribute{color:#d19a66}
17
+ .cc .cc-meta{color:#61afef}
18
+ .cc .cc-regex{color:#56b6c2}
19
+ .cc .cc-heading{color:#e06c75;font-weight:bold}
20
+ .cc .cc-emphasis{color:#abb2bf;font-style:italic}
21
+ .cc .cc-strong{color:#abb2bf;font-weight:bold}
22
+ .cc .cc-link{color:#61afef;text-decoration:underline}
23
+ .cc .cc-inserted{color:#98c379}
24
+ .cc .cc-deleted{color:#e06c75}
25
+ .cc .cc-parameter{color:#e06c75}