diff --git a/packages/theme/src/theme-engine/types.ts b/packages/theme/src/theme-engine/types.ts index 8bc4a74bb..9e535e3fe 100644 --- a/packages/theme/src/theme-engine/types.ts +++ b/packages/theme/src/theme-engine/types.ts @@ -167,6 +167,7 @@ export type PartialOrFullColors = export type Variants = { primary: PartialOrFullColors; secondary: PartialOrFullColors; + tertiary: PartialOrFullColors; disabled: PartialOrFullColors; selected: PartialOrFullColors; error: PartialOrFullColors; @@ -242,6 +243,11 @@ export type Colors = { * @deprecated true */ textSelection: string; + /** + * Only Hex RGB values are supported. No Alpha. (e.g. #f33ff3) + * @pattern ^#(?:[0-9a-fA-F]{3}){1,2}$ + */ + buttonForeground: string; }; export type VariantsWithStaticColors = @@ -312,7 +318,8 @@ export const COLORS: readonly (keyof Colors)[] = [ "placeholder", "hover", "accentForeground", - "backdrop" + "backdrop", + "buttonForeground" ]; export const ALPHA_COLORS: readonly (keyof Colors)[] = [ @@ -327,6 +334,7 @@ export const ALPHA_COLORS: readonly (keyof Colors)[] = [ export const Variants: readonly (keyof Variants)[] = [ "primary", "secondary", + "tertiary", "disabled", "selected", "error", diff --git a/packages/theme/src/theme-engine/utils.ts b/packages/theme/src/theme-engine/utils.ts index 93e23ddd4..a3ca06e09 100644 --- a/packages/theme/src/theme-engine/utils.ts +++ b/packages/theme/src/theme-engine/utils.ts @@ -127,6 +127,13 @@ export function buildVariants( ...themeScope.secondary, shade: deriveShadeColor(getColor("secondary", "accent")) }, + tertiary: { + ...defaultThemeBase.tertiary, + ...defaultThemeScope.tertiary, + ...theme.scopes.base.tertiary, + ...themeScope.tertiary, + shade: deriveShadeColor(getColor("tertiary", "accent")) + }, disabled: { ...defaultThemeBase.disabled, ...defaultThemeScope.disabled,