fix(web): keep generated muted foreground dimmer than entered text (#9113)
This commit is contained in:
1 parent
d0b19b32e0
commit
cdbf324aa0
2 files changed
+4
-1
No files matched your search
@@ -156,6 +156,9 @@ describe("theme files", () => {
|
||||
expect(contrastRatio(colors.textMuted, colors.canvas)).toBeGreaterThanOrEqual(4.5);
|
||||
expect(contrastRatio(colors.textMuted, colors.canvas)).toBeLessThan(5.5);
|
||||
expect(contrastRatio(colors.mutedForeground, colors.muted)).toBeGreaterThanOrEqual(4.5);
|
||||
expect(contrastRatio(colors.mutedForeground, colors.muted)).toBeLessThan(
|
||||
contrastRatio(colors.text, colors.muted),
|
||||
);
|
||||
expect(contrastRatio(colors.placeholder, colors.surfaceRaised)).toBeGreaterThanOrEqual(4.5);
|
||||
expect(contrastRatio(colors.placeholder, colors.surfaceRaised)).toBeLessThan(
|
||||
contrastRatio(colors.text, colors.surfaceRaised),
|
||||
|
||||
@@ -916,7 +916,7 @@ export function createVividThemeColors(
|
||||
themeOklchToThemeColor(
|
||||
solveOklchLightness(textBase, surfaceRgb, 4.6, dark ? "lighter" : "darker"),
|
||||
);
|
||||
const mutedForeground = foregroundOn(mutedRgb);
|
||||
const mutedForeground = themeRgbToThemeColor(readableThemeText(mutedRgb, textRgb, 1, 4.6));
|
||||
const placeholder = themeRgbToThemeColor(readableThemeText(surfaceRaisedRgb, textRgb, 1, 4.6));
|
||||
|
||||
const actionHover: ThemeOklch = { ...action, L: action.L + (dark ? 0.06 : -0.06) };
|
||||
|
||||
Reference in new issue
Block a user