diff --git a/README.md b/README.md index 31956730..b455d80b 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,12 @@ Mobile repository and session switcher

+## Theme Showcase + +Explore all 37 themes, including matching syntax highlighting for Markdown code blocks. + +https://github.com/user-attachments/assets/4f155632-4b03-412e-976f-2a02045caf22 + ## Requirements OpenCode Manager requires **OpenCode 2.x at 2.0.15 or newer** (bundled 2.0.15); OpenCode 1.x is not supported. Upgrading from 1.x? See the [v1 → v2 migration guide](https://opencode.ai/v2/docs/migrate-v1). OpenCode 2 migrates V1 session history in the background on first start, so older sessions can be incomplete until it finishes; progress is reported at `GET /api/experimental/migration/v1`. diff --git a/frontend/package.json b/frontend/package.json index 32c6c53e..58a65cc4 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -35,7 +35,6 @@ "cronstrue": "^3.13.0", "date-fns": "^4.1.0", "diff": "^8.0.2", - "highlight.js": "^11.11.1", "lucide-react": "^0.546.0", "mermaid": "^11.12.2", "react": "^19.1.1", diff --git a/frontend/src/components/message/TextPart.tsx b/frontend/src/components/message/TextPart.tsx index 508485cc..38d684ba 100644 --- a/frontend/src/components/message/TextPart.tsx +++ b/frontend/src/components/message/TextPart.tsx @@ -8,7 +8,6 @@ import { Maximize2, X, AlertCircle } from 'lucide-react' import { CopyButton } from '@/components/ui/copy-button' import { MarkdownLink } from '@/components/ui/markdown-link' import { useTheme } from '@/hooks/useTheme' -import 'highlight.js/styles/github-dark.css' interface TextPartProps { text: string diff --git a/frontend/src/index.css b/frontend/src/index.css index 3c867ff9..33294a77 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -34,6 +34,16 @@ --color-agent-build: #89b5ff; --color-agent-docs: #ffb224; --color-agent-ask: #0091ff; + --color-syntax-comment: #8b949e; + --color-syntax-keyword: #ff7b72; + --color-syntax-string: #a5d6ff; + --color-syntax-primitive: #d2a8ff; + --color-syntax-property: #79c0ff; + --color-syntax-type: #ffa657; + --color-syntax-constant: #79c0ff; + --color-syntax-variable: #ffa657; + --color-syntax-operator: #79c0ff; + --color-syntax-punctuation: #d4d4d8; } :root:not(.dark) { @@ -70,6 +80,16 @@ --color-agent-build: #034cff; --color-agent-docs: #ffb224; --color-agent-ask: #0091ff; + --color-syntax-comment: #6a737d; + --color-syntax-keyword: #d73a49; + --color-syntax-string: #032f62; + --color-syntax-primitive: #6f42c1; + --color-syntax-property: #005cc5; + --color-syntax-type: #e36209; + --color-syntax-constant: #005cc5; + --color-syntax-variable: #e36209; + --color-syntax-operator: #005cc5; + --color-syntax-punctuation: #6b7280; } html { @@ -357,28 +377,105 @@ input:-webkit-autofill:active { } /* Syntax highlighting for markdown code blocks */ -@import 'highlight.js/styles/github.css' layer(highlight-light); -@import 'highlight.js/styles/github-dark.css' layer(highlight-dark); - -@layer highlight-light { - :root:not(.dark) .hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - background: var(--color-accent); - color: var(--color-foreground); - } +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: var(--color-accent); + color: var(--color-foreground); } -@layer highlight-dark { - .dark .hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - background: var(--color-accent); - color: var(--color-foreground); +.hljs-comment, +.hljs-quote, +.hljs-code, +.hljs-formula, +.hljs-meta { + color: var(--color-syntax-comment); +} + +.hljs-keyword, +.hljs-doctag, +.hljs-meta .hljs-keyword, +.hljs-template-tag, +.hljs-selector-tag, +.hljs-name { + color: var(--color-syntax-keyword); +} + +.hljs-string, +.hljs-regexp, +.hljs-meta .hljs-string, +.hljs-char.escape_ { + color: var(--color-syntax-string); +} + +.hljs-title, +.hljs-title.function_, +.hljs-built_in, +.hljs-section { + color: var(--color-syntax-primitive); +} + +.hljs-type, +.hljs-title.class_, +.hljs-title.class_.inherited__ { + color: var(--color-syntax-type); +} + +.hljs-literal, +.hljs-number, +.hljs-symbol, +.hljs-bullet, +.hljs-link, +.hljs-variable.language_, +.hljs-variable.constant_ { + color: var(--color-syntax-constant); +} + +.hljs-attr, +.hljs-attribute, +.hljs-property, +.hljs-selector-attr, +.hljs-selector-class, +.hljs-selector-id, +.hljs-selector-pseudo { + color: var(--color-syntax-property); +} + +.hljs-variable, +.hljs-template-variable, +.hljs-params, +.hljs-subst { + color: var(--color-syntax-variable); +} + +.hljs-operator { + color: var(--color-syntax-operator); +} + +.hljs-punctuation, +.hljs-tag { + color: var(--color-syntax-punctuation); +} + +.hljs-section, +.hljs-strong { + font-weight: 600; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-addition { + color: var(--color-diff-add); + background-color: color-mix(in oklab, var(--color-diff-add) 15%, transparent); +} + +.hljs-deletion { + color: var(--color-diff-delete); + background-color: color-mix(in oklab, var(--color-diff-delete) 15%, transparent); } - } /* Custom scrollbar styling */ .scrollbar-thin { diff --git a/frontend/src/lib/theme/colorTheme.test.ts b/frontend/src/lib/theme/colorTheme.test.ts index 8babb7b3..8ce71892 100644 --- a/frontend/src/lib/theme/colorTheme.test.ts +++ b/frontend/src/lib/theme/colorTheme.test.ts @@ -90,6 +90,34 @@ describe('applyColorTheme', () => { expect(dark?.['destructive-foreground']).toBe(readableTextColor('#ff5555')) }) + it('resolves syntax tokens from upstream overrides and palette fallbacks', () => { + const dark = resolveColorThemeTokens('dracula', true) + + expect(dark?.['syntax-keyword']).toBe('#ff79c6') + expect(dark?.['syntax-string']).toBe('#f1fa8c') + expect(dark?.['syntax-comment']).toBe('#6272a4') + expect(dark?.['syntax-primitive']).toBe('#50fa7b') + expect(dark?.['syntax-property']).toBe('#8be9fd') + expect(dark?.['syntax-constant']).toBe('#bd93f9') + expect(dark?.['syntax-variable']).toBe('#f8f8f2') + expect(dark?.['syntax-type']).toBe('#ffb86c') + expect(dark?.['syntax-operator']).toBe(dark?.['muted-foreground']) + expect(dark?.['syntax-punctuation']).toBe(dark?.['muted-foreground']) + }) + + it('resolves light syntax tokens and falls back to ink for operator and punctuation', () => { + const light = resolveColorThemeTokens('dracula', false) + + expect(light?.['syntax-keyword']).toBe('#d16090') + expect(light?.['syntax-punctuation']).toBe('#1f1f2f') + }) + + it('applies syntax tokens to the root element', () => { + applyColorTheme(document.documentElement, 'dracula', true) + + expect(document.documentElement.style.getPropertyValue('--color-syntax-keyword')).toBe('#ff79c6') + }) + it('falls back to primary for highlight when the palette has no accent', () => { const dark = resolveColorThemeTokens('oc-2', true) diff --git a/frontend/src/lib/theme/colorTheme.ts b/frontend/src/lib/theme/colorTheme.ts index f011318d..aabdc252 100644 --- a/frontend/src/lib/theme/colorTheme.ts +++ b/frontend/src/lib/theme/colorTheme.ts @@ -35,6 +35,16 @@ const MANAGER_THEME_TOKENS = [ 'agent-build', 'agent-docs', 'agent-ask', + 'syntax-comment', + 'syntax-keyword', + 'syntax-string', + 'syntax-primitive', + 'syntax-property', + 'syntax-type', + 'syntax-constant', + 'syntax-variable', + 'syntax-operator', + 'syntax-punctuation', ] as const type ManagerThemeToken = (typeof MANAGER_THEME_TOKENS)[number] @@ -98,9 +108,12 @@ export function resolveColorThemeTokens( diffAdd, diffDelete, textWeak, + syntax, } = isDark ? theme.dark : theme.light const mix = (percent: number) => `color-mix(in oklab, ${ink} ${percent}%, ${neutral})` const highlight = paletteAccent ?? primary + const mutedForeground = textWeak ?? mix(62) + const syntaxFallback = isDark ? mutedForeground : ink return { background: neutral, @@ -114,7 +127,7 @@ export function resolveColorThemeTokens( secondary: mix(10), border: mix(14), input: mix(16), - 'muted-foreground': textWeak ?? mix(62), + 'muted-foreground': mutedForeground, primary, 'primary-hover': `color-mix(in oklab, ${primary} 85%, ${ink})`, 'primary-foreground': readableTextColor(primary), @@ -136,6 +149,16 @@ export function resolveColorThemeTokens( 'agent-build': primary, 'agent-docs': warning, 'agent-ask': info, + 'syntax-comment': syntax?.comment ?? mutedForeground, + 'syntax-keyword': syntax?.keyword ?? highlight, + 'syntax-string': syntax?.string ?? success, + 'syntax-primitive': syntax?.primitive ?? primary, + 'syntax-property': syntax?.property ?? info, + 'syntax-type': syntax?.type ?? warning, + 'syntax-constant': syntax?.constant ?? highlight, + 'syntax-variable': syntax?.variable ?? ink, + 'syntax-operator': syntax?.operator ?? syntaxFallback, + 'syntax-punctuation': syntax?.punctuation ?? syntaxFallback, } } diff --git a/frontend/src/lib/theme/syntaxHighlight.test.ts b/frontend/src/lib/theme/syntaxHighlight.test.ts new file mode 100644 index 00000000..3d4212a1 --- /dev/null +++ b/frontend/src/lib/theme/syntaxHighlight.test.ts @@ -0,0 +1,41 @@ +import { readFileSync } from 'node:fs' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { describe, expect, it } from 'vitest' +import { resolveColorThemeTokens } from './colorTheme' + +const themeDir = path.dirname(fileURLToPath(import.meta.url)) + +const indexCss = readFileSync(path.resolve(themeDir, '../../index.css'), 'utf8') +const textPart = readFileSync( + path.resolve(themeDir, '../../components/message/TextPart.tsx'), + 'utf8', +) + +function countOccurrences(source: string, needle: string): number { + return source.split(needle).length - 1 +} + +describe('syntax highlight stylesheet', () => { + it('does not import GitHub highlight.js stylesheets', () => { + expect(indexCss).not.toContain('highlight.js/styles') + expect(textPart).not.toContain('highlight.js/styles') + }) + + it('does not use highlight-light or highlight-dark cascade layers', () => { + expect(indexCss).not.toContain('@layer highlight-light') + expect(indexCss).not.toContain('@layer highlight-dark') + }) + + it('maps every syntax token to a theme variable consumed by a .hljs rule', () => { + const dark = resolveColorThemeTokens('dracula', true) + const syntaxKeys = Object.keys(dark ?? {}).filter((key) => key.startsWith('syntax-')) + + expect(syntaxKeys.length).toBeGreaterThan(0) + + for (const key of syntaxKeys) { + expect(indexCss).toContain(`var(--color-${key})`) + expect(countOccurrences(indexCss, `--color-${key}:`)).toBe(2) + } + }) +}) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 60cdfdcd..d77b0f97 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -168,9 +168,6 @@ importers: diff: specifier: ^8.0.2 version: 8.0.2 - highlight.js: - specifier: ^11.11.1 - version: 11.11.1 lucide-react: specifier: ^0.546.0 version: 0.546.0(react@19.2.3) @@ -1339,7 +1336,6 @@ packages: resolution: {integrity: sha512-VZ2sNMw1d/r1SLPjUbOP9LKscKz1CQjID8adTL6gG8Lrrq+mYcIUxutyB+P/eG0J/7oRZLPR6OMt7dUOap6RTg==} cpu: [arm64] os: [linux] - libc: [musl] '@opentui/core-linux-arm64@0.5.12': resolution: {integrity: sha512-XeKhuIaEtgipvuPHbl4qPOBj+Ut+2zObmsxMVM1jDcjz/FatG9PGeGQPx1G1SnvH2AgpT4K+eCu7DUF0+yIqoQ==} @@ -1350,7 +1346,6 @@ packages: resolution: {integrity: sha512-WWW0hVBoSYZ3D6AgZ4u2Y5/u/IyIq2pDb+4yI3WgJ70Wyt6ofHy+6kRGRgbXFn1p+rPInAHjCXD2v6C7iEKSrA==} cpu: [x64] os: [linux] - libc: [musl] '@opentui/core-linux-x64@0.5.12': resolution: {integrity: sha512-eZiCjEzwbb6qClPPfk32Nha9xmr9obt69Xj0+9SKsXxWLBKkjQEGOMRoh/R9ObaQF4aq8If1xV3VEY0sD9W9vg==} @@ -1939,67 +1934,56 @@ packages: resolution: {integrity: sha512-EHMUcDwhtdRGlXZsGSIuXSYwD5kOT9NVnx9sqzYiwAc91wfYOE1g1djOEDseZJKKqtHAHGwnGPQu3kytmfaXLQ==} cpu: [arm] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.54.0': resolution: {integrity: sha512-+pBrqEjaakN2ySv5RVrj/qLytYhPKEUwk+e3SFU5jTLHIcAtqh2rLrd/OkbNuHJpsBgxsD8ccJt5ga/SeG0JmA==} cpu: [arm] os: [linux] - libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.54.0': resolution: {integrity: sha512-NSqc7rE9wuUaRBsBp5ckQ5CVz5aIRKCwsoa6WMF7G01sX3/qHUw/z4pv+D+ahL1EIKy6Enpcnz1RY8pf7bjwng==} cpu: [arm64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.54.0': resolution: {integrity: sha512-gr5vDbg3Bakga5kbdpqx81m2n9IX8M6gIMlQQIXiLTNeQW6CucvuInJ91EuCJ/JYvc+rcLLsDFcfAD1K7fMofg==} cpu: [arm64] os: [linux] - libc: [musl] '@rollup/rollup-linux-loong64-gnu@4.54.0': resolution: {integrity: sha512-gsrtB1NA3ZYj2vq0Rzkylo9ylCtW/PhpLEivlgWe0bpgtX5+9j9EZa0wtZiCjgu6zmSeZWyI/e2YRX1URozpIw==} cpu: [loong64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-ppc64-gnu@4.54.0': resolution: {integrity: sha512-y3qNOfTBStmFNq+t4s7Tmc9hW2ENtPg8FeUD/VShI7rKxNW7O4fFeaYbMsd3tpFlIg1Q8IapFgy7Q9i2BqeBvA==} cpu: [ppc64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.54.0': resolution: {integrity: sha512-89sepv7h2lIVPsFma8iwmccN7Yjjtgz0Rj/Ou6fEqg3HDhpCa+Et+YSufy27i6b0Wav69Qv4WBNl3Rs6pwhebQ==} cpu: [riscv64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.54.0': resolution: {integrity: sha512-ZcU77ieh0M2Q8Ur7D5X7KvK+UxbXeDHwiOt/CPSBTI1fBmeDMivW0dPkdqkT4rOgDjrDDBUed9x4EgraIKoR2A==} cpu: [riscv64] os: [linux] - libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.54.0': resolution: {integrity: sha512-2AdWy5RdDF5+4YfG/YesGDDtbyJlC9LHmL6rZw6FurBJ5n4vFGupsOBGfwMRjBYH7qRQowT8D/U4LoSvVwOhSQ==} cpu: [s390x] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.54.0': resolution: {integrity: sha512-WGt5J8Ij/rvyqpFexxk3ffKqqbLf9AqrTBbWDk7ApGUzaIs6V+s2s84kAxklFwmMF/vBNGrVdYgbblCOFFezMQ==} cpu: [x64] os: [linux] - libc: [glibc] '@rollup/rollup-linux-x64-musl@4.54.0': resolution: {integrity: sha512-JzQmb38ATzHjxlPHuTH6tE7ojnMKM2kYNzt44LO/jJi8BpceEC8QuXYA908n8r3CNuG/B3BV8VR3Hi1rYtmPiw==} cpu: [x64] os: [linux] - libc: [musl] '@rollup/rollup-openharmony-arm64@4.54.0': resolution: {integrity: sha512-huT3fd0iC7jigGh7n3q/+lfPcXxBi+om/Rs3yiFxjvSxbSB6aohDFXbWvlspaqjeOh+hx7DDHS+5Es5qRkWkZg==} @@ -2153,28 +2137,24 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] - libc: [glibc] '@tailwindcss/oxide-linux-arm64-musl@4.1.18': resolution: {integrity: sha512-1px92582HkPQlaaCkdRcio71p8bc8i/ap5807tPRDK/uw953cauQBT8c5tVGkOwrHMfc2Yh6UuxaH4vtTjGvHg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - libc: [musl] '@tailwindcss/oxide-linux-x64-gnu@4.1.18': resolution: {integrity: sha512-v3gyT0ivkfBLoZGF9LyHmts0Isc8jHZyVcbzio6Wpzifg/+5ZJpDiRiUhDLkcr7f/r38SWNe7ucxmGW3j3Kb/g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - libc: [glibc] '@tailwindcss/oxide-linux-x64-musl@4.1.18': resolution: {integrity: sha512-bhJ2y2OQNlcRwwgOAGMY0xTFStt4/wyU6pvI6LSuZpRgKQwxTec0/3Scu91O8ir7qCR3AuepQKLU/kX99FouqQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - libc: [musl] '@tailwindcss/oxide-wasm32-wasi@4.1.18': resolution: {integrity: sha512-LffYTvPjODiP6PT16oNeUQJzNVyJl1cjIebq/rWWBF+3eDst5JGEFSc5cWxyRCJ0Mxl+KyIkqRxk1XPEs9x8TA==} @@ -3920,28 +3900,24 @@ packages: engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - libc: [glibc] lightningcss-linux-arm64-musl@1.30.2: resolution: {integrity: sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - libc: [musl] lightningcss-linux-x64-gnu@1.30.2: resolution: {integrity: sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - libc: [glibc] lightningcss-linux-x64-musl@1.30.2: resolution: {integrity: sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - libc: [musl] lightningcss-win32-arm64-msvc@1.30.2: resolution: {integrity: sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ==} diff --git a/scripts/sync-opencode-themes.ts b/scripts/sync-opencode-themes.ts index 58860cb4..3157414e 100644 --- a/scripts/sync-opencode-themes.ts +++ b/scripts/sync-opencode-themes.ts @@ -1,7 +1,13 @@ import { writeFile } from 'node:fs/promises' import { join } from 'node:path' import { OPENCODE_PINNED_VERSION } from '../shared/src/opencode/release' -import type { HexColor, OpenCodeThemeDefinition, OpenCodeThemePalette } from '../shared/src/themes/types' +import { OPENCODE_SYNTAX_TOKENS } from '../shared/src/themes/types' +import type { + HexColor, + OpenCodeSyntaxPalette, + OpenCodeThemeDefinition, + OpenCodeThemePalette, +} from '../shared/src/themes/types' const OPENCODE_THEME_TAG = `v${OPENCODE_PINNED_VERSION}` @@ -75,6 +81,16 @@ function readOptionalHex(value: unknown, field: string): HexColor | undefined { return value === undefined ? undefined : readHex(value, field) } +function readSyntax(overrides: Record | undefined): OpenCodeSyntaxPalette | undefined { + if (!overrides) return undefined + const syntax: OpenCodeSyntaxPalette = {} + for (const token of OPENCODE_SYNTAX_TOKENS) { + const value = overrides[`syntax-${token}`] + if (isHexColor(value)) syntax[token] = value + } + return Object.keys(syntax).length === 0 ? undefined : syntax +} + function readPalette(raw: RawVariant | undefined, field: string): OpenCodeThemePalette { if (!raw || typeof raw !== 'object' || !raw.palette || typeof raw.palette !== 'object') { throw new Error(`Missing palette for ${field}`) @@ -85,6 +101,7 @@ function readPalette(raw: RawVariant | undefined, field: string): OpenCodeThemeP const diffDelete = readOptionalHex(palette.diffDelete, `${field}.diffDelete`) const textWeakValue = raw.overrides?.['text-weak'] const textWeak = isHexColor(textWeakValue) ? textWeakValue : undefined + const syntax = readSyntax(raw.overrides) return { neutral: readHex(palette.neutral, `${field}.neutral`), ink: readHex(palette.ink, `${field}.ink`), @@ -97,6 +114,7 @@ function readPalette(raw: RawVariant | undefined, field: string): OpenCodeThemeP ...(diffAdd === undefined ? {} : { diffAdd }), ...(diffDelete === undefined ? {} : { diffDelete }), ...(textWeak === undefined ? {} : { textWeak }), + ...(syntax === undefined ? {} : { syntax }), } } @@ -127,7 +145,7 @@ function quote(value: string): string { return `'${value.replace(/\\/g, '\\\\').replace(/'/g, "\\'")}'` } -const PALETTE_FIELD_ORDER: (keyof OpenCodeThemePalette)[] = [ +const PALETTE_FIELD_ORDER: Exclude[] = [ 'neutral', 'ink', 'primary', @@ -147,6 +165,14 @@ function serializePalette(palette: OpenCodeThemePalette, indent: string): string const value = palette[field] if (value !== undefined) lines.push(`${indent} ${field}: ${quote(value)},`) } + if (palette.syntax !== undefined) { + lines.push(`${indent} syntax: {`) + for (const token of OPENCODE_SYNTAX_TOKENS) { + const value = palette.syntax[token] + if (value !== undefined) lines.push(`${indent} ${token}: ${quote(value)},`) + } + lines.push(`${indent} },`) + } lines.push(`${indent}}`) return lines.join('\n') } diff --git a/shared/src/themes/opencode-palettes.ts b/shared/src/themes/opencode-palettes.ts index 8dba7775..d036757c 100644 --- a/shared/src/themes/opencode-palettes.ts +++ b/shared/src/themes/opencode-palettes.ts @@ -15,6 +15,9 @@ export const OPENCODE_THEMES = [ diffAdd: '#9ff29a', diffDelete: '#fc533a', textWeak: '#8F8F8F', + syntax: { + constant: '#007b80', + }, }, dark: { neutral: '#1f1f1f', @@ -27,6 +30,9 @@ export const OPENCODE_THEMES = [ diffAdd: '#c8ffc4', diffDelete: '#fc533a', textWeak: '#707070', + syntax: { + constant: '#93e9f6', + }, }, }, { @@ -43,6 +49,14 @@ export const OPENCODE_THEMES = [ info: '#00b0ff', diffAdd: '#00e676', diffDelete: '#ff1744', + syntax: { + comment: '#757575', + keyword: '#d500f9', + string: '#00e676', + primitive: '#00b0ff', + property: '#ff9100', + constant: '#6200ff', + }, }, dark: { neutral: '#000000', @@ -55,6 +69,14 @@ export const OPENCODE_THEMES = [ info: '#18ffff', diffAdd: '#00ff88', diffDelete: '#ff1744', + syntax: { + comment: '#555555', + keyword: '#ff00ff', + string: '#00ff88', + primitive: '#18ffff', + property: '#ffea00', + constant: '#b388ff', + }, }, }, { @@ -71,6 +93,15 @@ export const OPENCODE_THEMES = [ info: '#5bb8d9', diffAdd: '#b3e6cc', diffDelete: '#f5b3b3', + syntax: { + comment: '#8d88a3', + keyword: '#7b5ae0', + string: '#2b8a57', + primitive: '#2f78b8', + property: '#a96a22', + type: '#2b8a57', + constant: '#d94f4f', + }, }, dark: { neutral: '#15141b', @@ -83,6 +114,15 @@ export const OPENCODE_THEMES = [ info: '#82e2ff', diffAdd: '#61ffca', diffDelete: '#ff6767', + syntax: { + comment: '#6d6a7e', + keyword: '#a277ff', + string: '#61ffca', + primitive: '#82e2ff', + property: '#ffca85', + type: '#61ffca', + constant: '#ff6767', + }, }, }, { @@ -99,6 +139,15 @@ export const OPENCODE_THEMES = [ info: '#2f9bce', diffAdd: '#b1d780', diffDelete: '#e6656a', + syntax: { + comment: '#6e7681', + keyword: '#c76a1a', + string: '#6f8f00', + primitive: '#b87500', + property: '#2f86b7', + type: '#227fc0', + constant: '#a37acc', + }, }, dark: { neutral: '#0f1419', @@ -111,6 +160,15 @@ export const OPENCODE_THEMES = [ info: '#66c6f1', diffAdd: '#59c57c', diffDelete: '#f58572', + syntax: { + comment: '#5a6673', + keyword: '#ff8f40', + string: '#aad94c', + primitive: '#ffb454', + property: '#39bae6', + type: '#59c2ff', + constant: '#d2a6ff', + }, }, }, { @@ -127,6 +185,15 @@ export const OPENCODE_THEMES = [ info: '#0043ce', diffAdd: '#198038', diffDelete: '#da1e28', + syntax: { + comment: '#6f6f6f', + keyword: '#8a3ffc', + string: '#198038', + primitive: '#0f62fe', + property: '#0043ce', + type: '#8a5f00', + constant: '#da1e28', + }, }, dark: { neutral: '#393939', @@ -139,6 +206,15 @@ export const OPENCODE_THEMES = [ info: '#78a9ff', diffAdd: '#42be65', diffDelete: '#ff8389', + syntax: { + comment: '#6f6f6f', + keyword: '#be95ff', + string: '#42be65', + primitive: '#33b1ff', + property: '#78a9ff', + type: '#f1c21b', + constant: '#ff8389', + }, }, }, { @@ -155,6 +231,12 @@ export const OPENCODE_THEMES = [ info: '#04a5e5', diffAdd: '#a6d189', diffDelete: '#e78284', + syntax: { + comment: '#6c7086', + keyword: '#8839ef', + primitive: '#1e66f5', + constant: '#ca6702', + }, }, dark: { neutral: '#1e1e2e', @@ -167,6 +249,12 @@ export const OPENCODE_THEMES = [ info: '#89dceb', diffAdd: '#94e2d5', diffDelete: '#f38ba8', + syntax: { + comment: '#6c7086', + keyword: '#cba6f7', + primitive: '#89b4fa', + constant: '#fab387', + }, }, }, { @@ -182,6 +270,18 @@ export const OPENCODE_THEMES = [ error: '#e78284', info: '#81c8be', textWeak: '#b5bfe2', + syntax: { + comment: '#949cb8', + keyword: '#ca9ee6', + string: '#a6d189', + primitive: '#8da4e2', + property: '#99d1db', + type: '#e5c890', + constant: '#ef9f76', + variable: '#e78284', + operator: '#99d1db', + punctuation: '#c6d0f5', + }, }, dark: { neutral: '#303446', @@ -193,6 +293,18 @@ export const OPENCODE_THEMES = [ error: '#e78284', info: '#81c8be', textWeak: '#b5bfe2', + syntax: { + comment: '#949cb8', + keyword: '#ca9ee6', + string: '#a6d189', + primitive: '#8da4e2', + property: '#99d1db', + type: '#e5c890', + constant: '#ef9f76', + variable: '#e78284', + operator: '#99d1db', + punctuation: '#c6d0f5', + }, }, }, { @@ -208,6 +320,18 @@ export const OPENCODE_THEMES = [ error: '#ed8796', info: '#8bd5ca', textWeak: '#b8c0e0', + syntax: { + comment: '#939ab7', + keyword: '#c6a0f6', + string: '#a6da95', + primitive: '#8aadf4', + property: '#91d7e3', + type: '#eed49f', + constant: '#f5a97f', + variable: '#ed8796', + operator: '#91d7e3', + punctuation: '#cad3f5', + }, }, dark: { neutral: '#24273a', @@ -219,6 +343,18 @@ export const OPENCODE_THEMES = [ error: '#ed8796', info: '#8bd5ca', textWeak: '#b8c0e0', + syntax: { + comment: '#939ab7', + keyword: '#c6a0f6', + string: '#a6da95', + primitive: '#8aadf4', + property: '#91d7e3', + type: '#eed49f', + constant: '#f5a97f', + variable: '#ed8796', + operator: '#91d7e3', + punctuation: '#cad3f5', + }, }, }, { @@ -234,6 +370,18 @@ export const OPENCODE_THEMES = [ error: '#e91e63', info: '#ff5722', textWeak: '#5c6b7d', + syntax: { + comment: '#5c6b7d', + keyword: '#ff5722', + string: '#4caf50', + primitive: '#ff9800', + property: '#00acc1', + type: '#00acc1', + constant: '#e91e63', + variable: '#193549', + operator: '#ff5722', + punctuation: '#193549', + }, }, dark: { neutral: '#193549', @@ -247,6 +395,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#b9ff9f', diffDelete: '#ff5fb3', textWeak: '#adb7c9', + syntax: { + comment: '#0088ff', + keyword: '#ff9d00', + string: '#9eff80', + primitive: '#ffc600', + property: '#2affdf', + type: '#2affdf', + constant: '#ff628c', + variable: '#ffffff', + operator: '#ff9d00', + punctuation: '#ffffff', + }, }, }, { @@ -264,6 +424,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#55a583', diffDelete: '#e75e78', textWeak: '#141414ad', + syntax: { + comment: '#141414ad', + keyword: '#b3003f', + string: '#9e94d5', + primitive: '#db704b', + property: '#141414ad', + type: '#206595', + constant: '#b8448b', + variable: '#141414', + operator: '#141414', + punctuation: '#141414', + }, }, dark: { neutral: '#181818', @@ -277,6 +449,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#70b489', diffDelete: '#fc6b83', textWeak: '#e4e4e45e', + syntax: { + comment: '#e4e4e45e', + keyword: '#82D2CE', + string: '#E394DC', + primitive: '#EFB080', + property: '#81a1c1', + type: '#EFB080', + constant: '#F8C762', + variable: '#e4e4e4', + operator: '#e4e4e4', + punctuation: '#e4e4e4', + }, }, }, { @@ -293,6 +477,14 @@ export const OPENCODE_THEMES = [ info: '#1d7fc5', diffAdd: '#9fe3b3', diffDelete: '#f8a1b8', + syntax: { + comment: '#7d7f97', + keyword: '#d16090', + string: '#596600', + primitive: '#2f8f57', + property: '#1d7fc5', + constant: '#7c6bf5', + }, }, dark: { neutral: '#1d1e28', @@ -305,6 +497,14 @@ export const OPENCODE_THEMES = [ info: '#8be9fd', diffAdd: '#2fb27d', diffDelete: '#ff6b81', + syntax: { + comment: '#6272a4', + keyword: '#ff79c6', + string: '#f1fa8c', + primitive: '#50fa7b', + property: '#8be9fd', + constant: '#bd93f9', + }, }, }, { @@ -322,6 +522,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#4db380', diffDelete: '#f52a65', textWeak: '#a6b0a0', + syntax: { + comment: '#a6b0a0', + keyword: '#df69ba', + string: '#8da101', + primitive: '#8da101', + property: '#35a77c', + type: '#dfa000', + constant: '#f57d26', + variable: '#f85552', + operator: '#35a77c', + punctuation: '#5c6a72', + }, }, dark: { neutral: '#2d353b', @@ -335,6 +547,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#b8db87', diffDelete: '#e26a75', textWeak: '#7a8478', + syntax: { + comment: '#7a8478', + keyword: '#d699b6', + string: '#a7c080', + primitive: '#a7c080', + property: '#83c092', + type: '#dbbc7f', + constant: '#e69875', + variable: '#e67e80', + operator: '#83c092', + punctuation: '#d3c6aa', + }, }, }, { @@ -350,6 +574,18 @@ export const OPENCODE_THEMES = [ error: '#AF3029', info: '#24837B', textWeak: '#6F6E69', + syntax: { + comment: '#6F6E69', + keyword: '#66800B', + string: '#24837B', + primitive: '#BC5215', + property: '#24837B', + type: '#AD8301', + constant: '#5E409D', + variable: '#205EA6', + operator: '#6F6E69', + punctuation: '#6F6E69', + }, }, dark: { neutral: '#100F0F', @@ -361,6 +597,18 @@ export const OPENCODE_THEMES = [ error: '#D14D41', info: '#3AA99F', textWeak: '#6F6E69', + syntax: { + comment: '#6F6E69', + keyword: '#879A39', + string: '#3AA99F', + primitive: '#DA702C', + property: '#3AA99F', + type: '#D0A215', + constant: '#8B7EC8', + variable: '#4385BE', + operator: '#B7B5AC', + punctuation: '#B7B5AC', + }, }, }, { @@ -376,6 +624,18 @@ export const OPENCODE_THEMES = [ error: '#cf222e', info: '#bc4c00', textWeak: '#57606a', + syntax: { + comment: '#57606a', + keyword: '#cf222e', + string: '#0969da', + primitive: '#8250df', + property: '#1b7c83', + type: '#bc4c00', + constant: '#1b7c83', + variable: '#bc4c00', + operator: '#cf222e', + punctuation: '#24292f', + }, }, dark: { neutral: '#0d1117', @@ -387,6 +647,18 @@ export const OPENCODE_THEMES = [ error: '#f85149', info: '#d29922', textWeak: '#8b949e', + syntax: { + comment: '#8b949e', + keyword: '#ff7b72', + string: '#39c5cf', + primitive: '#bc8cff', + property: '#39c5cf', + type: '#d29922', + constant: '#58a6ff', + variable: '#d29922', + operator: '#ff7b72', + punctuation: '#c9d1d9', + }, }, }, { @@ -403,6 +675,12 @@ export const OPENCODE_THEMES = [ info: '#8f3f71', diffAdd: '#79740e', diffDelete: '#9d0006', + syntax: { + comment: '#928374', + keyword: '#9d0006', + primitive: '#076678', + constant: '#8f3f71', + }, }, dark: { neutral: '#282828', @@ -415,6 +693,12 @@ export const OPENCODE_THEMES = [ info: '#d3869b', diffAdd: '#b8bb26', diffDelete: '#fb4934', + syntax: { + comment: '#928374', + keyword: '#fb4934', + primitive: '#83a598', + constant: '#d3869b', + }, }, }, { @@ -432,6 +716,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#89AF5B', diffDelete: '#D61F1F', textWeak: '#9E9389', + syntax: { + comment: '#9E9389', + keyword: '#957FB8', + string: '#98BB6C', + primitive: '#2D4F67', + property: '#76946A', + type: '#C38D9D', + constant: '#D7A657', + variable: '#54433A', + operator: '#D27E99', + punctuation: '#54433A', + }, }, dark: { neutral: '#1F1F28', @@ -445,6 +741,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#A9D977', diffDelete: '#F24A4A', textWeak: '#727169', + syntax: { + comment: '#727169', + keyword: '#957FB8', + string: '#98BB6C', + primitive: '#7E9CD8', + property: '#76946A', + type: '#C38D9D', + constant: '#D7A657', + variable: '#DCD7BA', + operator: '#D27E99', + punctuation: '#DCD7BA', + }, }, }, { @@ -461,6 +769,18 @@ export const OPENCODE_THEMES = [ info: '#318795', diffDelete: '#f52a65', textWeak: '#8a8a8a', + syntax: { + comment: '#8a8a8a', + keyword: '#EC5B2B', + string: '#0062d1', + primitive: '#c94d24', + property: '#318795', + type: '#b0851f', + constant: '#EC5B2B', + variable: '#d1383d', + operator: '#318795', + punctuation: '#1a1a1a', + }, }, dark: { neutral: '#2a1a15', @@ -473,6 +793,18 @@ export const OPENCODE_THEMES = [ info: '#56b6c2', diffDelete: '#e26a75', textWeak: '#808080', + syntax: { + comment: '#808080', + keyword: '#EC5B2B', + string: '#6ba1e6', + primitive: '#EE7948', + property: '#56b6c2', + type: '#e5c07b', + constant: '#FFF7F1', + variable: '#e06c75', + operator: '#56b6c2', + punctuation: '#eeeeee', + }, }, }, { @@ -488,6 +820,18 @@ export const OPENCODE_THEMES = [ error: '#e53935', info: '#f4511e', textWeak: '#90a4ae', + syntax: { + comment: '#90a4ae', + keyword: '#7c4dff', + string: '#91b859', + primitive: '#6182b8', + property: '#7c4dff', + type: '#ffb300', + constant: '#f4511e', + variable: '#263238', + operator: '#39adb5', + punctuation: '#263238', + }, }, dark: { neutral: '#263238', @@ -499,6 +843,18 @@ export const OPENCODE_THEMES = [ error: '#f07178', info: '#ffcb6b', textWeak: '#546e7a', + syntax: { + comment: '#546e7a', + keyword: '#c792ea', + string: '#c3e88d', + primitive: '#82aaff', + property: '#c792ea', + type: '#ffcb6b', + constant: '#ffcb6b', + variable: '#eeffff', + operator: '#89ddff', + punctuation: '#eeffff', + }, }, }, { @@ -516,6 +872,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#5dac7e', diffDelete: '#d53a3a', textWeak: '#748476', + syntax: { + comment: '#748476', + keyword: '#c770ff', + string: '#1cc24b', + primitive: '#30b3ff', + property: '#24f6d9', + type: '#e6ff57', + constant: '#ffa83d', + variable: '#203022', + operator: '#24f6d9', + punctuation: '#203022', + }, }, dark: { neutral: '#0a0e0a', @@ -529,6 +897,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#77ffaf', diffDelete: '#ff7171', textWeak: '#8ca391', + syntax: { + comment: '#8ca391', + keyword: '#c770ff', + string: '#1cc24b', + primitive: '#30b3ff', + property: '#24f6d9', + type: '#e6ff57', + constant: '#ffa83d', + variable: '#62ff94', + operator: '#24f6d9', + punctuation: '#62ff94', + }, }, }, { @@ -544,6 +924,18 @@ export const OPENCODE_THEMES = [ error: '#b0175f', info: '#007f95', textWeak: '#70707d', + syntax: { + comment: '#70707d', + keyword: '#465bd1', + string: '#036e43', + primitive: '#5266eb', + property: '#5266eb', + type: '#007f95', + constant: '#a44200', + variable: '#007f95', + operator: '#465bd1', + punctuation: '#363644', + }, }, dark: { neutral: '#171721', @@ -555,6 +947,18 @@ export const OPENCODE_THEMES = [ error: '#fc92b4', info: '#77becf', textWeak: '#9d9da8', + syntax: { + comment: '#9d9da8', + keyword: '#8da4f5', + string: '#77c599', + primitive: '#8da4f5', + property: '#a7b6f8', + type: '#77becf', + constant: '#fc9b6f', + variable: '#77becf', + operator: '#8da4f5', + punctuation: '#dddde5', + }, }, }, { @@ -571,6 +975,14 @@ export const OPENCODE_THEMES = [ info: '#2d9ad7', diffAdd: '#bfe7a3', diffDelete: '#f6a3ae', + syntax: { + comment: '#8a816f', + keyword: '#d9487c', + string: '#8a6500', + primitive: '#3c8d2f', + property: '#1f88c8', + constant: '#9b5fe0', + }, }, dark: { neutral: '#272822', @@ -583,6 +995,14 @@ export const OPENCODE_THEMES = [ info: '#66d9ef', diffAdd: '#4d7f2a', diffDelete: '#f4477c', + syntax: { + comment: '#75715e', + keyword: '#f92672', + string: '#e6db74', + primitive: '#a6e22e', + property: '#66d9ef', + constant: '#ae81ff', + }, }, }, { @@ -599,6 +1019,12 @@ export const OPENCODE_THEMES = [ info: '#4876d6', diffAdd: '#2aa298', diffDelete: '#de3d3b', + syntax: { + comment: '#7a8181', + keyword: '#994cc3', + primitive: '#4876d6', + constant: '#c96765', + }, }, dark: { neutral: '#011627', @@ -611,6 +1037,13 @@ export const OPENCODE_THEMES = [ info: '#82aaff', diffAdd: '#c5e478', diffDelete: '#ef5350', + syntax: { + comment: '#637777', + keyword: '#c792ea', + string: '#ecc48d', + primitive: '#82aaff', + constant: '#f78c6c', + }, }, }, { @@ -627,6 +1060,13 @@ export const OPENCODE_THEMES = [ info: '#81a1c1', diffAdd: '#a3be8c', diffDelete: '#bf616a', + syntax: { + comment: '#6b7282', + keyword: '#5e81ac', + string: '#6f8758', + primitive: '#5e81ac', + constant: '#8d6886', + }, }, dark: { neutral: '#2e3440', @@ -639,6 +1079,12 @@ export const OPENCODE_THEMES = [ info: '#81a1c1', diffAdd: '#81a1c1', diffDelete: '#bf616a', + syntax: { + comment: '#616e88', + keyword: '#81a1c1', + primitive: '#88c0d0', + constant: '#b48ead', + }, }, }, { @@ -656,6 +1102,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#489447', diffDelete: '#d65145', textWeak: '#a0a1a7', + syntax: { + comment: '#a0a1a7', + keyword: '#a626a4', + string: '#50a14f', + primitive: '#4078f2', + property: '#0184bc', + type: '#c18401', + constant: '#986801', + variable: '#e45649', + operator: '#0184bc', + punctuation: '#383a42', + }, }, dark: { neutral: '#282c34', @@ -669,6 +1127,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#aad482', diffDelete: '#e8828b', textWeak: '#5c6370', + syntax: { + comment: '#5c6370', + keyword: '#c678dd', + string: '#98c379', + primitive: '#61afef', + property: '#56b6c2', + type: '#e5c07b', + constant: '#d19a66', + variable: '#e06c75', + operator: '#56b6c2', + punctuation: '#abb2bf', + }, }, }, { @@ -685,6 +1155,12 @@ export const OPENCODE_THEMES = [ info: '#61afef', diffAdd: '#c2ebcf', diffDelete: '#f7c1c5', + syntax: { + comment: '#6a717d', + keyword: '#a626a4', + primitive: '#4078f2', + constant: '#986801', + }, }, dark: { neutral: '#1e222a', @@ -697,6 +1173,12 @@ export const OPENCODE_THEMES = [ info: '#56b6c2', diffAdd: '#4b815a', diffDelete: '#b2555f', + syntax: { + comment: '#5c6370', + keyword: '#c678dd', + primitive: '#61afef', + constant: '#d19a66', + }, }, }, { @@ -713,6 +1195,18 @@ export const OPENCODE_THEMES = [ info: '#318795', diffDelete: '#f52a65', textWeak: '#8a8a8a', + syntax: { + comment: '#8a8a8a', + keyword: '#EC5B2B', + string: '#0062d1', + primitive: '#c94d24', + property: '#318795', + type: '#b0851f', + constant: '#EC5B2B', + variable: '#d1383d', + operator: '#318795', + punctuation: '#1a1a1a', + }, }, dark: { neutral: '#0a0a0a', @@ -725,6 +1219,18 @@ export const OPENCODE_THEMES = [ info: '#56b6c2', diffDelete: '#e26a75', textWeak: '#808080', + syntax: { + comment: '#808080', + keyword: '#EC5B2B', + string: '#6ba1e6', + primitive: '#EE7948', + property: '#56b6c2', + type: '#e5c07b', + constant: '#FFF7F1', + variable: '#e06c75', + operator: '#56b6c2', + punctuation: '#eeeeee', + }, }, }, { @@ -740,6 +1246,18 @@ export const OPENCODE_THEMES = [ error: '#c7392d', info: '#1faa90', textWeak: '#53685B', + syntax: { + comment: '#53685B', + keyword: '#1faa90', + string: '#3d7a52', + primitive: '#3d7560', + property: '#3d7a52', + type: '#3d7a52', + constant: '#a8527a', + variable: '#111c18', + operator: '#b5a020', + punctuation: '#111c18', + }, }, dark: { neutral: '#111c18', @@ -753,6 +1271,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#63b07a', diffDelete: '#db9f9c', textWeak: '#53685B', + syntax: { + comment: '#53685B', + keyword: '#2DD5B7', + string: '#63b07a', + primitive: '#509475', + property: '#549e6a', + type: '#549e6a', + constant: '#D2689C', + variable: '#C1C497', + operator: '#459451', + punctuation: '#C1C497', + }, }, }, { @@ -768,6 +1298,18 @@ export const OPENCODE_THEMES = [ error: '#e53935', info: '#f4511e', textWeak: '#8796b0', + syntax: { + comment: '#8796b0', + keyword: '#a854f2', + string: '#91b859', + primitive: '#4976eb', + property: '#00acc1', + type: '#ffb300', + constant: '#f4511e', + variable: '#292d3e', + operator: '#00acc1', + punctuation: '#292d3e', + }, }, dark: { neutral: '#292d3e', @@ -779,6 +1321,18 @@ export const OPENCODE_THEMES = [ error: '#f07178', info: '#f78c6c', textWeak: '#676e95', + syntax: { + comment: '#676e95', + keyword: '#c792ea', + string: '#c3e88d', + primitive: '#82aaff', + property: '#89ddff', + type: '#ffcb6b', + constant: '#f78c6c', + variable: '#a6accd', + operator: '#89ddff', + punctuation: '#a6accd', + }, }, }, { @@ -794,6 +1348,18 @@ export const OPENCODE_THEMES = [ error: '#b4637a', info: '#56949f', textWeak: '#9893a5', + syntax: { + comment: '#9893a5', + keyword: '#286983', + string: '#ea9d34', + primitive: '#d7827e', + property: '#d7827e', + type: '#56949f', + constant: '#907aa9', + variable: '#575279', + operator: '#797593', + punctuation: '#797593', + }, }, dark: { neutral: '#191724', @@ -805,6 +1371,18 @@ export const OPENCODE_THEMES = [ error: '#eb6f92', info: '#9ccfd8', textWeak: '#6e6a86', + syntax: { + comment: '#6e6a86', + keyword: '#31748f', + string: '#f6c177', + primitive: '#ebbcba', + property: '#ebbcba', + type: '#9ccfd8', + constant: '#c4a7e7', + variable: '#e0def4', + operator: '#908caa', + punctuation: '#908caa', + }, }, }, { @@ -821,6 +1399,15 @@ export const OPENCODE_THEMES = [ info: '#62d4ff', diffAdd: '#c8f8da', diffDelete: '#ffc3ef', + syntax: { + comment: '#8e4be3', + keyword: '#c45f00', + string: '#2f8b32', + primitive: '#a13bd6', + property: '#008fb8', + type: '#9d7a00', + constant: '#e04d7a', + }, }, dark: { neutral: '#1a102b', @@ -833,6 +1420,15 @@ export const OPENCODE_THEMES = [ info: '#7dd4ff', diffAdd: '#53c39f', diffDelete: '#d85aa0', + syntax: { + comment: '#b362ff', + keyword: '#ff9d00', + string: '#a5ff90', + primitive: '#fb94ff', + property: '#9effff', + type: '#fad000', + constant: '#ff628c', + }, }, }, { @@ -849,6 +1445,14 @@ export const OPENCODE_THEMES = [ info: '#2aa198', diffAdd: '#c6dc7a', diffDelete: '#f2a1a1', + syntax: { + comment: '#657b83', + keyword: '#728600', + string: '#1f8f88', + primitive: '#268bd2', + property: '#268bd2', + constant: '#d33682', + }, }, dark: { neutral: '#002b36', @@ -861,6 +1465,14 @@ export const OPENCODE_THEMES = [ info: '#2aa198', diffAdd: '#4c7654', diffDelete: '#c34b4b', + syntax: { + comment: '#586e75', + keyword: '#859900', + string: '#2aa198', + primitive: '#268bd2', + property: '#268bd2', + constant: '#d33682', + }, }, }, { @@ -876,6 +1488,18 @@ export const OPENCODE_THEMES = [ error: '#f44336', info: '#ff5722', textWeak: '#5c5c8a', + syntax: { + comment: '#5c5c8a', + keyword: '#e91e63', + string: '#ff9800', + primitive: '#ff5722', + property: '#9c27b0', + type: '#00bcd4', + constant: '#9c27b0', + variable: '#262335', + operator: '#e91e63', + punctuation: '#262335', + }, }, dark: { neutral: '#262335', @@ -889,6 +1513,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#97f1d8', diffDelete: '#ff5e5b', textWeak: '#848bbd', + syntax: { + comment: '#848bbd', + keyword: '#ff7edb', + string: '#fede5d', + primitive: '#ff8b39', + property: '#b084eb', + type: '#36f9f6', + constant: '#b084eb', + variable: '#ffffff', + operator: '#ff7edb', + punctuation: '#ffffff', + }, }, }, { @@ -905,6 +1541,13 @@ export const OPENCODE_THEMES = [ info: '#007197', diffAdd: '#4f8f7b', diffDelete: '#d05f7c', + syntax: { + comment: '#6b6f7a', + keyword: '#9854f1', + primitive: '#1f6fd4', + property: '#007197', + constant: '#b15c00', + }, }, dark: { neutral: '#1a1b26', @@ -917,6 +1560,13 @@ export const OPENCODE_THEMES = [ info: '#7dcfff', diffAdd: '#41a6b5', diffDelete: '#c34043', + syntax: { + comment: '#565f89', + keyword: '#bb9af7', + primitive: '#7aa2f7', + property: '#7dcfff', + constant: '#ff9e64', + }, }, }, { @@ -934,6 +1584,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#46A758', diffDelete: '#E5484D', textWeak: '#666666', + syntax: { + comment: '#888888', + keyword: '#E93D82', + string: '#46A758', + primitive: '#8E4EC6', + property: '#12A594', + type: '#12A594', + constant: '#FFB224', + variable: '#0070F3', + operator: '#E93D82', + punctuation: '#171717', + }, }, dark: { neutral: '#000000', @@ -947,6 +1609,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#63C46D', diffDelete: '#FF6166', textWeak: '#878787', + syntax: { + comment: '#878787', + keyword: '#F75590', + string: '#63C46D', + primitive: '#BF7AF0', + property: '#0AC7AC', + type: '#0AC7AC', + constant: '#F2A700', + variable: '#52A8FF', + operator: '#F75590', + punctuation: '#EDEDED', + }, }, }, { @@ -963,6 +1637,15 @@ export const OPENCODE_THEMES = [ info: '#FFC799', diffAdd: '#99FFE4', diffDelete: '#FF8080', + syntax: { + comment: '#7a7a7a', + keyword: '#6e6e6e', + string: '#117e69', + primitive: '#8d541c', + property: '#101010', + type: '#8d541c', + constant: '#8d541c', + }, }, dark: { neutral: '#101010', @@ -975,6 +1658,15 @@ export const OPENCODE_THEMES = [ info: '#FFC799', diffAdd: '#99FFE4', diffDelete: '#FF8080', + syntax: { + comment: '#8b8b8b', + keyword: '#a0a0a0', + string: '#99ffe4', + primitive: '#ffc799', + property: '#ffffff', + type: '#ffc799', + constant: '#ffc799', + }, }, }, { @@ -990,6 +1682,18 @@ export const OPENCODE_THEMES = [ error: '#8f5f5f', info: '#8f7f5f', textWeak: '#6f6f6f', + syntax: { + comment: '#5f7f5f', + keyword: '#8f8f5f', + string: '#8f5f5f', + primitive: '#5f7f8f', + property: '#5f8f8f', + type: '#5f8f8f', + constant: '#5f8f5f', + variable: '#3f3f3f', + operator: '#8f8f5f', + punctuation: '#3f3f3f', + }, }, dark: { neutral: '#3f3f3f', @@ -1003,6 +1707,18 @@ export const OPENCODE_THEMES = [ diffAdd: '#8fb28f', diffDelete: '#dca3a3', textWeak: '#9f9f9f', + syntax: { + comment: '#7f9f7f', + keyword: '#f0dfaf', + string: '#cc9393', + primitive: '#8cd0d3', + property: '#93e0e3', + type: '#93e0e3', + constant: '#8fb28f', + variable: '#dcdccc', + operator: '#f0dfaf', + punctuation: '#dcdccc', + }, }, }, ] as const satisfies readonly OpenCodeThemeDefinition[] diff --git a/shared/src/themes/types.ts b/shared/src/themes/types.ts index 88000238..760e2348 100644 --- a/shared/src/themes/types.ts +++ b/shared/src/themes/types.ts @@ -1,5 +1,22 @@ export type HexColor = `#${string}` +export const OPENCODE_SYNTAX_TOKENS = [ + 'comment', + 'keyword', + 'string', + 'primitive', + 'property', + 'type', + 'constant', + 'variable', + 'operator', + 'punctuation', +] as const + +export type OpenCodeSyntaxToken = (typeof OPENCODE_SYNTAX_TOKENS)[number] + +export type OpenCodeSyntaxPalette = Partial> + export interface OpenCodeThemePalette { neutral: HexColor ink: HexColor @@ -12,6 +29,7 @@ export interface OpenCodeThemePalette { diffAdd?: HexColor diffDelete?: HexColor textWeak?: HexColor + syntax?: OpenCodeSyntaxPalette } export interface OpenCodeThemeDefinition {