Skip to content

pantoken / css-in-js

css-in-js

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