mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
UI: add css prefix by default
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-ui': patch
|
||||
---
|
||||
|
||||
Add css prefix by default
|
||||
@@ -44,11 +44,7 @@ To enable RTL, set the `dir` prop to `rtl` in body and root provider (required f
|
||||
import { RootProvider } from 'fumadocs-ui/provider';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
}): ReactNode {
|
||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning>
|
||||
<body dir="rtl">
|
||||
@@ -63,6 +59,26 @@ export default function RootLayout({
|
||||
|
||||
Fumadocs UI provides some CSS variables for customising the layout.
|
||||
|
||||
### Prefix
|
||||
|
||||
By default, it has a `fd-` prefix to avoid conflicts with Shadcn UI or your own CSS variables.
|
||||
|
||||
You can set or remove the prefix in `createPreset`:
|
||||
|
||||
```js
|
||||
import { createPreset } from 'fumadocs-ui/tailwind-plugin';
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
presets: [
|
||||
createPreset({
|
||||
// no prefix
|
||||
cssPrefix: '',
|
||||
}),
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
### Navbar Height
|
||||
|
||||
When the default navbar is replaced, the layout may overlap with your new navbar.
|
||||
|
||||
@@ -2,10 +2,6 @@ import type { ReactNode } from 'react';
|
||||
import { HomeLayout } from 'fumadocs-ui/layouts/home';
|
||||
import { baseOptions } from '@/app/layout.config';
|
||||
|
||||
export default function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
}): React.ReactElement {
|
||||
export default function Layout({ children }: { children: ReactNode }) {
|
||||
return <HomeLayout {...baseOptions}>{children}</HomeLayout>;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// @ts-check
|
||||
import { createPreset } from 'fumadocs-ui/tailwind-plugin';
|
||||
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
|
||||
@@ -120,7 +120,7 @@ function createTailwindColors(
|
||||
}
|
||||
|
||||
export const docsUi = plugin.withOptions<DocsUIOptions>(
|
||||
({ cssPrefix = '', preset = 'default', layoutWidth = '100vw' } = {}) => {
|
||||
({ cssPrefix = 'fd', preset = 'default', layoutWidth = '100vw' } = {}) => {
|
||||
return ({ addBase, addComponents, addUtilities }) => {
|
||||
const { light, dark, css } =
|
||||
typeof preset === 'string' ? presets[preset] : preset;
|
||||
|
||||
Reference in New Issue
Block a user