themes/high_contrast.ts

view source

Declarations
#

high_contrast_theme
#

themes/high_contrast.ts view source

{ name: string; variables: { name: string; dark?: string | undefined; base?: string | undefined; summary?: string | undefined; }[]; summary?: string | undefined; scheme?: "light" | "dark" | "dual" | undefined; }

type Theme

import {high_contrast_theme} from '@fuzdev/fuz_css/themes/high_contrast.js';

Strengthened contrast: the theme it composes over, with its --contrast knob at HIGH_CONTRAST. The ground stretches halfway from its own lightness toward the contrast end, the shade curve bends a little so the surfaces stay close to it, the default control border moves toward a stronger shade stop - past 3:1 against the ground without pinning a border color - and the bent text curve pulls the text stops toward the end. The theme's ground, cast, palette, and roles stay its own, only strengthened: the ground moves only part way to the end, so a tinted ground keeps part of its tint.

Picking the modifier sets contrast to HIGH_CONTRAST, as picking a theme sets its knobs: composition is last-wins, so it replaces a theme's own contrast, a higher one included. The OS prefers-contrast: more preference reaches the same derivation through its own input (--_contrast_preference, set in style.css), and the effective contrast is the larger of the two - so the preference renders what the modifier does over a theme at the default, only ever raises a theme's own contrast, and no theme can silence it.

Depends on
#

Imported by
#