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

Experimental

@pantoken/css-in-js — كائن سمة لـ Instructure لمكتبات CSS-in-JS في وقت التشغيل.

يتوافق مع أي مكتبة تقرأ سمة من props.theme — كل من Emotion و styled-components و Stitches تتبع هذا الاتفاق. pantokenTheme هو كائن rebrand الجاهز للاستخدام، مدعوم بـ var() بحيث ينتقل تبديل النمط الفاتح/الداكن عبر @pantoken/css. toStyledTheme ينشئ واحدًا من أي IR (ويمكنه تحويل القيم إلى قيم ملموسة باستخدام { resolve }).

Example ​

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

الواجهات ​

الأسماء المستعارة للنوع ​

المتغيرات ​

الدوال ​

References ​

Mode ​

يعيد تصدير Mode


default ​

يعيد تسمية وإعادة تصدير pantokenTheme