summaryrefslogtreecommitdiff
path: root/packages/cli/src
diff options
context:
space:
mode:
authorJacob Richman <[email protected]>2025-05-02 09:31:18 -0700
committerGitHub <[email protected]>2025-05-02 09:31:18 -0700
commit539ab947a49b0351759df5192ed44f17d217b2f1 (patch)
treeeb45ee25f24077745456215cb7e9578d79983404 /packages/cli/src
parenta7679db6e99f971306bc4b27c603e93bc67ac254 (diff)
Use parameter properties where possible. (#242)
Diffstat (limited to 'packages/cli/src')
-rw-r--r--packages/cli/src/ui/themes/theme.ts13
1 files changed, 2 insertions, 11 deletions
diff --git a/packages/cli/src/ui/themes/theme.ts b/packages/cli/src/ui/themes/theme.ts
index 76f692c6..88868790 100644
--- a/packages/cli/src/ui/themes/theme.ts
+++ b/packages/cli/src/ui/themes/theme.ts
@@ -66,17 +66,10 @@ export const ansiTheme: ColorsTheme = {
export class Theme {
/**
- * The user-facing name of the theme.
- */
- readonly name: string;
-
- /**
* The default foreground color for text when no specific highlight rule applies.
* This is an Ink-compatible color string (hex or name).
*/
readonly defaultColor: string;
-
- readonly colors: ColorsTheme;
/**
* Stores the mapping from highlight.js class names (e.g., 'hljs-keyword')
* to Ink-compatible color strings (hex or name).
@@ -256,13 +249,11 @@ export class Theme {
* @param rawMappings The raw CSSProperties mappings from a react-syntax-highlighter theme object.
*/
constructor(
- name: string,
+ readonly name: string,
rawMappings: Record<string, CSSProperties>,
- colors: ColorsTheme,
+ readonly colors: ColorsTheme,
) {
- this.name = name;
this._colorMap = Object.freeze(this._buildColorMap(rawMappings)); // Build and freeze the map
- this.colors = colors;
// Determine the default foreground color
const rawDefaultColor = rawMappings['hljs']?.color;