Commit f6cc334
feat(demo): modernized styles with swappable palettes and runtime theme switcher (#1371)
* feat(demo): modernize styles inspired by glean developer site
- Replace default Docusaurus green with Glean blue (#343ced) primary palette
- Add Inter font for body text, JetBrains Mono for code
- Full dark mode with navy base (#111827) and gray emphasis scale
- Modernize HTTP method badges: pill-style with translucent inactive /
solid active states, dark mode variants for all methods
- Port sidebar behavior: transparent hover, uppercase top-level
categories, active item uses primary color (no background fill)
- Add schema parameter highlight-flash animation on anchor target
- Add custom scrollbar styling for code tab panels
- Add border-radius and shadow scale variables
- Add grid utility classes
- Port admonition border removal + border-radius
- Enable prismThemes.github/dracula for code blocks
- Add colorMode.respectPrefersColorScheme: true
- Remove navbar title text (logo-only nav)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(demo): align API page badge colors with sidebar method labels
MethodEndpoint uses .badge--primary/success/danger/info/warning which
map to different Infima colors than the sidebar ::before pseudo-elements.
Override all badge classes to use the same color scheme:
GET → badge--primary → green (#16a34a / #22c55e dark)
POST → badge--success → navy (#004c9d / #5eb7ff dark)
DELETE → badge--danger → red (#dc2626 / #ef4444 dark)
PUT → badge--info → amber (#d97706 / #f59e0b dark)
PATCH → badge--warning → amber (#d97706 / #f59e0b dark)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(demo): restore contrast on send button in dark mode
--ifm-color-primary-light resolves to #acd9ff in dark mode, making
white text nearly invisible. Pin the request button to PANW navy
(#004c9d) in dark mode to ensure readable contrast.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor(demo): split CSS into structure + swappable theme files
custom.css is now purely structural (layout, animations, utilities).
All colors, fonts, and palette-specific values live in a theme file.
To try a different palette, swap one line in docusaurus.config.ts:
customCss: ["./src/css/custom.css", "./src/css/themes/<theme>.css"]
themes/panw.css — Palo Alto Networks brand (pan.dev):
- Plus Jakarta Sans + Fira Code fonts
- PANW navy primary (#004c9d), orange accent (#fa582d)
- Near-black dark mode (#0b1117) with steel-blue gray scale
- Method badge colors, .badge--* overrides, send button fix
custom.css changes:
- Uses --theme-primary-rgb for the highlight-flash animation
- Uses --theme-border-radius-sm/md with fallback defaults
- Badge content labels separated from colors (colors in theme)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(theme): add violet palette and activate it
Adds demo/src/css/themes/violet.css (Space Grotesk + JetBrains Mono,
Violet-600 primary, deep purple-tinted dark mode) and switches
docusaurus.config.ts to load it instead of panw.css.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(theme): add cyber palette and activate it
Adds demo/src/css/themes/cyber.css — neon green (#00ff88) on near-black
(#030a06), monospace (JetBrains Mono) everywhere including body and
headings, electric cyan POST badges, hot pink DELETE badges in dark mode,
and sharp 2-4px border radii throughout.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(theme): add midnight palette and activate it
Adds demo/src/css/themes/midnight.css — slate-900 (#0f172a) base with
sky-blue (#38bdf8) accents, Inter body font, JetBrains Mono code. Active
badges use dark text on bright fills for contrast on the slate background.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(theme): add indigo palette and activate it
Adds demo/src/css/themes/indigo.css — the modern dev site aesthetic.
Zinc-950 (#09090b) dark base, indigo-500 (#6366f1) accent, Geist +
Geist Mono font stack. Neutral shadows (no color tint), subtle badge
opacity, matches the shadcn/ui + Linear + Clerk visual language.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(theme): add nord palette and activate it
Adds demo/src/css/themes/nord.css — faithful to the Nord color palette
(Arctic Ice Studio). Polar Night (#2e3440) dark base, Frost blue-cyan
(#88c0d0) primary, Aurora semantic colors for method badges throughout.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(theme): add evergreen palette and activate it
Adds demo/src/css/themes/evergreen.css — a modern riff on the classic
Docusaurus green (#2e8555). Keeps the signature primary, upgrades to
Plus Jakarta Sans + Fira Code, deepens the dark mode to #18191a, and
applies neutral shadows throughout.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(theme/evergreen): increase explorer code font size to 14px
Overrides --openapi-explorer-font-size-code from the 12px default
to 14px for better readability in the request body example panel.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(theme/evergreen): tie explorer code font size to --ifm-code-font-size
Uses var(--ifm-code-font-size) instead of a hardcoded pixel value so the
request body panel always matches the code snippet blocks.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(theme/evergreen): unify explorer body and code tab font sizes
Sets --openapi-explorer-font-size-code to 13px and explicitly applies
it to .openapi-explorer__playground-editor plus its inner textarea and
pre elements, which react-simple-code-editor renders outside the reach
of the outer font shorthand.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(palette-picker): add runtime theme switcher to navbar
Moves all theme CSS to demo/static/themes/ for URL-accessible dynamic
loading. Registers a custom-PalettePicker navbar item that injects the
selected /themes/<id>.css at runtime, persists the choice in
localStorage, and restores it on reload via an inline <head> script.
* fix(palette-picker): swizzle NavbarItem/index instead of ComponentTypes
ComponentTypes swizzle was silently not loading. Replacing it with a
NavbarItem/index wrapper that intercepts custom-PalettePicker before
the ComponentTypes lookup, which is more reliable across Docusaurus
theme chain configurations.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(palette-picker): hide in mobile top bar via media query
The component already returns null for mobile={true} (drawer), but
Docusaurus also renders right-side navbar items in the collapsed mobile
top bar without that prop. Hide .root below 996px to match Docusaurus's
own navbar collapse breakpoint.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(palette-picker): mobile-friendly compact button + bottom sheet
On mobile (≤996px):
- Trigger collapses to a 36px circular swatch-only button (no text/chevron)
that fits cleanly in the navbar top bar
- Dropdown becomes a fixed bottom sheet with rounded top corners, a drag
handle indicator, and larger touch targets (12px padding per row)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(palette-picker): move mobile picker into hamburger drawer
Desktop: unchanged pill button + dropdown in the top bar.
Mobile: top-bar button hidden; instead renders a 2-column grid of
labeled color swatches inside the hamburger drawer (mobile={true})
with active-state border highlight and a section heading.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(palette-picker): make mobile drawer section collapsible
Replaces the always-open grid with an accordion toggle button showing
the current palette swatch + "Color Palette" label and a chevron.
The theme grid only renders when expanded, keeping the drawer compact
by default.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(palette-picker): mobile chevron starts right (>) rotates to down (v)
Matches Docusaurus's own collapsible nav item caret behavior.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent c2301d9 commit f6cc334
File tree
19 files changed
+5145
-77
lines changed- demo
- src
- components/PalettePicker
- css
- themes
- static/themes
19 files changed
+5145
-77
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
59 | 65 | | |
60 | | - | |
61 | 66 | | |
62 | | - | |
| 67 | + | |
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| |||
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
| 96 | + | |
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
| |||
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| 157 | + | |
| 158 | + | |
151 | 159 | | |
152 | 160 | | |
153 | 161 | | |
| |||
372 | 380 | | |
373 | 381 | | |
374 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
375 | 399 | | |
376 | 400 | | |
377 | 401 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
0 commit comments