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

प्रयोगात्मक

@pantoken/css-in-js — रनटाइम CSS-in-JS लाइब्रेरीज़ के लिए एक Instructure थीम ऑब्जेक्ट।

props.theme से थीम पढ़ने वाली किसी भी लाइब्रेरी के साथ काम करता है — Emotion, styled-components, और Stitches सभी वही परंपरा साझा करते हैं। pantokenTheme तैयार-निर्मित rebrand ऑब्जेक्ट है, var()‑समर्थित होने के कारण लाइट/डार्क स्विचिंग @pantoken/css के माध्यम से प्रवाहित होती है। toStyledTheme किसी भी IR से एक बनाता है (और { resolve } के साथ ठोस मान भी तैयार कर सकता है)।

उदाहरण ​

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

इंटरफेस ​

टाइप एलियास ​

वैरिएबल्स ​

फंक्शन्स ​

संदर्भ ​

Mode ​

Mode को पुनः निर्यात करता है।


default ​

नाम बदलता है और pantokenTheme को पुनः निर्यात करता है