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

Sperimentale

@pantoken/css-in-js — un oggetto tema di Instructure per librerie CSS-in-JS a runtime.

Funziona con qualsiasi libreria che legga un tema da props.theme — Emotion, styled-components e Stitches condividono questa convenzione. pantokenTheme è l'oggetto rebrand pronto all'uso, basato su var() in modo che il passaggio light/dark venga propagato tramite @pantoken/css. toStyledTheme costruisce uno a partire da qualsiasi IR (e può materializzare valori concreti con { resolve }).

Esempio ​

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};`;

Interfacce ​

Alias di tipo ​

Variabili ​

Funzioni ​

Riferimenti ​

Mode ​

Re-esporta Mode


default ​

Rinomina e riesporta pantokenTheme