Skip to content

pantoken-root / formats/css/src / multiScopeCss

Funzione: multiScopeCss() ​

multiScopeCss(options): string

Beta

Il foglio multi-scope completo: ordine dei layer, un set di registrazioni @property, un blocco base condiviso , un blocco di token per tema e i pin light/dark color-scheme.

I token sono partizionati in base al fatto che il loro valore vari effettivamente tra i themes. I token invarianti vanno nel blocco base condiviso una sola volta; i token varianti vengono ripetuti per intero in ogni blocco tema. Quella seconda metà è ciò che rende sicuro l'annidamento — un blocco tema che omettesse un token variabile erediterà il valore del suo scope contenitore per quel token.

Parametri ​

options ​

MultiScopeCssOptions

Restituisce ​

string

Esempio ​

ts
import { multiScopeCss } from "@pantoken/css";

multiScopeCss({ themes: ["rebrand", "canvas"], defaultTheme: "rebrand" });