Skip to content

Commit 2b2c604

Browse files
committed
update CodeBlock highlighting v1
1 parent 445baaa commit 2b2c604

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

packages/gitbook/src/components/DocumentView/CodeBlock/CodeBlockRenderer.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const CodeBlockRenderer = forwardRef(function CodeBlockRenderer(
3434
<div ref={ref} className={tcls('group/codeblock grid grid-flow-col', style)}>
3535
<div className="flex items-center justify-start [grid-area:1/1] text-sm gap-2">
3636
{title ? (
37-
<div className="text-xs tracking-wide text-tint leading-none inline-flex items-center justify-center bg-tint rounded-t straight-corners:rounded-t-s px-3 py-2">
37+
<div className="text-xs tracking-wide text-tint leading-none inline-flex items-center justify-center bg-tint-2 rounded-t straight-corners:rounded-t-s px-3 py-2">
3838
{title}
3939
</div>
4040
) : null}
@@ -45,7 +45,7 @@ export const CodeBlockRenderer = forwardRef(function CodeBlockRenderer(
4545
/>
4646
<pre
4747
className={tcls(
48-
'[grid-area:2/1] relative overflow-auto bg-tint theme-gradient:bg-tint-12/1 ring-tint-subtle hide-scroll',
48+
'[grid-area:2/1] relative overflow-auto bg-tint-2 theme-gradient:bg-tint-12/1 ring-tint-subtle hide-scroll',
4949
'rounded-md straight-corners:rounded-sm',
5050
title && 'rounded-ss-none',
5151
)}

packages/gitbook/src/components/DocumentView/CodeBlock/theme.css

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
:root {
22
--shiki-color-text: theme('colors.tint.11');
3-
--shiki-token-constant: #0a6355;
4-
--shiki-token-string: #8b6d32;
3+
--shiki-token-constant: #22863a;
4+
--shiki-token-string: theme('colors.primary.12');
55
--shiki-token-comment: theme('colors.teal.700/.64');
6-
--shiki-token-keyword: theme('colors.pomegranate.600');
6+
--shiki-token-keyword: theme('colors.contrast-primary.1');
77
--shiki-token-parameter: #0a3069;
88
--shiki-token-function: #8250df;
9-
--shiki-token-string-expression: #6a4906;
10-
--shiki-token-punctuation: theme('colors.pomegranate.700/.92');
9+
--shiki-token-string-expression: theme('colors.primary.9');
10+
--shiki-token-punctuation: theme('colors.contrast-primary.1');
1111
--shiki-token-link: theme('colors.tint.12');
1212
--shiki-token-inserted: #22863a;
1313
--shiki-token-deleted: #b31d28;

packages/gitbook/src/components/DocumentView/OpenAPI/style.css

+5-5
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@
381381

382382
/* Code Sample */
383383
.openapi-codesample {
384-
@apply border rounded bg-tint border-tint-subtle;
384+
@apply border rounded bg-tint-2 border-tint-subtle;
385385
}
386386

387387
.openapi-codesample-header {
@@ -424,7 +424,7 @@
424424
} */
425425

426426
.openapi-path-title em {
427-
@apply not-italic text-primary font-medium;
427+
@apply not-italic text-primary-subtle font-medium;
428428
}
429429

430430
.openapi-path-separator {
@@ -437,7 +437,7 @@
437437

438438
/* Response Example */
439439
.openapi-response-example {
440-
@apply border rounded bg-tint border-tint-subtle;
440+
@apply border rounded bg-tint-2 border-tint-subtle;
441441
}
442442

443443
.openapi-response-example-empty {
@@ -506,11 +506,11 @@
506506
}
507507

508508
.openapi-tabs-tab {
509-
@apply hover:bg-primary-hover whitespace-nowrap font-mono font-normal tabular-nums hover:text-primary cursor-pointer transition-all relative text-[0.813rem] text-tint px-1 border border-transparent rounded;
509+
@apply hover:bg-primary-hover whitespace-nowrap font-mono font-normal tabular-nums hover:text-primary-subtle cursor-pointer transition-all relative text-[0.813rem] text-tint px-1 border border-transparent rounded;
510510
}
511511

512512
.openapi-tabs-tab[aria-selected='true'] {
513-
@apply text-primary after:absolute after:-bottom-2 after:left-0 after:w-full after:h-px after:bg-primary-solid after:transition-all;
513+
@apply text-primary-subtle after:absolute after:-bottom-2 after:left-0 after:w-full after:h-px after:bg-primary-solid after:transition-all;
514514
}
515515

516516
.openapi-tabs-panel {

0 commit comments

Comments
 (0)