Skip to main content

ThemeSourceControls

How the theme contract scripts a source. A real adapter implements these by mocking matchMedia and reading the document it applies the theme to.

This is an interface exported by @mapcairn/core/contracts, checked against version 0.2.0.

Signature​

import type { ThemeSourceControls } from "@mapcairn/core/contracts";

interface ThemeSourceControls

Methods​

applied​

applied(): ResolvedTheme | null;

The theme currently reflected on the document, or null when none is.

setSystemTheme​

setSystemTheme(theme: ResolvedTheme): void;

Changes the operating system's colour scheme, as the user would.

  • theme (ResolvedTheme)

See also​

Source: packages/core/src/contracts/themeSource.contract.ts:11