カスタマイズ
Yamada UIのコンフィグをカスタマイズする方法を学ぶ。
CSS変数のプレフィックスを変更する場合は、css.varPrefixに値を設定します。
- 1
- 2
コンフィグを変更する
生成したテーマの
config.tsを変更します。theme/config.ts
import { defineConfig } from "@yamada-ui/react" export const config = defineConfig({ css: { varPrefix: "custom" }, breakpoint: { direction: "down", identifier: "@media screen" }, defaultColorMode: "dark", defaultThemeScheme: "base", notice: { duration: 5000 }, theme: { responsive: true }, }) - 3
プロバイダーを更新する
生成したテーマを
UIProviderに設定します。import { UIProvider } from "@workspaces/ui" import { theme, config } from "@workspace/theme" const App = () => { return ( <UIProvider theme={theme} config={config}> <YourApplication /> </UIProvider> ) }