~/talk

The Perfect Dark Mode

links:none on file
slides:none on file

Shows how to eliminate the white flicker by running a blocking inline script in the HTML (Next.js _document) that uses an immediately-invoked function to read localStorage and window.matchMedia, then writes values into CSS variables and a data-theme attribute before paint. The code persists user choice, falls back to system preference and light if absent, defers rendering the toggle until state is known, and removes the flash while preserving correct theme and toggle state.

AI-written summary · about

  1. 0:00Introduction and speaker intro
  2. 1:04What is perfect dark mode
  3. 3:32Basic dark mode toggle example
  4. 4:57Storing user preferences
  5. 6:02System preference detection
  6. 7:25Preventing the white flash
  7. 9:09Blocking scripts in HTML
  8. 10:39Immediately-invoked functions
  9. 12:05Setting initial color mode
  10. 13:07CSS variables for themes
  11. 15:59Passing preference to document
  12. 16:42Recap of the solution
  13. 17:26Putting it all together
  14. 18:50Final implementation and demo
  15. 19:12Resources and closing
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.