~/talk

Accessible by Law! Generating Colors with JS and CSS Custom Properties

Talkat CSSconf EU 2018 · on Friday, 2018-06-01· [css, accessibility]
slides:none on file

Norway’s accessibility law motivates a live system that lets organizations pick any brand color while guaranteeing WCAG contrast by computing variants once in JavaScript and writing them as CSS variables. It uses CSS custom properties and the color.js/npm package to test 4.5:1 contrast, mix toward black for darker variants, and rotate hue for secondary colors. The result is a theme component that sets variables at runtime, adds a conditional border when needed, and updates the UI instantly.

AI-written summary · about

  1. 0:00Websites illegal in Norway
  2. 3:39Colors for video calling
  3. 8:58WCAG contrast rules
  4. 11:09CSS custom properties for theming
  5. 13:16Darker colors for accessibility
  6. 16:49Conditional borders for contrast
  7. 18:10Secondary brand colors mathematically
  8. 21:38Dynamic theme engine
  9. 24:10Live demo of color system
  10. 25:55Accessibility is team effort
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.