API參考·基色
@oriatheme/colors
不随主题改变的稳定基色,以及 Tailwind v4 兼容的公共 CSS 子路径。包裝及環境
靜態值;可在 JavaScript、CSS 和 SSR 環境中使用。
bash
pnpm add @oriatheme/colorsbash
npm install @oriatheme/colorsbash
yarn add @oriatheme/colorsbash
bun add @oriatheme/colors使用消費者專案已經選擇的套件管理器和鎖定檔案。範例僅使用包根匯出;不要從 src、dist 或註冊表範本深度匯入。
Exports
| 出口 | 簽名 | 描述 |
|---|---|---|
oriaColors | OriaColors | 26 個不可變的命名尺度以及黑色、白色、繼承、透明和當前。 |
oriaColorFamilies | readonly OriaColorFamily[] | 26個穩定的姓氏。 |
oriaColorSteps | readonly OriaColorStep[] | 50 到 950,分十一個步驟。 |
toOriaColorVariable | (family, step) => `--oria-palette-${family}-${step}` | 傳回穩定的基色自訂屬性名稱。 |
ts
import { oriaColors, toOriaColorVariable } from "@oriatheme/colors";
const blue = oriaColors.blue[500];
const variable = toOriaColorVariable("blue", 500);CSS
css
@import "@oriatheme/colors/styles.css";
@import "tailwindcss";
@import "@oriatheme/colors/tailwind.css";OriaTheme 的基底色永遠不會改變。使用運行時為主題響應式 UI 編寫的語意 --oria-* 變數。