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

1 min read

tailwindconfigで定義した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;

みたいにすればいい。

My avatar

Thanks for reading my blog post! Feel free to check out my other posts or contact me via the social links in the footer.


More Posts

Comments