diff --git a/app/client/packages/design-system/theming/src/color/DarkModeTheme.ts b/app/client/packages/design-system/theming/src/color/DarkModeTheme.ts index 282ab5c0db..83b8a18808 100644 --- a/app/client/packages/design-system/theming/src/color/DarkModeTheme.ts +++ b/app/client/packages/design-system/theming/src/color/DarkModeTheme.ts @@ -546,7 +546,17 @@ export class DarkModeTheme implements ColorModeTheme { } private get bgAssistive() { - return this.fg.clone(); + const color = this.seedColor.clone(); + + // Background color for assistive UI elements (e.g. tooltip); light to stand out against bg + color.oklch.l = 0.94; + color.oklch.c = 0.03; + + if (this.seedIsAchromatic) { + color.oklch.c = 0; + } + + return color; } /* @@ -574,7 +584,7 @@ export class DarkModeTheme implements ColorModeTheme { private get fgAccent() { const color = this.seedColor.clone(); - // For light content on dark background APCA contrast is negative. −60 is “The minimum level recommended for content text that is not body, column, or block text. In other words, text you want people to read.” Failure to reach this contrast level is most likely due to low lightness. Lightness and chroma are set to ones that reach the threshold universally irregardless of hue. + // For light content on dark background APCA contrast is negative. −60 is “The minimum level recommended for content text that is not body, column, or block text. In other words, text you want people to read.” Failure to reach this contrast level is most likely due to low lightness. Lightness and chroma are set to ones that reach the threshold universally regardless of hue. if (this.bg.contrastAPCA(this.seedColor) >= -60) { if (this.seedIsAchromatic) { color.oklch.l = 0.79; @@ -712,7 +722,7 @@ export class DarkModeTheme implements ColorModeTheme { private get bdAccent() { const color = this.seedColor.clone(); - // For light content on dark background APCA contrast is negative. −15 is “The absolute minimum for any non-text that needs to be discernible and differentiable, but does not apply to semantic non-text such as icons”. In practice, thin borders are perceptually too subtle when using this as a threshould. −25 is used as the required minimum instead. Failure to reach this contrast level is most likely due to high lightness. Lightness and chroma are set to ones that reach the threshold universally irregardless of hue. + // For light content on dark background APCA contrast is negative. −15 is “The absolute minimum for any non-text that needs to be discernible and differentiable, but does not apply to semantic non-text such as icons”. In practice, thin borders are perceptually too subtle when using this as a threshould. −25 is used as the required minimum instead. Failure to reach this contrast level is most likely due to high lightness. Lightness and chroma are set to ones that reach the threshold universally regardless of hue. if (this.bg.contrastAPCA(this.seedColor) >= -25) { if (this.seedIsAchromatic) { color.oklch.l = 0.82; diff --git a/app/client/packages/design-system/theming/src/color/LightModeTheme.ts b/app/client/packages/design-system/theming/src/color/LightModeTheme.ts index f76381fe02..7f1ebfa713 100644 --- a/app/client/packages/design-system/theming/src/color/LightModeTheme.ts +++ b/app/client/packages/design-system/theming/src/color/LightModeTheme.ts @@ -578,7 +578,17 @@ export class LightModeTheme implements ColorModeTheme { } private get bgAssistive() { - return this.fg.clone(); + const color = this.seedColor.clone(); + + // Background color for assistive UI elements (e.g. tooltip); dark to stand out against bg + color.oklch.l = 0.16; + color.oklch.c = 0.07; + + if (this.seedIsAchromatic) { + color.oklch.c = 0; + } + + return color; } /* @@ -606,7 +616,7 @@ export class LightModeTheme implements ColorModeTheme { private get fgAccent() { const color = this.seedColor.clone(); - // For dark content on light background APCA contrast is positive. 60 is “The minimum level recommended for content text that is not body, column, or block text. In other words, text you want people to read.” Failure to reach this contrast level is most likely due to high lightness. Lightness and chroma are set to ones that reach the threshold universally irregardless of hue. + // For dark content on light background APCA contrast is positive. 60 is “The minimum level recommended for content text that is not body, column, or block text. In other words, text you want people to read.” Failure to reach this contrast level is most likely due to high lightness. Lightness and chroma are set to ones that reach the threshold universally regardless of hue. if (this.bg.contrastAPCA(this.seedColor) <= 60) { if (this.seedIsAchromatic) { color.oklch.l = 0.45; @@ -748,7 +758,7 @@ export class LightModeTheme implements ColorModeTheme { private get bdAccent() { const color = this.seedColor.clone(); - // For dark content on light background APCA contrast is positive. 15 is “The absolute minimum for any non-text that needs to be discernible and differentiable, but does not apply to semantic non-text such as icons”. In practice, thin borders are perceptually too subtle when using this as a threshould. 25 is used as the required minimum instead. Failure to reach this contrast level is most likely due to high lightness. Lightness and chroma are set to ones that reach the threshold universally irregardless of hue. + // For dark content on light background APCA contrast is positive. 15 is “The absolute minimum for any non-text that needs to be discernible and differentiable, but does not apply to semantic non-text such as icons”. In practice, thin borders are perceptually too subtle when using this as a threshould. 25 is used as the required minimum instead. Failure to reach this contrast level is most likely due to high lightness. Lightness and chroma are set to ones that reach the threshold universally regardless of hue. if (this.bg.contrastAPCA(this.seedColor) <= 25) { if (this.seedIsAchromatic) { color.oklch.l = 0.3;