Skip to content

Commit 7d3fe23

Browse files
Add circular corners and depth styles (#3280)
Co-authored-by: Samy Pessé <samypesse@gmail.com>
1 parent 521052d commit 7d3fe23

38 files changed

+110
-43
lines changed

.changeset/fair-crews-wink.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook": minor
3+
---
4+
5+
Add circular corners and depth styling

bun.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"name": "@gitbook/cache-tags",
2727
"version": "0.3.1",
2828
"dependencies": {
29-
"@gitbook/api": "^0.115.0",
29+
"@gitbook/api": "^0.118.0",
3030
"assert-never": "^1.2.1",
3131
},
3232
"devDependencies": {
@@ -51,7 +51,7 @@
5151
"name": "gitbook",
5252
"version": "0.12.0",
5353
"dependencies": {
54-
"@gitbook/api": "^0.115.0",
54+
"@gitbook/api": "^0.118.0",
5555
"@gitbook/cache-do": "workspace:*",
5656
"@gitbook/cache-tags": "workspace:*",
5757
"@gitbook/colors": "workspace:*",
@@ -143,7 +143,7 @@
143143
"name": "gitbook-v2",
144144
"version": "0.3.0",
145145
"dependencies": {
146-
"@gitbook/api": "^0.115.0",
146+
"@gitbook/api": "^0.118.0",
147147
"@gitbook/cache-tags": "workspace:*",
148148
"@opennextjs/cloudflare": "1.1.0",
149149
"@sindresorhus/fnv1a": "^3.1.0",
@@ -202,7 +202,7 @@
202202
"name": "@gitbook/react-contentkit",
203203
"version": "0.7.0",
204204
"dependencies": {
205-
"@gitbook/api": "^0.115.0",
205+
"@gitbook/api": "^0.118.0",
206206
"@gitbook/icons": "workspace:*",
207207
"classnames": "^2.5.1",
208208
},
@@ -260,7 +260,7 @@
260260
},
261261
"overrides": {
262262
"@codemirror/state": "6.4.1",
263-
"@gitbook/api": "^0.115.0",
263+
"@gitbook/api": "^0.118.0",
264264
"react": "^19.0.0",
265265
"react-dom": "^19.0.0",
266266
},
@@ -625,7 +625,7 @@
625625

626626
"@fortawesome/fontawesome-svg-core": ["@fortawesome/fontawesome-svg-core@6.6.0", "", { "dependencies": { "@fortawesome/fontawesome-common-types": "6.6.0" } }, "sha512-KHwPkCk6oRT4HADE7smhfsKudt9N/9lm6EJ5BVg0tD1yPA5hht837fB87F8pn15D8JfTqQOjhKTktwmLMiD7Kg=="],
627627

628-
"@gitbook/api": ["@gitbook/api@0.115.0", "", { "dependencies": { "event-iterator": "^2.0.0", "eventsource-parser": "^3.0.0" } }, "sha512-Lyj+1WVNnE/Zuuqa/1ZdnUQfUiNE6es89RFK6CJ+Tb36TFwls6mbHKXCZsBwSYyoMYTVK39WQ3Nob6Nw6+TWCA=="],
628+
"@gitbook/api": ["@gitbook/api@0.118.0", "", { "dependencies": { "event-iterator": "^2.0.0", "eventsource-parser": "^3.0.0" } }, "sha512-5bpvXyGNsMOn1Ee7uzohDz/yOgxpVyLZMLu6THYwbG9UeY6BFsWISeqTw03COCX42rVLU5zFReDxRTb7lfZtCw=="],
629629

630630
"@gitbook/cache-do": ["@gitbook/cache-do@workspace:packages/cache-do"],
631631

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"packageManager": "bun@1.2.11",
1111
"overrides": {
1212
"@codemirror/state": "6.4.1",
13-
"@gitbook/api": "^0.115.0",
13+
"@gitbook/api": "^0.118.0",
1414
"react": "^19.0.0",
1515
"react-dom": "^19.0.0"
1616
},

packages/cache-tags/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"version": "0.3.1",
1212
"dependencies": {
13-
"@gitbook/api": "^0.115.0",
13+
"@gitbook/api": "^0.118.0",
1414
"assert-never": "^1.2.1"
1515
},
1616
"devDependencies": {

packages/gitbook-v2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.3.0",
44
"private": true,
55
"dependencies": {
6-
"@gitbook/api": "^0.115.0",
6+
"@gitbook/api": "^0.118.0",
77
"@gitbook/cache-tags": "workspace:*",
88
"@opennextjs/cloudflare": "1.1.0",
99
"@sindresorhus/fnv1a": "^3.1.0",

packages/gitbook/e2e/internal.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
CustomizationBackground,
33
CustomizationCorners,
4+
CustomizationDepth,
45
CustomizationHeaderPreset,
56
CustomizationIconsStyle,
67
CustomizationSidebarListStyle,
@@ -817,6 +818,16 @@ const testCases: TestsCase[] = [
817818
}),
818819
run: waitForCookiesDialog,
819820
},
821+
{
822+
name: `With flat and circular corners - Theme mode ${themeMode}`,
823+
url: getCustomizationURL({
824+
styling: {
825+
depth: CustomizationDepth.Flat,
826+
corners: CustomizationCorners.Circular,
827+
},
828+
}),
829+
run: waitForCookiesDialog,
830+
},
820831
]),
821832
},
822833
{

packages/gitbook/e2e/util.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
CustomizationBackground,
44
CustomizationCorners,
55
CustomizationDefaultFont,
6+
CustomizationDepth,
67
type CustomizationHeaderItem,
78
CustomizationHeaderPreset,
89
CustomizationIconsStyle,
@@ -278,6 +279,7 @@ export function getCustomizationURL(partial: DeepPartial<SiteCustomizationSettin
278279
dangerColor: { light: '#FB2C36', dark: '#FB2C36' },
279280
successColor: { light: '#00C950', dark: '#00C950' },
280281
corners: CustomizationCorners.Rounded,
282+
depth: CustomizationDepth.Subtle,
281283
font: CustomizationDefaultFont.Inter,
282284
background: CustomizationBackground.Plain,
283285
icons: CustomizationIconsStyle.Regular,

packages/gitbook/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"clean": "rm -rf ./.next && rm -rf ./public/~gitbook/static/icons && rm -rf ./public/~gitbook/static/math"
1717
},
1818
"dependencies": {
19-
"@gitbook/api": "^0.115.0",
19+
"@gitbook/api": "^0.118.0",
2020
"@gitbook/cache-do": "workspace:*",
2121
"@gitbook/cache-tags": "workspace:*",
2222
"@gitbook/colors": "workspace:*",

packages/gitbook/src/components/Announcement/AnnouncementBanner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function AnnouncementBanner(props: {
3434
<Tag
3535
href={contentRef?.href ?? ''}
3636
className={tcls(
37-
'flex w-full items-start justify-center overflow-hidden rounded-md straight-corners:rounded-none px-4 py-3 text-neutral-strong text-sm theme-bold:ring-1 theme-gradient:ring-1 ring-inset transition-colors',
37+
'flex w-full items-start justify-center overflow-hidden circular-corners:rounded-xl rounded-md straight-corners:rounded-none px-4 py-3 text-neutral-strong text-sm theme-bold:ring-1 theme-gradient:ring-1 ring-inset transition-colors',
3838
style.container,
3939
closeable && 'pr-12',
4040
hasLink && style.hover
@@ -81,7 +81,7 @@ export function AnnouncementBanner(props: {
8181
</Tag>
8282
{closeable ? (
8383
<button
84-
className={`absolute top-0 right-4 mt-2 mr-2 rounded straight-corners:rounded-none p-1.5 transition-all hover:ring-1 sm:right-6 md:right-8 ${style.close}`}
84+
className={`absolute top-0 right-4 mt-2 mr-2 rounded circular-corners:rounded-lg straight-corners:rounded-none p-1.5 transition-all hover:ring-1 sm:right-6 md:right-8 ${style.close}`}
8585
type="button"
8686
onClick={dismissAnnouncement}
8787
title={tString(language, 'close')}

packages/gitbook/src/components/Cookies/CookiesToast.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ export function CookiesToast(props: { privacyPolicy?: string }) {
4747
'bg-tint-base',
4848
'rounded',
4949
'straight-corners:rounded-none',
50+
'circular-corners:rounded-2xl',
5051
'ring-1',
5152
'ring-tint-subtle',
5253
'shadow-1xs',
54+
'depth-flat:shadow-none',
5355
'p-4',
5456
'pr-8',
5557
'bottom-4',
@@ -83,6 +85,7 @@ export function CookiesToast(props: { privacyPolicy?: string }) {
8385
'justify-center',
8486
'items-center',
8587
'rounded-sm',
88+
'circular-corners:rounded-full',
8689
'hover:bg-tint-hover'
8790
)}
8891
title={tString(language, 'close')}

0 commit comments

Comments
 (0)