Skip to content

pantoken-root / formats/scope/src / resolveScheme

Function: resolveScheme() ​

resolveScheme(start): Scheme

Beta

The effective colour scheme for start: an explicit pin if any ancestor set one, otherwise the color-scheme the element actually computes to, otherwise the OS preference.

Never reads document.documentElement — that global read is exactly what desynchronises two instances on one page.

Parameters ​

start ​

Element | null

Returns ​

Scheme