microsoft/typespec
Publicmirrored from https://github.com/microsoft/typespecAvailable
packages/html-program-viewer/src/constants.ts
28lines · modecode
| 1 | const variablePrefix = `--tsp-tgv`; |
| 2 | export const ColorsVariables = { |
| 3 | background: `${variablePrefix}-background`, |
| 4 | dataKey: `${variablePrefix}-data-key`, |
| 5 | indentationGuide: `${variablePrefix}-indentation-guide`, |
| 6 | literal: `${variablePrefix}-literal`, |
| 7 | property: `${variablePrefix}-property`, |
| 8 | ref: `${variablePrefix}-ref`, |
| 9 | typeKind: `${variablePrefix}-type-kind`, |
| 10 | typeName: `${variablePrefix}-type-name`, |
| 11 | } as const; |
| 12 | |
| 13 | export type ColorVariable = keyof typeof ColorsVariables; |
| 14 | export type ColorPalette = Record<ColorVariable, string>; |
| 15 | export const DefaultColors: ColorPalette = { |
| 16 | background: "#f3f3f3", |
| 17 | dataKey: "#333333", |
| 18 | indentationGuide: "#777", |
| 19 | literal: "#5da713", |
| 20 | property: "#9c5d27", |
| 21 | ref: "#268bd2", |
| 22 | typeKind: "#7a3e9d", |
| 23 | typeName: "#333333", |
| 24 | }; |
| 25 | |
| 26 | export const Colors: typeof ColorsVariables = Object.fromEntries( |
| 27 | Object.entries(ColorsVariables).map(([k, v]) => [k, `var(${v}, ${(DefaultColors as any)[k]})`]) |
| 28 | ) as any; |
| 29 | |