Skip to content

Commit fb90eb0

Browse files
authored
Limit tinted background on bold theme to sites with filled sidebar (#3072)
1 parent b647538 commit fb90eb0

File tree

13 files changed

+21
-11
lines changed

13 files changed

+21
-11
lines changed

.changeset/angry-seahorses-change.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook": patch
3+
---
4+
5+
Limit tinted background on bold theme to sites with filled sidebar

.changeset/good-donkeys-sit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@gitbook/colors": patch
3+
---
4+
5+
Reduce chroma of first color scale step

packages/colors/src/transformations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export function colorScale(
220220
continue;
221221
}
222222

223-
const chromaRatio = index < 8 ? (index + 1) * 0.05 : 1;
223+
const chromaRatio = index < 8 ? index * 0.05 : 1;
224224

225225
const shade = {
226226
L: targetL, // Blend lightness

packages/gitbook/src/components/DocumentView/Hint.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const HINT_STYLES: {
104104
'[&_.can-override-text]:text-neutral-strong',
105105
],
106106
container:
107-
'bg-info border-info theme-muted-tint:bg-info-solid/2 theme-bold-tint:bg-info-solid/2',
107+
'bg-info border-info theme-muted-tint:bg-info-solid/2 [html.sidebar-filled.theme-bold.tint_&]:bg-info-solid/2',
108108
containerWithHeader: 'border-info-solid bg-info-subtle',
109109
},
110110
warning: {

packages/gitbook/src/components/Header/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function Header(props: { context: GitBookSiteContext; withTopHeader?: boo
3838

3939
'bg-tint-base/9',
4040
'theme-muted:bg-tint-subtle/9',
41-
'theme-bold-tint:bg-tint-subtle/9',
41+
'[html.sidebar-filled.theme-bold.tint_&]:bg-tint-subtle/9',
4242
'theme-gradient:bg-gradient-primary',
4343
'theme-gradient-tint:bg-gradient-tint',
4444
'contrast-more:bg-tint-base',

packages/gitbook/src/components/PageAside/PageAside.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export function PageAside(props: {
228228
) : null}
229229
<div
230230
className={tcls(
231-
'sticky bottom-0 z-10 mt-auto flex flex-col bg-tint-base theme-bold-tint:bg-tint-subtle theme-gradient-tint:bg-gradient-tint theme-gradient:bg-gradient-primary theme-muted:bg-tint-subtle pb-4 page-api-block:xl:max-2xl:hidden page-api-block:xl:max-2xl:pb-0 page-api-block:xl:max-2xl:group-hover/aside:flex',
231+
'sticky bottom-0 z-10 mt-auto flex flex-col bg-tint-base theme-gradient-tint:bg-gradient-tint theme-gradient:bg-gradient-primary theme-muted:bg-tint-subtle pb-4 page-api-block:xl:max-2xl:hidden page-api-block:xl:max-2xl:pb-0 page-api-block:xl:max-2xl:group-hover/aside:flex [html.sidebar-filled.theme-bold.tint_&]:bg-tint-subtle',
232232
'page-api-block:xl:max-2xl:bg-transparent'
233233
)}
234234
>

packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function ScrollSectionsList(props: { sections: DocumentSection[] }) {
111111

112112
'hover:bg-primary-hover',
113113
'theme-muted:hover:bg-primary-active',
114-
'theme-bold-tint:hover:bg-primary-active',
114+
'[html.sidebar-filled.theme-bold.tint_&]:hover:bg-primary-active',
115115
'theme-gradient:hover:bg-primary-active',
116116

117117
'tint:font-semibold',

packages/gitbook/src/components/RootLayout/CustomizationRootLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ export async function CustomizationRootLayout(props: {
153153
</head>
154154
<body
155155
className={tcls(
156+
'[html.sidebar-filled.theme-bold.tint_&]:bg-tint-subtle',
156157
'bg-tint-base',
157158
'theme-muted:bg-tint-subtle',
158-
'theme-bold-tint:bg-tint-subtle',
159159

160160
'theme-gradient:bg-gradient-primary',
161161
'theme-gradient-tint:bg-gradient-tint'

packages/gitbook/src/components/SiteSections/SiteSectionList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function SiteSectionList(props: { sections: ClientSiteSections; className
3232
<nav
3333
aria-label="Sections"
3434
className={tcls(
35-
'-mx-5 before:contents[] relative border-tint-subtle border-b from-transparent sidebar-filled:to-tint-subtle theme-bold-tint:to-tint-subtle theme-muted:to-tint-subtle to-tint-base text-sm text-tint before:pointer-events-none before:absolute before:right-2 before:bottom-0 before:left-0 before:h-12 before:bg-gradient-to-b [html.sidebar-filled.theme-bold.tint_&]:to-tint-base [html.sidebar-filled.theme-muted_&]:to-tint-base',
35+
'-mx-5 before:contents[] relative border-tint-subtle border-b from-transparent sidebar-filled:to-tint-subtle theme-muted:to-tint-subtle to-tint-base text-sm text-tint before:pointer-events-none before:absolute before:right-2 before:bottom-0 before:left-0 before:h-12 before:bg-gradient-to-b [html.sidebar-filled.theme-bold.tint_&]:to-tint-base [html.sidebar-filled.theme-bold.tint_&]:to-tint-subtle [html.sidebar-filled.theme-muted_&]:to-tint-base',
3636
className
3737
)}
3838
>

packages/gitbook/src/components/TableOfContents/PageGroupItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function PageGroupItem(props: {
4040
'bg-tint-base',
4141
'sidebar-filled:bg-tint-subtle',
4242
'theme-muted:bg-tint-subtle',
43-
'theme-bold-tint:bg-tint-subtle',
43+
'[html.sidebar-filled.theme-bold.tint_&]:bg-tint-subtle',
4444
'[html.sidebar-filled.theme-muted_&]:bg-tint-base',
4545
'[html.sidebar-filled.theme-bold.tint_&]:bg-tint-base',
4646
'[html.sidebar-default.theme-gradient_&]:bg-gradient-primary',

packages/gitbook/src/components/TableOfContents/TableOfContents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function TableOfContents(props: {
7575

7676
'sidebar-filled:bg-tint-subtle',
7777
'theme-muted:bg-tint-subtle',
78-
'theme-bold-tint:bg-tint-subtle',
78+
'[html.sidebar-filled.theme-bold.tint_&]:bg-tint-subtle',
7979
'[html.sidebar-filled.theme-muted_&]:bg-tint-base',
8080
'[html.sidebar-filled.theme-bold.tint_&]:bg-tint-base',
8181
'page-no-toc:!bg-transparent',

packages/gitbook/src/components/TableOfContents/Trademark.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function Trademark(props: {
5252
'before:to-tint-base',
5353
'sidebar-filled:before:to-tint-subtle',
5454
'theme-muted:before:to-tint-subtle',
55-
'theme-bold-tint:before:to-tint-subtle',
55+
'[html.sidebar-filled.theme-bold.tint_&]:before:to-tint-subtle',
5656
'[html.sidebar-filled.theme-muted_&]:before:to-tint-base',
5757
'[html.sidebar-filled.theme-bold.tint_&]:before:to-tint-base',
5858
'page-no-toc:before:!to-transparent'

packages/gitbook/src/components/ThemeToggler/ThemeToggler.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function ThemeButton(props: {
7979
active && [
8080
'bg-primary',
8181
'theme-muted:bg-primary-hover',
82-
'theme-bold-tint:bg-primary-hover',
82+
'[html.sidebar-filled.theme-bold.tint_&]:bg-primary-hover',
8383
'hover:bg-primary',
8484
'text-primary-strong',
8585
'contrast-more:text-primary-strong',

0 commit comments

Comments
 (0)