| 1 | import type { AppearanceContrast } from "@t3tools/contracts/settings"; |
| 2 | |
| 3 | export function applyAppearanceContrast(root: HTMLElement, contrast: AppearanceContrast): void { |
| 4 | root.style.setProperty("--appearance-contrast-base", `${Math.min(contrast, 100)}%`); |
| 5 | root.style.setProperty("--appearance-contrast-boost", `${Math.max(contrast - 100, 0)}%`); |
| 6 | root.style.setProperty( |
| 7 | "--appearance-contrast-border-boost", |
| 8 | `${Math.max(contrast - 100, 0) / 4}%`, |
| 9 | ); |
| 10 | } |