Skip to content

Commit 30f9ff8

Browse files
prc5cursoragent
andcommitted
docs: fix mobile responsiveness and search styling
Improve navbar, hero, how-it-works, showcase, and summary sections for small screens. Switch search dropdown from dark to light theme and use attribute selectors for hashed class names. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6a93dc6 commit 30f9ff8

6 files changed

Lines changed: 72 additions & 42 deletions

File tree

documentation/src/css/custom.css

Lines changed: 60 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,9 +1471,10 @@ body {
14711471
box-shadow: none;
14721472
border: 0;
14731473
background: transparent !important;
1474+
position: relative;
14741475
}
14751476

1476-
@media (min-width: 996px) {
1477+
@media (min-width: 997px) {
14771478
.navbar {
14781479
@apply backdrop-blur-sm;
14791480
box-shadow: none;
@@ -1512,12 +1513,24 @@ body {
15121513
.navbar__items .navbar__brand {
15131514
margin-right: auto;
15141515
}
1516+
.navbar__toggle {
1517+
position: absolute !important;
1518+
right: 16px;
1519+
top: 20px;
1520+
}
1521+
.navbar__items--right {
1522+
transform: translateX(20px);
1523+
}
1524+
body .navbar__items--right {
1525+
margin-right: 50px !important;
1526+
}
15151527
body .navbar__items--right > div > .navbar__search-input {
15161528
width: 140px !important;
1529+
padding-right: 0.5rem !important;
15171530
@apply !px-2;
15181531
}
1519-
body .navbar__items--right > div:last-child {
1520-
margin-right: 50px !important;
1532+
body [class*="searchHintContainer"] {
1533+
display: none !important;
15211534
}
15221535
.row.footer__links {
15231536
display: grid;
@@ -1535,6 +1548,11 @@ body {
15351548
@apply text-sm;
15361549
}
15371550
}
1551+
@media (max-width: 420px) {
1552+
.navbar__title.text--truncate {
1553+
display: none !important;
1554+
}
1555+
}
15381556
/* Github icon */
15391557

15401558
.github {
@@ -1808,73 +1826,85 @@ html body .navbar__search-input:focus {
18081826
}
18091827

18101828
html body .navbar__search {
1811-
--search-local-modal-background: #141415;
1829+
--search-local-modal-background: #ffffff;
18121830
--search-local-modal-shadow:
1813-
0 8px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
1814-
--search-local-hit-background: #1e1e21;
1831+
0 8px 30px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.06);
1832+
--search-local-hit-background: #f4f4f5;
18151833
--search-local-hit-shadow: none;
1816-
--search-local-hit-color: #e4e4e7;
1817-
--search-local-highlight-color: #60a5fa;
1834+
--search-local-hit-color: #3f3f46;
1835+
--search-local-highlight-color: #2563eb;
18181836
--search-local-muted-color: #71717a;
1819-
--search-local-hit-active-color: #fff;
1837+
--search-local-hit-active-color: #18181b;
18201838
--search-local-modal-width: 480px;
18211839
--search-local-spacing: 10px;
18221840
--search-local-hit-height: 48px;
18231841
}
18241842

1825-
html body .searchHintContainer {
1843+
html body [class*="searchHintContainer"] {
18261844
right: 8px !important;
1845+
top: 50% !important;
1846+
transform: translateY(-50%) !important;
18271847
gap: 2px !important;
18281848
}
18291849

1830-
html body .searchHint {
1831-
font-size: 8px !important;
1850+
html body [class*="searchHint"] {
1851+
font-size: 10px !important;
18321852
font-weight: 500 !important;
18331853
font-family:
18341854
system-ui,
18351855
-apple-system,
18361856
sans-serif !important;
18371857
line-height: 1 !important;
1838-
padding: 1px 3px !important;
1839-
min-width: 14px !important;
1840-
height: 16px !important;
1858+
padding: 2px 5px !important;
1859+
min-width: 18px !important;
1860+
height: 20px !important;
18411861
display: inline-flex !important;
18421862
align-items: center !important;
18431863
justify-content: center !important;
18441864
text-align: center !important;
1845-
border-radius: 3px !important;
1865+
border-radius: 4px !important;
18461866
color: #a1a1aa !important;
1847-
background: #f4f4f5 !important;
1848-
border: 1px solid #e4e4e7 !important;
1849-
box-shadow: 0 1px 0 #e4e4e7 !important;
1867+
background: transparent !important;
1868+
border: none !important;
1869+
box-shadow: none !important;
18501870
}
18511871

1852-
html body .searchBarContainer {
1872+
html body [class*="searchBarContainer"] {
18531873
margin-left: 12px !important;
1874+
position: relative;
18541875
}
18551876

1856-
html body .dropdownMenu {
1877+
html body [class*="dropdownMenu"] {
18571878
@apply !rounded-xl;
1858-
background: #141415 !important;
1859-
border: 1px solid rgba(255, 255, 255, 0.06) !important;
1879+
background: #ffffff !important;
1880+
border: 1px solid #e4e4e7 !important;
1881+
box-shadow:
1882+
0 4px 16px rgba(0, 0, 0, 0.08),
1883+
0 1px 3px rgba(0, 0, 0, 0.06) !important;
18601884
margin-top: 6px !important;
18611885
}
18621886

1863-
html body .dropdownMenu * {
1864-
color: #e4e4e7 !important;
1887+
html body [class*="dropdownMenu"] * {
1888+
color: #3f3f46 !important;
18651889
}
18661890

1867-
html body .dropdownMenu mark {
1868-
color: #60a5fa !important;
1891+
html body [class*="dropdownMenu"] mark {
1892+
color: #2563eb !important;
18691893
background: transparent !important;
1894+
font-weight: 600 !important;
18701895
}
18711896

1872-
html body .dropdownMenu .suggestion {
1897+
html body [class*="dropdownMenu"] [class*="suggestion"] {
18731898
@apply !rounded-lg;
1874-
background: #1e1e21 !important;
1899+
background: #f4f4f5 !important;
1900+
}
1901+
1902+
html body [class*="dropdownMenu"] [class*="suggestion"]:hover {
1903+
background: #e4e4e7 !important;
18751904
}
18761905

1877-
html body .dropdownMenu .suggestion span[class*="subtitle"] {
1906+
html body [class*="dropdownMenu"] [class*="hitPath"],
1907+
html body [class*="dropdownMenu"] [class*="subtitle"] {
18781908
color: #71717a !important;
18791909
}
18801910

documentation/src/routes/landing/hero/hero.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ export const Hero = () => {
4646
<p className="max-w-md text-center text-base my-7">Generate always up-to-date API documentation from your codebase. Zero maintenance, fully customizable.</p>
4747

4848
{/* CTA Buttons */}
49-
<div className="flex items-center gap-4">
50-
<Link to="/docs/getting-started" className="!no-underline bg-indigo-500 hover:bg-indigo-600 text-white hover:text-white rounded-full px-9 h-12 m-1 ring-offset-2 ring-1 ring-indigo-400 flex items-center transition-colors">
49+
<div className="flex flex-col sm:flex-row items-center gap-3 sm:gap-4 w-full sm:w-auto px-4 sm:px-0">
50+
<Link to="/docs/getting-started" className="!no-underline bg-indigo-500 hover:bg-indigo-600 text-white hover:text-white rounded-full px-9 h-12 m-1 ring-offset-2 ring-1 ring-indigo-400 flex items-center justify-center whitespace-nowrap transition-colors w-full sm:w-auto">
5151
Get started
5252
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="lucide lucide-arrow-right ml-1 size-4" aria-hidden="true">
5353
<path d="M5 12h14" />
5454
<path d="m12 5 7 7-7 7" />
5555
</svg>
5656
</Link>
57-
<Link to="/docs/showcase" className="!no-underline flex items-center gap-2 border border-slate-400 hover:bg-indigo-50 transition rounded-full px-7 h-12 text-slate-700 hover:text-slate-700">
57+
<Link to="/docs/showcase" className="!no-underline flex items-center justify-center gap-2 border border-slate-400 hover:bg-indigo-50 transition rounded-full px-7 h-12 text-slate-700 hover:text-slate-700 whitespace-nowrap w-full sm:w-auto">
5858
<Eye className="size-5" strokeWidth={1.5} aria-hidden="true" />
59-
<span className="">Showcase demo</span>
59+
<span>Showcase demo</span>
6060
</Link>
6161
</div>
6262
</div>

documentation/src/routes/landing/how-it-works/how-it-works.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ const StepCard = ({ step, index }: { step: Step; index: number }) => {
245245
}, []);
246246

247247
return (
248-
<FadeIn delay={index * 0.1} translateY={30} className="h-full">
248+
<FadeIn delay={index * 0.1} translateY={30} className="h-full min-w-0">
249249
<div
250250
ref={ref}
251251
className={`
@@ -254,7 +254,7 @@ const StepCard = ({ step, index }: { step: Step; index: number }) => {
254254
${step.hoverBorder}
255255
`}
256256
>
257-
<div className="p-6 md:p-8 flex flex-col flex-1">
257+
<div className="p-6 md:p-8 flex flex-col flex-1 min-w-0">
258258
{/* Step number + icon */}
259259
<div className="flex items-center gap-3 mb-5">
260260
<div className={`flex items-center justify-center w-10 h-10 rounded-xl ${step.accentBg} ${step.accentBorder} border`}>
@@ -273,7 +273,7 @@ const StepCard = ({ step, index }: { step: Step; index: number }) => {
273273
<div
274274
className={`
275275
rounded-xl bg-slate-900 p-4 font-mono text-[12px] leading-relaxed [&_div]:text-[12px] [&_span]:text-[12px]
276-
transition-all duration-500 overflow-hidden flex-1 whitespace-pre
276+
transition-all duration-500 overflow-x-auto overflow-y-hidden flex-1 whitespace-pre
277277
${isVisible ? "opacity-100 translate-y-0" : "opacity-0 translate-y-2"}
278278
`}
279279
>

documentation/src/routes/landing/showcase/showcase.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ export const Showcase = () => {
441441
<div className="w-2.5 h-2.5 rounded-full bg-slate-300" />
442442
</div>
443443
<div className="flex-1 flex justify-center">
444-
<div className="flex items-center gap-6 text-xs text-slate-400">
444+
<div className="hidden md:flex items-center gap-6 text-xs text-slate-400">
445445
<span className="font-medium text-slate-600">Source</span>
446446
<span className="w-px h-3 bg-slate-200" />
447447
<span className="font-medium text-slate-600">Preview</span>
@@ -453,7 +453,7 @@ export const Showcase = () => {
453453
{/* Content split */}
454454
<div className="grid md:grid-cols-2 min-h-[380px]">
455455
{/* Left: Code editor */}
456-
<div className="relative border-r border-slate-100 p-6 md:p-8 bg-white">
456+
<div className="relative border-r border-slate-100 p-6 md:p-8 bg-white overflow-hidden">
457457
<div className="space-y-0.5">
458458
{currentStep.code.map((line, index) => (
459459
<CodeLineRenderer

documentation/src/routes/landing/summary/summary.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@ export const Summary = () => {
146146
</div>
147147
</div>
148148
<div className="relative w-full md:w-1/2 overflow-hidden p-6 md:p-8">
149-
<div className="bg-slate-900 rounded-xl p-5 text-xs font-mono text-slate-300 leading-relaxed">
149+
<div className="bg-slate-900 rounded-xl p-5 text-xs font-mono text-slate-300 leading-relaxed overflow-hidden">
150150
<div className="text-slate-500 text-xs">{"// your-docs/request.mdx"}</div>
151151
<div className="mt-2">
152152
<span className="text-blue-400 text-xs">## Methods</span>
153153
</div>
154-
<div className="mt-1 text-xs whitespace-nowrap">
154+
<div className="mt-1 text-xs whitespace-nowrap overflow-hidden text-ellipsis">
155155
<span className="text-pink-400 text-xs">{"(@import core Request "}</span>
156156
<span className="text-pink-500 text-xs">{"type=methods&display=table)"}</span>
157157
</div>

documentation/src/theme/TOC/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default function TOC({ className, ...props }: Props): JSX.Element {
6060
<span>Sponsor</span>
6161
</a>
6262

63-
<h6 className="text-[16px] font-bold uppercase ml-[4px]">On this page</h6>
63+
<h6 className="text-[12px] font-bold uppercase ml-[4px]">On this page</h6>
6464
<div
6565
className={clsx(
6666
styles.tableOfContents,

0 commit comments

Comments
 (0)