Skip to content

ThemeLayers

module ThemeLayers
AssemblyPartas.Nacara.Theme.Contracts
Attributes[<RequireQualifiedAccess>]

The cascade layers the theme of this build declares, for a plugin that has to order its own against them.

A CSS tool cannot ask the theme directly without depending on it, and a plugin cannot read what the theme contributed to the registry unless it was registered after the theme - which the theme cannot require, since it reads what plugins offered and so must come last itself. This is written once while the theme configures itself and read when a stylesheet is bundled, by which time every plugin has configured.

One build at a time, in one process. A host building two sites at once would see them share this.

Functions and values

current () : string list

What the theme declared, or nothing if no theme did.

Read it when bundling rather than when configuring: a plugin registered before the theme would otherwise see the empty list.

declare (names: string list) : unit

The theme says what its layers are called, in cascade order.

Parameter
namesTheir full names - nacara.tokens, nacara.base.