diff --git a/.changeset/early-spiders-guess.md b/.changeset/early-spiders-guess.md new file mode 100644 index 000000000..62485f114 --- /dev/null +++ b/.changeset/early-spiders-guess.md @@ -0,0 +1,5 @@ +--- +'gitbook': patch +--- + +Start using tint in more places, TOC and PageAside diff --git a/.changeset/fresh-lemons-pull.md b/.changeset/fresh-lemons-pull.md new file mode 100644 index 000000000..509add0d1 --- /dev/null +++ b/.changeset/fresh-lemons-pull.md @@ -0,0 +1,5 @@ +--- +'gitbook': patch +--- + +Downgrade to Next.js v14 to fix incompatibilities with next-on-pages causing multiple bugs. diff --git a/.prettierignore b/.prettierignore index a6fb41b14..1378cb1c3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -8,3 +8,6 @@ packages/icons/src/data/*.json # Build files dist/ + +README.md +CHANGELOG.md \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index 2459ff0a6..085e94e22 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 4cebd725f..f07cd7114 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,9 @@ }, "packageManager": "bun@1.1.18", "overrides": { - "@codemirror/state": "6.4.1" + "@codemirror/state": "6.4.1", + "react": "18.3.1", + "react-dom": "18.3.1" }, "private": true, "scripts": { diff --git a/packages/gitbook/package.json b/packages/gitbook/package.json index f06b980d7..e12574599 100644 --- a/packages/gitbook/package.json +++ b/packages/gitbook/package.json @@ -41,7 +41,7 @@ "katex": "^0.16.9", "mathjax": "^3.2.2", "memoizee": "^0.4.15", - "next": "15.1.3", + "next": "14.2.15", "next-themes": "^0.2.1", "nuqs": "^2.2.3", "object-hash": "^3.0.0", @@ -49,8 +49,8 @@ "p-map": "^7.0.0", "parse-cache-control": "^1.0.1", "postcss-color-contrast": "^1.1.0", - "react": "19.0.0", - "react-dom": "19.0.0", + "react": "18.3.1", + "react-dom": "18.3.1", "react-hotkeys-hook": "^4.4.1", "rehype-sanitize": "^6.0.0", "rehype-stringify": "^10.0.0", diff --git a/packages/gitbook/src/components/PageAside/AsideSectionHighlight.tsx b/packages/gitbook/src/components/PageAside/AsideSectionHighlight.tsx index 36c4bd38d..58a796453 100644 --- a/packages/gitbook/src/components/PageAside/AsideSectionHighlight.tsx +++ b/packages/gitbook/src/components/PageAside/AsideSectionHighlight.tsx @@ -19,10 +19,10 @@ export function AsideSectionHighlight({ layout layoutId="sections-line" className={tcls([ - 'border-primary', + 'border-tint', 'sidebar-list-line:border-l-2', - 'dark:border-primary-400', + 'dark:border-tint-400', 'inset-0', 'pointer-events-none', 'absolute', @@ -33,12 +33,12 @@ export function AsideSectionHighlight({ 'straight-corners:rounded-none', 'sidebar-list-line:rounded-l-none', - 'sidebar-list-pill:bg-primary/3', - 'dark:sidebar-list-pill:bg-primary-400/3', + 'sidebar-list-pill:bg-tint/3', + 'dark:sidebar-list-pill:bg-tint-400/3', 'contrast-more:border', - 'contrast-more:bg-primary/3', - 'dark:contrast-more:bg-primary-400/3', + 'contrast-more:bg-tint/3', + 'dark:contrast-more:bg-tint-400/3', className, ])} transition={prefersReducedMotion ? { duration: 0 } : transition} diff --git a/packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx b/packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx index 0051b1dc6..6fd64fd7d 100644 --- a/packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx +++ b/packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx @@ -106,15 +106,15 @@ export function ScrollSectionsList(props: { sections: DocumentSection[] }) { ], activeId === section.id && [ - 'text-primary', - 'hover:text-primary', - 'dark:text-primary-400', - 'dark:hover:text-primary-400', + 'text-tint', + 'hover:text-tint', + 'dark:text-tint-400', + 'dark:hover:text-tint-400', 'contrast-more:font-semibold', - 'hover:bg-primary/3', - 'dark:hover:bg-primary-400/3', + 'hover:bg-tint/3', + 'dark:hover:bg-tint-400/3', 'sidebar-list-pill:hover:bg-transparent', 'dark:sidebar-list-pill:hover:bg-transparent', ], diff --git a/packages/gitbook/src/components/PageFeedback/PageFeedbackForm.tsx b/packages/gitbook/src/components/PageFeedback/PageFeedbackForm.tsx index 5571d4e27..84e0a1661 100644 --- a/packages/gitbook/src/components/PageFeedback/PageFeedbackForm.tsx +++ b/packages/gitbook/src/components/PageFeedback/PageFeedbackForm.tsx @@ -116,11 +116,11 @@ function RatingButton(props: { rating: number; label: string; onClick: () => voi 'w-8', 'rounded-sm', 'text-dark/7', - 'hover:bg-primary/4', - 'hover:text-primary-600', + 'hover:bg-tint/4', + 'hover:text-tint-600', 'dark:text-light/7', - 'dark:hover:text-primary-300', - 'dark:hover:bg-primary-300/2', + 'dark:hover:text-tint-300', + 'dark:hover:bg-tint-300/2', )} aria-label={label} title={label} diff --git a/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx b/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx index b102522a6..03e341c71 100644 --- a/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx +++ b/packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx @@ -87,7 +87,7 @@ export async function CustomizationRootLayout(props: { ) } - ${generateColorVariable('tint-color', tintColor?.light ?? DEFAULT_TINT_COLOR)} + ${generateColorVariable('tint-color', tintColor?.light ?? customization.styling.primaryColor.light ?? DEFAULT_TINT_COLOR)} ${ // Generate the right contrast color for each shade of tint-color generateColorVariable( @@ -130,7 +130,7 @@ export async function CustomizationRootLayout(props: { ) } - ${generateColorVariable('tint-color', tintColor?.dark ?? DEFAULT_TINT_COLOR)} + ${generateColorVariable('tint-color', tintColor?.dark ?? customization.styling.primaryColor.dark ?? DEFAULT_TINT_COLOR)} ${ // Generate the right contrast color for each shade of tint-color generateColorVariable( diff --git a/packages/gitbook/src/components/TableOfContents/TOCPageIcon.tsx b/packages/gitbook/src/components/TableOfContents/TOCPageIcon.tsx index 08e0431c4..b9c1b2421 100644 --- a/packages/gitbook/src/components/TableOfContents/TOCPageIcon.tsx +++ b/packages/gitbook/src/components/TableOfContents/TOCPageIcon.tsx @@ -15,8 +15,8 @@ export function TOCPageIcon({ page }: { page: RevisionPage }) { 'text-base', 'text-dark/6', 'dark:text-light/6', - 'group-aria-current-page/toclink:text-primary', - 'group-aria-current-page/toclink:dark:text-primary-400', + 'group-aria-current-page/toclink:text-tint', + 'group-aria-current-page/toclink:dark:text-tint-400', 'shrink-0', )} /> diff --git a/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx b/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx index 51b715c33..b40a43807 100644 --- a/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx +++ b/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx @@ -149,36 +149,36 @@ export function ToggleableLinkItem( 'font-semibold', 'sidebar-list-line:before:w-0.5', - 'before:bg-primary', - 'text-primary', - 'sidebar-list-pill:bg-primary/3', - 'sidebar-list-pill:text-primary', + 'before:bg-tint', + 'text-tint', + 'sidebar-list-pill:bg-tint/3', + 'sidebar-list-pill:text-tint', - 'hover:bg-primary/3', - 'hover:text-primary', - 'hover:before:bg-primary', - 'sidebar-list-pill:hover:bg-primary/4', + 'hover:bg-tint/3', + 'hover:text-tint', + 'hover:before:bg-tint', + 'sidebar-list-pill:hover:bg-tint/4', - 'contrast-more:text-primary', - 'contrast-more:hover:text-primary', - 'dark:contrast-more:text-primary-400', - 'dark:contrast-more:hover:text-primary-400', - 'contrast-more:bg-primary/3', - 'dark:contrast-more:bg-primary-400/3', + 'contrast-more:text-tint', + 'contrast-more:hover:text-tint', + 'dark:contrast-more:text-tint-400', + 'dark:contrast-more:hover:text-tint-400', + 'contrast-more:bg-tint/3', + 'dark:contrast-more:bg-tint-400/3', 'contrast-more:ring-1', - 'contrast-more:ring-primary', - 'contrast-more:hover:ring-primary', - 'dark:contrast-more:ring-primary-400', - 'dark:contrast-more:hover:ring-primary-400', + 'contrast-more:ring-tint', + 'contrast-more:hover:ring-tint', + 'dark:contrast-more:ring-tint-400', + 'dark:contrast-more:hover:ring-tint-400', - 'dark:before:bg-primary-400', - 'dark:text-primary-400', - 'dark:sidebar-list-pill:bg-primary-400/3', - 'dark:sidebar-list-pill:text-primary-400', + 'dark:before:bg-tint-400', + 'dark:text-tint-400', + 'dark:sidebar-list-pill:bg-tint-400/3', + 'dark:sidebar-list-pill:text-tint-400', - 'dark:hover:bg-primary-400/3', - 'dark:hover:text-primary-400', - 'dark:hover:before:bg-primary-400', + 'dark:hover:bg-tint-400/3', + 'dark:hover:text-tint-400', + 'dark:hover:before:bg-tint-400', ], )} > @@ -203,7 +203,7 @@ export function ToggleableLinkItem( 'hover:text-current', 'dark:hover:bg-light/2', 'dark:hover:text-current', - isActive ? ['hover:bg-primary/4', 'dark:hover:bg-primary/4'] : [], + isActive ? ['hover:bg-tint/4', 'dark:hover:bg-tint/4'] : [], )} onClick={(event) => { event.preventDefault(); diff --git a/packages/gitbook/tailwind.config.ts b/packages/gitbook/tailwind.config.ts index 4eadf7d70..f5b97f417 100644 --- a/packages/gitbook/tailwind.config.ts +++ b/packages/gitbook/tailwind.config.ts @@ -78,8 +78,8 @@ const config: Config = { /** primary-color used to accent elements, these colors remain unchanged when toggling between the CustomizationBackground options**/ primary: generateVarShades('primary-color'), 'contrast-primary': generateVarShades('contrast-primary'), - tint: generateVarShades('primary-color'), - 'contrast-tint': generateVarShades('contrast-primary'), + tint: generateVarShades('tint-color'), + 'contrast-tint': generateVarShades('contrast-tint'), 'header-background': generateVarShades('header-background'), 'header-link': generateVarShades('header-link'),