Skip to content

pantoken / css-in-js

css-in-js

Turgnamhach

@pantoken/css-in-js — réad téama Instructure do leabharlanna CSS-in-JS ag rith.

Oibríonn sé le haon leabharlann a léann téama ón props.theme — roinneann Emotion, styled-components, agus Stitches an nós sin. Is é pantokenTheme an réad rebrand réidh le húsáid, tacaíocht var() ionas go sruthóidh an lasc soiléir/dorcha tríd an @pantoken/css. Tógann toStyledTheme ceann ó aon IR (agus is féidir luachanna concréite a chur isteach le { resolve }).

Sampla

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

Comhéadan

Aliasanna Cineál

Athróga

Feidhmeanna

Tagairtí

Mode

Ath-easpórtálann Mode


default

Athainmníonn agus ath-easpórtálann pantokenTheme