Skip to content

pantoken-root / css-in-js

css-in-js ​

Compatibility ​

Target: Emotion CSS-in-JS. Current format: ThemeProvider SSR emits the Pantoken token variable. Minimum host version: 11.14.0. Tested through 11.14.0. Newer releases require review.

Full compatibility matrix

Experimental

@pantoken/css-in-js — un objecte de tema d'Instructure per a biblioteques CSS-in-JS en temps d'execució.

Funciona amb qualsevol biblioteca que llegeixi un tema de props.theme — Emotion, styled-components i Stitches comparteixen aquesta convenció. pantokenTheme és l'objecte rebrand prèfabricat, recolzat per var() per la qual cosa el canvi clar/fosc flueix per @pantoken/css. toStyledTheme construeix un a partir de qualsevol IR (i pot coure valors concrets amb { resolve }).

Exemple ​

styled-components

tsx
import { ThemeProvider } from "styled-components";
import { pantokenTheme } from "@pantoken/css-in-js";
<ThemeProvider theme={pantokenTheme}>...</ThemeProvider>;
// const Btn = styled.button`background: ${({ theme }) => theme.colorBackgroundBrand};`;

Interfícies ​

Àlies de tipus ​

Variables ​

Funcions ​

Referències ​

Mode ​

Re-exporta Mode


default ​

Canvia el nom i torna a exportar pantokenTheme