Skip Navigation
Type MethodMethod

stylesheet(includeDarkMode:)

The stylesheet rules that apply the chosen colour scheme.

static func stylesheet(includeDarkMode: Bool) -> String

Parameters

includeDarkMode

Whether the stylesheet contains dark mode styles.

Return Value

The CSS rules.

Discussion

A scheme counts as chosen when the body’s schemeAttribute names it (set by scripts) or when its radio button in the toggle is checked (without scripts). Choosing Light or Dark sets the color-scheme of the body, which selects the light or dark half of every light-dark() colour of the palette on screen; printed pages always use the light appearance. Without dark mode, the toggle is hidden instead.