Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
77a997a
First pass
zenoachtig Apr 17, 2025
466643d
Second pass
zenoachtig Apr 18, 2025
12d4949
Format
zenoachtig Apr 18, 2025
14457d1
Add headers
zenoachtig Apr 18, 2025
6056c5f
Merge branch 'main' into restyle-openapi-blocks
zenoachtig Apr 18, 2025
b2ccb16
Remap "child attributes" to "properties"
zenoachtig Apr 18, 2025
c12f5f8
Fix failed merge
zenoachtig Apr 18, 2025
6fdedf3
Fix type error
zenoachtig Apr 18, 2025
e8cb2cb
Add requestbody to improved styling
zenoachtig Apr 18, 2025
069437c
Simpler CSS selector
zenoachtig Apr 18, 2025
757a384
Change back to hover-only buttons
zenoachtig Apr 19, 2025
d93f6d8
Code color palette & style changes
zenoachtig Apr 22, 2025
28f0d96
Merge branch 'main' into restyle-openapi-blocks
zenoachtig Apr 22, 2025
473db6e
Tweak color palette to use `success` instead of `info`
zenoachtig Apr 23, 2025
398f49b
Format
zenoachtig Apr 23, 2025
7467041
Changeset
zenoachtig Apr 23, 2025
c3ffde7
Add alternative separators
zenoachtig Apr 23, 2025
652dc7e
Add response title
zenoachtig Apr 23, 2025
f0e7aa1
Better truncation behaviour of responses
zenoachtig Apr 23, 2025
6fb4829
Merge branch 'main' into restyle-openapi-blocks
zenoachtig Apr 23, 2025
dbb0776
Add better show/hide translations
zenoachtig Apr 23, 2025
bd0ff4f
Translate "possible values"
zenoachtig Apr 24, 2025
8ca0995
Review
zenoachtig Apr 24, 2025
b967bc6
Merge branch 'main' into restyle-openapi-blocks
zenoachtig Apr 24, 2025
84ed8ec
Add accessible styles
zenoachtig Apr 24, 2025
12a7e23
Add back transparent rule to `.openapi-markdown pre code`
zenoachtig Apr 24, 2025
e701564
Remove corners and shadows on code blocks in openapi panels
zenoachtig Apr 24, 2025
7a6bb68
Merge branch 'main' into restyle-openapi-blocks
zenoachtig Apr 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/lemon-actors-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@gitbook/react-openapi": minor
"gitbook": minor
---

Design tweaks to code blocks and OpenAPI pages
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}

