Skip to content

Commit

Permalink
Merge pull request #1203 from fuma-nama/dev
Browse files Browse the repository at this point in the history
Sync
  • Loading branch information
fuma-nama authored Dec 29, 2024
2 parents e2cd2e1 + 3e6e6bd commit 5f49adb
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 19 deletions.
26 changes: 21 additions & 5 deletions apps/docs/content/docs/ui/theme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# next-docs-zeta

## 14.6.8

## 14.6.7

### Patch Changes

- 5474343: Export dynamic-link

## 14.6.6

## 14.6.5
Expand Down
6 changes: 5 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fumadocs-core",
"version": "14.6.6",
"version": "14.6.8",
"description": "The library for building a documentation website in Next.js",
"keywords": [
"NextJs",
Expand Down Expand Up @@ -60,6 +60,10 @@
"import": "./dist/link.js",
"types": "./dist/link.d.ts"
},
"./dynamic-link": {
"import": "./dist/dynamic-link.js",
"types": "./dist/dynamic-link.d.ts"
},
"./mdx-plugins": {
"import": "./dist/mdx-plugins/index.js",
"types": "./dist/mdx-plugins/index.d.ts"
Expand Down
4 changes: 4 additions & 0 deletions packages/create-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# create-next-docs-app

## 14.6.8

## 14.6.7

## 14.6.6

## 14.6.5
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-fumadocs-app",
"version": "14.6.6",
"version": "14.6.8",
"description": "Create a new documentation site with Fumadocs",
"keywords": [
"NextJs",
Expand Down
6 changes: 1 addition & 5 deletions packages/create-app/template/+shared/app/(home)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-check
import { createPreset } from 'fumadocs-ui/tailwind-plugin';

/** @type {import('tailwindcss').Config} */
Expand Down
17 changes: 17 additions & 0 deletions packages/openapi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# @fuma-docs/openapi

## 5.10.6

### Patch Changes

- Updated dependencies [e95be52]
- Updated dependencies [f3298ea]
- [email protected]
- [email protected]

## 5.10.5

### Patch Changes

- Updated dependencies [5474343]
- [email protected]
- [email protected]

## 5.10.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fumadocs-openapi",
"version": "5.10.4",
"version": "5.10.6",
"description": "Generate MDX docs for your OpenAPI spec",
"keywords": [
"NextJs",
Expand Down
15 changes: 15 additions & 0 deletions packages/ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# next-docs-ui

## 14.6.8

### Patch Changes

- e95be52: Fix i18n toggle
- f3298ea: Add css prefix by default
- [email protected]

## 14.6.7

### Patch Changes

- Updated dependencies [5474343]
- [email protected]

## 14.6.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fumadocs-ui",
"version": "14.6.6",
"version": "14.6.8",
"description": "The framework for building a documentation website in Next.js",
"keywords": [
"NextJs",
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/i18n.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ export function I18nProvider({
const router = useRouter();
const pathname = usePathname();

const onChangeCallback = (locale: string) => {
const onChangeCallback = (value: string) => {
const segments = pathname.split('/').filter((v) => v.length > 0);

// If locale prefix hidden
if (segments[0] !== locale) {
segments.unshift(locale);
segments.unshift(value);
} else {
segments[0] = locale;
segments[0] = value;
}

router.push(`/${segments.join('/')}`);
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/tailwind-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -240,7 +240,7 @@ export const docsUi = plugin.withOptions<DocsUIOptions>(
};
},
({
cssPrefix = '',
cssPrefix = 'fd',
modifyContainer = true,
addGlobalColors = false,
} = {}) => ({
Expand Down

0 comments on commit 5f49adb

Please sign in to comment.