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

Arbrofol

@pantoken/css-in-js — gwrthrych thema Instructure ar gyfer llyfrgelloedd CSS-in-JS amser-rhediad.

Gweithia gyda unrhyw lyfrgell sy'n darllen thema o props.theme — rhannir y confensiwn hwn gan Emotion, styled-components, a Stitches. Mae pantokenTheme yn wrthrych rebrand parod, wedi'i gefnogi gan var() felly mae newid rhwng golau/tywyll yn llifo trwy @pantoken/css. Mae toStyledTheme yn adeiladu un o unrhyw IR (ac yn gallu pobi gwerthoedd concrid gyda { resolve }).

Enghraifft ​

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

Rhyngwynebau ​

Aliasau Math ​

Newidynnau ​

Swyddogaethau ​

Cyfeiriadau ​

Mode ​

Ail-allforio Mode


default ​

Ail-enwio ac ail-allforio pantokenTheme