Fix automatic readable text contrast for public and admin themes.
Local Build and Deploy / deploy (push) Successful in 55s
Local Build and Deploy / deploy (push) Successful in 55s
Derive admin/public text colors from WCAG contrast, unify ThemeVars CSS emission, and keep navbar overrides in sync with readable vars. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
9d4d409b77
commit
d7278c77f9
9 files changed
+205
-176
No files matched your search
@@ -73,7 +73,17 @@ export function ColorField({
|
||||
type="color"
|
||||
name={name}
|
||||
value={val}
|
||||
onChange={(e) => setVal(e.target.value)}
|
||||
onChange={(e) => {
|
||||
const next = e.target.value;
|
||||
if (bgValue) {
|
||||
const nextRatio = contrastRatio(next, bgValue);
|
||||
if (nextRatio != null && nextRatio < 4.5) {
|
||||
setVal(readableOn(bgValue));
|
||||
return;
|
||||
}
|
||||
}
|
||||
setVal(next);
|
||||
}}
|
||||
style={{
|
||||
width: 42,
|
||||
height: 36,
|
||||
|
||||
Reference in new issue
Block a user