From 4c2a5045a0d209cfda5723a4dc84fe59670b558e Mon Sep 17 00:00:00 2001 From: Taylor Mullen Date: Tue, 22 Apr 2025 18:57:47 -0700 Subject: Add theming support. - Added a number of common themes to our support matrix: - AtomOneDark - Dracula - VS - GitHub - GoogleCode - XCode - ... Admittedly these all were randomly picked, we could probably curate these better... - Added a new `ThemeDialog` UI that can be accessed via `/theme`. It shows your currentlyt available themes and allows you to change them freely. It does **not**: - Save the theme between sessions - Allow you to hit escape - Show a preview prior to selection. - These themes are from reacts highlight js library. Fixes https://b.corp.google.com/issues/412797985 --- packages/cli/src/ui/themes/dracula.ts | 99 +++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 packages/cli/src/ui/themes/dracula.ts (limited to 'packages/cli/src/ui/themes/dracula.ts') diff --git a/packages/cli/src/ui/themes/dracula.ts b/packages/cli/src/ui/themes/dracula.ts new file mode 100644 index 00000000..0b55435a --- /dev/null +++ b/packages/cli/src/ui/themes/dracula.ts @@ -0,0 +1,99 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +import { Theme } from './theme.js'; + +export const Dracula: Theme = new Theme('Dracula', { + hljs: { + display: 'block', + overflowX: 'auto', + padding: '0.5em', + background: '#282a36', + color: '#f8f8f2', + }, + 'hljs-keyword': { + color: '#8be9fd', + fontWeight: 'bold', + }, + 'hljs-selector-tag': { + color: '#8be9fd', + fontWeight: 'bold', + }, + 'hljs-literal': { + color: '#8be9fd', + fontWeight: 'bold', + }, + 'hljs-section': { + color: '#8be9fd', + fontWeight: 'bold', + }, + 'hljs-link': { + color: '#8be9fd', + }, + 'hljs-function .hljs-keyword': { + color: '#ff79c6', + }, + 'hljs-subst': { + color: '#f8f8f2', + }, + 'hljs-string': { + color: '#f1fa8c', + }, + 'hljs-title': { + color: '#f1fa8c', + fontWeight: 'bold', + }, + 'hljs-name': { + color: '#f1fa8c', + fontWeight: 'bold', + }, + 'hljs-type': { + color: '#f1fa8c', + fontWeight: 'bold', + }, + 'hljs-attribute': { + color: '#f1fa8c', + }, + 'hljs-symbol': { + color: '#f1fa8c', + }, + 'hljs-bullet': { + color: '#f1fa8c', + }, + 'hljs-addition': { + color: '#f1fa8c', + }, + 'hljs-variable': { + color: '#f1fa8c', + }, + 'hljs-template-tag': { + color: '#f1fa8c', + }, + 'hljs-template-variable': { + color: '#f1fa8c', + }, + 'hljs-comment': { + color: '#6272a4', + }, + 'hljs-quote': { + color: '#6272a4', + }, + 'hljs-deletion': { + color: '#6272a4', + }, + 'hljs-meta': { + color: '#6272a4', + }, + 'hljs-doctag': { + fontWeight: 'bold', + }, + 'hljs-strong': { + fontWeight: 'bold', + }, + 'hljs-emphasis': { + fontStyle: 'italic', + }, +}); -- cgit v1.2.3