.highlight-line-number {
@apply text-sm text-right pr-3.5 rounded-l pl-2 sticky left-[-3px] bg-gradient-to-r from-80% from-tint to-transparent;
@apply text-sm text-right pr-3.5 rounded-l pl-2 sticky left-[-3px] bg-gradient-to-r from-80% from-tint-subtle theme-muted:from-tint-base [html.theme-bold.sidebar-filled_&]:from-tint-base to-transparent;
@apply before:text-tint before:content-[counter(line)];

.highlight-line.highlighted > & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const CodeBlockRenderer = forwardRef(function CodeBlockRenderer(
>
<div className="flex items-center justify-start gap-2 text-sm [grid-area:1/1]">
{title ? (
<div className="inline-flex items-center justify-center rounded-t straight-corners:rounded-t-s bg-tint px-3 py-2 text-tint text-xs leading-none tracking-wide">
<div className="relative top-px z-20 inline-flex items-center justify-center rounded-t straight-corners:rounded-t-s border border-tint-subtle border-b-transparent bg-tint-subtle theme-muted:bg-tint-base px-3 py-2 text-tint text-xs leading-none tracking-wide [html.theme-bold.sidebar-filled_&]:bg-tint-base">
{title}
</div>
) : null}
Expand All @@ -50,8 +50,8 @@ export const CodeBlockRenderer = forwardRef(function CodeBlockRenderer(
/>
<pre
className={tcls(
'hide-scroll relative overflow-auto bg-tint theme-gradient:bg-tint-12/1 ring-tint-subtle [grid-area:2/1]',
'rounded-md straight-corners:rounded-sm',
'hide-scroll relative overflow-auto border border-tint-subtle bg-tint-subtle theme-muted:bg-tint-base [grid-area:2/1] [html.theme-bold.sidebar-filled_&]:bg-tint-base',
'rounded-md straight-corners:rounded-sm shadow-sm',
title && 'rounded-ss-none'
)}
>
Expand Down
66 changes: 41 additions & 25 deletions packages/gitbook/src/components/DocumentView/CodeBlock/theme.css
Original file line number Diff line number Diff line change
@@ -1,31 +1,47 @@
:root {
--shiki-color-text: theme("colors.tint.11");
--shiki-token-constant: #0a6355;
--shiki-token-string: #8b6d32;
--shiki-token-comment: theme("colors.teal.700/.64");
--shiki-token-keyword: theme("colors.pomegranate.600");
--shiki-token-parameter: #0a3069;
--shiki-token-function: #8250df;
--shiki-token-string-expression: #6a4906;
--shiki-token-punctuation: theme("colors.pomegranate.700/.92");
--shiki-token-link: theme("colors.tint.12");
--shiki-token-inserted: #22863a;
--shiki-token-deleted: #b31d28;
--shiki-token-changed: #8250df;
--shiki-token-punctuation: theme("colors.tint.11");
--shiki-token-comment: theme("colors.neutral.9/.7");
--shiki-token-link: theme("colors.primary.10");

--shiki-token-constant: theme("colors.warning.10");
--shiki-token-string: theme("colors.success.10");
--shiki-token-string-expression: theme("colors.success.10");
--shiki-token-keyword: theme("colors.danger.10");
--shiki-token-parameter: theme("colors.warning.10");
--shiki-token-function: theme("colors.primary.10");

--shiki-token-inserted: theme("colors.success.10");
--shiki-token-deleted: theme("colors.danger.10");
--shiki-token-changed: theme("colors.tint.12");
}

html.dark {
--shiki-color-text: theme("colors.tint.11");
--shiki-token-constant: #d19a66;
--shiki-token-string: theme("colors.pomegranate.300");
--shiki-token-comment: theme("colors.teal.300/.64");
--shiki-token-keyword: theme("colors.pomegranate.400");
--shiki-token-parameter: theme("colors.yellow.500");
--shiki-token-function: #56b6c2;
--shiki-token-string-expression: theme("colors.tint.11");
--shiki-token-punctuation: #acc6ee;
--shiki-token-link: theme("colors.pomegranate.400");
--shiki-token-inserted: #85e89d;
--shiki-token-deleted: #fdaeb7;
--shiki-token-changed: #56b6c2;
/* Override select colors to have more contrast */
--shiki-token-comment: theme("colors.neutral.9");

--shiki-token-constant: theme("colors.warning.11");
--shiki-token-string: theme("colors.success.11");
--shiki-token-string-expression: theme("colors.success.11");
--shiki-token-keyword: theme("colors.danger.11");
--shiki-token-parameter: theme("colors.warning.11");
--shiki-token-function: theme("colors.primary.11");
}

.code-monochrome {
--shiki-token-constant: theme("colors.tint.11");
--shiki-token-string: theme("colors.tint.12");
--shiki-token-string-expression: theme("colors.tint.12");
--shiki-token-keyword: theme("colors.primary.10");
--shiki-token-parameter: theme("colors.tint.9");
--shiki-token-function: theme("colors.primary.9");
}

html.dark.code-monochrome {
--shiki-token-constant: theme("colors.tint.11");
--shiki-token-string: theme("colors.tint.12");
--shiki-token-string-expression: theme("colors.tint.12");
--shiki-token-keyword: theme("colors.primary.11");
--shiki-token-parameter: theme("colors.tint.10");
--shiki-token-function: theme("colors.primary.10");
}
Loading
Loading