mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-16 15:45:13 +00:00
Merge branch 'main' into claire/fix-infinite-search-results-rerendering-in-va-sites
* main: Start using tint in more places: TOC and PageAside (#2733) Downgrade to Next.js v14 (#2732)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'gitbook': patch
|
||||
---
|
||||
|
||||
Start using tint in more places, TOC and PageAside
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'gitbook': patch
|
||||
---
|
||||
|
||||
Downgrade to Next.js v14 to fix incompatibilities with next-on-pages causing multiple bugs.
|
||||
@@ -8,3 +8,6 @@ packages/icons/src/data/*.json
|
||||
|
||||
# Build files
|
||||
dist/
|
||||
|
||||
README.md
|
||||
CHANGELOG.md
|
||||
+3
-1
@@ -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": {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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',
|
||||
],
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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',
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user