mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
Merge branch 'main' of github.com:nextui-org/nextui into feat/new-lading-page
This commit is contained in:
commit
7b4a45dc63
2
apps/docs/content/docs/theme/dark-mode.mdx
vendored
2
apps/docs/content/docs/theme/dark-mode.mdx
vendored
@ -41,6 +41,7 @@ import { ThemeProvider as NextThemesProvider } from 'next-themes';
|
||||
// 2. Call `createTheme` and pass your custom values
|
||||
const lightTheme = createTheme({
|
||||
type: 'light',
|
||||
className: 'light', // customize the class that enables this theme, `light-theme` by default
|
||||
theme: {
|
||||
colors: {...},
|
||||
}
|
||||
@ -48,6 +49,7 @@ const lightTheme = createTheme({
|
||||
|
||||
const darkTheme = createTheme({
|
||||
type: 'dark',
|
||||
className: 'dark', // customize the class that enables this theme, `dark-theme` by default
|
||||
theme: {
|
||||
colors: {...},
|
||||
}
|
||||
|
||||
@ -43,11 +43,10 @@ npm i @nextui-org/react
|
||||
Go to the root of your application and do this:
|
||||
|
||||
```jsx
|
||||
import { CssBaseline, NextUIProvider } from '@nextui-org/react';
|
||||
import { NextUIProvider } from '@nextui-org/react';
|
||||
|
||||
const Application = () => (
|
||||
<NextUIProvider>
|
||||
<CssBaseline /> // ---> Normalize styles
|
||||
<AppComponent /> // ---> Your App Component
|
||||
</NextUIProvider>
|
||||
);
|
||||
|
||||
@ -60,12 +60,12 @@ export const sharedVisuallyHidden = css({
|
||||
position: 'absolute'
|
||||
});
|
||||
|
||||
export const createTheme = ({ type, theme }: Theme) => {
|
||||
export const createTheme = ({ type, theme, className }: Theme) => {
|
||||
if (!type) {
|
||||
throw new Error('Theme type is required');
|
||||
}
|
||||
return createThemeBase(
|
||||
`${type}-theme`,
|
||||
className || `${type}-theme`,
|
||||
deepMerge(type === 'dark' ? darkTheme : lightTheme, theme)
|
||||
);
|
||||
};
|
||||
|
||||
@ -47,6 +47,7 @@ export interface TokenValue {
|
||||
|
||||
export type Theme = {
|
||||
type?: ThemeType | string;
|
||||
className?: string;
|
||||
theme?: BaseTheme;
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user