Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
dfcc1d6
feat(ui): Savanna section tabs and REST API sidebar styling
ngarakapati Sep 20, 2026
76dce8d
fix(ui): persist sidebar scroll position across page loads
ngarakapati Sep 20, 2026
fa22ff3
fix(ui): improve on-this-page heading activation while scrolling
ngarakapati Sep 20, 2026
2367d44
build: rebuild ui-bundle.zip for Savanna API navigation changes
ngarakapati Sep 20, 2026
e9ec075
fix(ui): wrap long REST API nav labels without layout shift
ngarakapati Sep 20, 2026
be79e9a
build: rebuild ui-bundle.zip for API nav label wrapping
ngarakapati Sep 20, 2026
328882e
fix(ui): stabilize API nav labels and reveal off-screen current page
ngarakapati Sep 20, 2026
67d952a
build: rebuild ui-bundle.zip for API nav label sizing
ngarakapati Sep 20, 2026
edca5e1
feat(ui): add Savanna API reference endpoint page layout
ngarakapati Sep 21, 2026
c912750
build: rebuild ui-bundle.zip for API reference pages
ngarakapati Sep 21, 2026
bbd38c3
fix(ui): scope Savanna nav and TOC changes to the cloud theme
ngarakapati Sep 21, 2026
a18a820
feat(ui): show Run in Postman on pages with page-postman-url
ngarakapati Sep 21, 2026
c7cdda7
style(ui): align cloud code blocks with API reference cards
ngarakapati Sep 21, 2026
9be8907
build: rebuild ui-bundle.zip for Postman and code block updates
ngarakapati Sep 21, 2026
3672873
style(ui): use brand orange for API response tab indicator
ngarakapati Sep 21, 2026
db8a0a7
build: rebuild ui-bundle.zip for API response tab styling
ngarakapati Sep 21, 2026
41b9eca
style(ui): normalize API language picker icon sizing
ngarakapati Sep 21, 2026
f3bdb2a
build: rebuild ui-bundle.zip for language icon updates
ngarakapati Sep 21, 2026
dd8cda1
chore(ui): trim API code block syntax palette comment
ngarakapati Sep 21, 2026
f163cce
Merge branch 'main' into docs/savanna-rest-api
ngarakapati Sep 24, 2026
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
Binary file modified build/ui-bundle.zip
Binary file not shown.
850 changes: 850 additions & 0 deletions src/css/api-reference.css

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions src/css/page-actions.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,25 @@
display: flex;
align-items: center;
flex: none;
gap: 0.5rem;
/* nudge down so the control optically aligns with the first line of the page title */
margin-top: 0.35rem;
}

/* Postman's hosted button is a fixed-size asset, so match the copy control's
height rather than restyling it. */
.theme-cloud .page-actions-postman {
display: inline-flex;
align-items: center;
text-decoration: none;
}

.theme-cloud .page-actions-postman img {
display: block;
width: auto;
height: 2rem;
}

