--- title: カスタマイズ description: "Yamada UIのコンフィグをカスタマイズする方法を学ぶ。" --- CSS変数のプレフィックスを変更する場合は、`css.varPrefix`に値を設定します。 ### テーマを生成する [CLI](https://yamada-ui.com/docs/theming/cli.md)を使用してテーマを生成します。 :::warning 下記のコマンドを実行する前に、`@yamada-ui/cli`をインストールして`init`コマンドを実行する必要があります。詳しくは、[こちら](https://yamada-ui.com/docs/get-started/cli.md)をご覧ください。 ::: ```bash pnpm yamada-cli theme ``` ```bash npm yamada-cli theme ``` ```bash yarn yamada-cli theme ``` ```bash bun yamada-cli theme ``` ### コンフィグを変更する 生成したテーマの`config.ts`を変更します。 ```tsx import { defineConfig } from "@yamada-ui/react" export const config = defineConfig({ css: { varPrefix: "custom" }, // [!code highlight] breakpoint: { direction: "down", identifier: "@media screen" }, defaultColorMode: "dark", defaultThemeScheme: "base", notice: { duration: 5000 }, theme: { responsive: true }, }) ``` ### プロバイダーを更新する 生成したテーマを`UIProvider`に設定します。 ```tsx import { UIProvider } from "@workspaces/ui" import { theme, config } from "@workspace/theme" const App = () => { return ( ) } ```