Skip to main content

ThemeOverride

A proposed theme: some colour roles, per theme. A role left out keeps its default.

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

Signature​

import type { ThemeOverride } from "@mapcairn/theme";

interface ThemeOverride

Properties​

colour​

colour?: {
light?: Partial<ThemeColours>;
dark?: Partial<ThemeColours>;
};

Colour roles to change, per theme.

fontFamily​

fontFamily?: string;

A font-family list such as "Brand Sans", system-ui, sans-serif: plain family names, quoted or not, and generic families. It does not change a contrast, so checkThemeContrast leaves it alone; it is read and written by createThemeStylesheet, which refuses a list with anything else in it. The host loads the font face (weights 400 and 600). Left out, the SDK's own font stack applies, and it follows this list as the fallback.

shape​

shape?: "square" | "default" | "round";

The corner style of the pill, the sheet, the controls and the inner shapes: square, default (the SDK's own) or round. Circular shapes stay circular, and the round preset keeps the search pill a pill. Like fontFamily, it does not change a contrast, so checkThemeContrast leaves it alone and createThemeStylesheet reads it, refusing any other value.

See also​

Source: packages/theme/src/checkThemeContrast.ts:24