.theme-cloud .page-actions-control {
display: inline-flex;
align-items: stretch;
Expand Down Expand Up @@ -186,4 +201,8 @@
.theme-cloud .page-actions-copy {
padding: 0.45rem;
}

.theme-cloud .page-actions-postman img {
height: 1.75rem;
}
}
1 change: 1 addition & 0 deletions src/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
@import "highlight.css";
@import "print.css";
@import "theme-cloud.css";
@import "api-reference.css";
252 changes: 246 additions & 6 deletions src/css/theme-cloud.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,62 @@ body.theme-cloud {

.theme-cloud .toolbar {
top: 63px;
background-color: var(--body-background);
/* inset, so the active tab's indicator can cover the rule the way the in-page
tablist indicator covers its ul border; the outset default sits below the
scroll container that clips the indicator */
box-shadow: inset 0 -1px 0 var(--toolbar-border-color);
}

/* ---- Section tabs: share the toolbar row instead of adding a third bar ---- */
.theme-cloud .nav-tabs {
display: flex;
align-items: stretch;
flex: 1 1 auto;
gap: 1.25rem;
height: 100%;
padding: 0 0.75rem;
overflow-x: auto;
scrollbar-width: none;
}

.theme-cloud .nav-tabs::-webkit-scrollbar {
display: none;
}

.theme-cloud .nav-tab {
display: inline-flex;
align-items: center;
color: var(--color-text-muted);
font-size: calc(14 / var(--rem-base) * 1rem);
position: relative;
text-decoration: none;
white-space: nowrap;
}

.theme-cloud .nav-tab::after {
background-color: transparent;
border-radius: 999px;
bottom: 0;
content: "";
display: block;
height: 3px;
left: 0;
position: absolute;
right: 0;
}

.theme-cloud .nav-tab:hover {
color: var(--color-text-strong);
}

.theme-cloud .nav-tab.is-active {
color: var(--color-text-strong);
font-weight: var(--body-font-weight-bold);
}

.theme-cloud .nav-tab.is-active::after {
background-color: var(--color-orange);
}

.theme-cloud .nav-container {
Expand Down Expand Up @@ -221,6 +277,23 @@ body.theme-cloud {
transform: rotate(0);
}

/* endpoint groups title their endpoints instead of collapsing them, so their
list stays open whatever is-active the nav script sets */
.theme-cloud .nav-item.is-api-group > .nav-list {
display: block;
}

/* a quieter label than the page links around it, since it is only a title */
.theme-cloud .nav-item.is-api-group > .nav-row > .nav-text {
padding-top: 0.75rem;
padding-bottom: 0.25rem;
color: var(--color-text-subtle);
font-size: calc(11 / var(--rem-base) * 1rem);
font-weight: 600;
letter-spacing: 0.07em;
text-transform: uppercase;
}

/* depth 1 aligns with the component title; each level indents 0.75rem */
.theme-cloud .nav-item[data-depth="1"] > .nav-row > .nav-link,
.theme-cloud .nav-item[data-depth="1"] > .nav-row > .nav-text { padding-left: 0.75rem; }
Expand Down Expand Up @@ -261,7 +334,8 @@ body.theme-cloud {
background: transparent;
}

.theme-cloud .nav-item:not(.is-current-page) > .nav-row:hover {
/* endpoint group titles are skipped: there is nothing to click on them */
.theme-cloud .nav-item:not(.is-current-page):not(.is-api-group) > .nav-row:hover {
background: var(--navbar-menu_hover-background);
}

Expand All @@ -276,6 +350,56 @@ body.theme-cloud {
font-weight: var(--body-font-weight-bold);
}

/* API reference nav: HTTP verb in front of the endpoint label */
.theme-cloud .nav-method {
display: inline-block;
vertical-align: top;
min-width: 2.5rem;
margin-right: 0.375rem;
color: var(--color-text-subtle);
font-family: var(--monospace-font-family);
font-size: calc(10 / var(--rem-base) * 1rem);
font-weight: 600;
letter-spacing: 0.03em;
/* Match the endpoint label's line box so the smaller verb centres against the
label text instead of riding along the top of the row. */
line-height: calc(14 / var(--rem-base) * 1rem * 1.3);
}

.theme-cloud .nav-method[data-method="GET"] {
color: var(--note-color);
}

.theme-cloud .nav-method[data-method="POST"] {
color: var(--tip-color);
}

.theme-cloud .nav-method[data-method="PUT"],
.theme-cloud .nav-method[data-method="PATCH"] {
color: var(--warning-color);
}

.theme-cloud .nav-method[data-method="DELETE"] {
color: var(--caution-color);
}

/* a name too long for one line reads as one wrapped entry, not two rows */
.theme-cloud .nav-endpoint {
display: inline-block;
vertical-align: top;
/* Selecting an endpoint bolds its label, and bold sets wider, so the label lays
out in the width its bold self needs and breaks the same way in both states.
The expansion is per string, so 01-nav.js measures each label and sets
--bold-ratio; the fallback here is Inter's widest 400 -> 600 expansion. */
max-width: calc((100% - 2.875rem) / var(--bold-ratio, 1.031));
line-height: 1.3;
}

/* bold needs the full width back to break at the same words */
.theme-cloud .is-current-page > .nav-row > .nav-link > .nav-endpoint {
max-width: calc(100% - 2.875rem);
}

.theme-cloud .nav-panel-explore .context {
font-size: calc(14 / var(--rem-base) * 1rem);
}
Expand Down Expand Up @@ -357,7 +481,121 @@ body.theme-cloud {
}

.theme-cloud .doc pre {
font-size: calc(14 / var(--rem-base) * 1rem);
font-size: calc(13 / var(--rem-base) * 1rem);
}

/*
* Code blocks wear the same shell as the API reference endpoint bar: a white
* card on a smoke border with the copy control tucked into the top-right
* corner. The API reference cards style their own pre, so this is scoped to
* Asciidoctor's listing and literal blocks.
*/
.theme-cloud .doc .listingblock pre,
.theme-cloud .doc .literalblock pre {
background: var(--body-background);
border: 1px solid var(--color-smoke-90);
border-radius: 1rem;
box-shadow: none;
/* 0.625rem is the endpoint bar's text inset: 0.375rem on the bar itself plus
0.25rem on the path. Right padding also clears the 2rem copy button. */
padding: 0.625rem 2.75rem 0.625rem 0.625rem;
/* anchors the copy control, which doc.css only positions on highlighted
blocks, and makes every block inset it from the same edge */
position: relative;
}

/* doc.css draws the card on the inner code of a highlighted block; the card is
on the pre here, so the code is plain text again. */
.theme-cloud .doc .listingblock pre.highlight code {
background: transparent;
box-shadow: none;
padding: 0;
}

/* The wrapper the copy script adds around unlabelled blocks is a copy target,
not a styled span of inline code. */
.theme-cloud .doc code.source-text {
background: transparent;
color: inherit;
font-family: inherit;
font-size: inherit;
padding: 0;
}

.theme-cloud .doc .source-toolbox {
align-items: center;
color: var(--color-text-muted);
right: 0.375rem;
top: 0.375rem;
visibility: visible;
}

/* The endpoint bar shows the copy control alone, with no language chip or
pipe separator, and confirms with a checkmark rather than a tooltip. */
.theme-cloud .doc .source-toolbox .source-lang,
.theme-cloud .doc .source-toolbox > :not(:last-child)::after,
.theme-cloud .doc .source-toolbox .copy-icon,
.theme-cloud .doc .source-toolbox .copy-toast {
display: none;
}

.theme-cloud .doc .source-toolbox .copy-button {
border-radius: 0.5rem;
height: 2rem;
justify-content: center;
padding: 0;
position: relative;
width: 2rem;
}

.theme-cloud .doc .source-toolbox .copy-button:hover {
background: var(--color-smoke-70);
color: var(--color-text-strong);
}

/* Both marks are masks tinted by currentcolor, the same pair the endpoint bar
uses. The script only flags .clicked for a single frame, so the copied state
is painted instantly and the delayed transition carries it back. */
.theme-cloud .doc .source-toolbox .copy-button::before,
.theme-cloud .doc .source-toolbox .copy-button::after {
background: currentcolor;
content: "";
height: 1rem;
mask-position: center;
mask-repeat: no-repeat;
mask-size: contain;
width: 1rem;
}

.theme-cloud .doc .source-toolbox .copy-button::before {
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2.5'/%3E%3Cpath d='M15 5.5A2.5 2.5 0 0 0 12.5 3h-7A2.5 2.5 0 0 0 3 5.5v7A2.5 2.5 0 0 0 5.5 15'/%3E%3C/svg%3E");
transition: opacity 0.2s ease 1s;
}

.theme-cloud .doc .source-toolbox .copy-button::after {
left: 50%;
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E");
opacity: 0;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
transition: opacity 0.2s ease 1s;
}

.theme-cloud .doc .source-toolbox .copy-button.clicked::before {
opacity: 0;
transition: none;
}

.theme-cloud .doc .source-toolbox .copy-button.clicked::after {
opacity: 1;
transition: none;
}

/* API reference request line: long paths wrap instead of scrolling out of view */
.theme-cloud .doc .api-request pre {
white-space: pre-wrap;
overflow-wrap: break-word;
}

.theme-cloud .doc .admonitionblock .paragraph {
Expand Down Expand Up @@ -511,9 +749,10 @@ body.theme-cloud {
}

.theme-cloud .doc .tabs .tablist li::after {
border-radius: 999px;
content: "";
display: block;
height: 2px;
height: 3px;
position: absolute;
bottom: -1px;
left: 0;
Expand Down Expand Up @@ -612,9 +851,10 @@ body.theme-cloud {
}

.theme-cloud .doc .tabset .tabs li::after {
border-radius: 999px;
content: "";
display: block;
height: 2px;
height: 3px;
position: absolute;
bottom: -1px;
left: 0;
Expand All @@ -639,7 +879,7 @@ body.theme-cloud {
.theme-cloud .doc .tabset .tabs li.is-active::after {
background-color: var(--color-orange);
bottom: -1px;
height: 2px;
height: 3px;
}

.theme-cloud .doc .tabset > .content {
Expand Down Expand Up @@ -718,7 +958,7 @@ body.theme-cloud {
}

.theme-cloud .doc .admonitionblock pre {
font-size: calc(14 / var(--rem-base) * 1rem);
font-size: calc(13 / var(--rem-base) * 1rem);
}

.theme-cloud .doc .admonitionblock > table,
Expand Down
22 changes: 22 additions & 0 deletions src/helpers/is-api-group.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict'

/**
* True for a nav group whose children are all API endpoints (their labels start
* with an HTTP verb). Those groups are section titles, not collapsible items.
* Only the cloud theme styles them that way, so other components are excluded
* rather than left to depend on their nav labels not reading like endpoints.
*/
const METHOD_LABEL = /^(GET|POST|PUT|PATCH|DELETE)\s/

// inlined rather than required from is-cloud-theme: Antora registers each
// helper file on its own, with no module resolution between them
function isCloudTheme (page) {
const name = page && page.component && page.component.name
return name === 'savanna' || name === 'cloud'
}

module.exports = (item, page) => {
if (!isCloudTheme(page)) return false
if (!item || item.url || !Array.isArray(item.items) || !item.items.length) return false
return item.items.every((child) => METHOD_LABEL.test(String(child.content || '').replace(/<[^>]+>/g, '')))
}
Loading
Loading