tailwindで定義した色をimportして使用する

tailwindのconfigで定義したprimaryの色とかをtailwindのクラス以外で使用したい。 import type { Config } from "tailwindcss"; export const customColors = { primary: "#2563eb", secondary: "#4b5563", danger: "#cd2626", success: "#16a34a", warning: "#f59e0b", }; const config: Config = { theme: { extend: { colors: customColors, }, }, plugins: [], }; export default config; みたいにすればいい。

投稿日 · 2024-06-29 · 更新日 · 2024-07-07 · 1 分 · nove-b