Skip to content

Commit 354009b

Browse files
ikhareConvex, Inc.
authored andcommitted
Docs: Make the fonts and sidebar a bit tighter (#34314)
GitOrigin-RevId: 16b3cd25ebc70cfb4d6b7b473cf2bc45583e6f41
1 parent 3ed7cf0 commit 354009b

File tree

2 files changed

+53
-41
lines changed

2 files changed

+53
-41
lines changed

npm-packages/docs/src/css/custom.css

Lines changed: 52 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@
4747
--convex-code-border-color: rgba(0, 0, 0, 0.04);
4848
--convex-code-block-header-background-color: #eef2f9;
4949

50+
--doc-sidebar-width: 260px !important; /* Reduced from default 300px */
51+
5052
--ifm-code-padding-horizontal: 0.25rem;
5153
--ifm-global-shadow-lw: none;
5254

5355
--ifm-navbar-shadow: none;
54-
--ifm-navbar-height: 5rem;
56+
--ifm-navbar-height: 4rem;
5557

5658
--ifm-menu-color-active: var(--ifm-navbar-link-color);
5759
--ifm-menu-color-background-active: rgb(222, 226, 234);
@@ -110,11 +112,21 @@
110112
/* Zen of Convex */
111113
--convex-zen-do-color: var(--ifm-color-success-dark);
112114
--convex-zen-do-not-color: var(--ifm-color-warning-dark);
115+
116+
--ifm-font-size-base: 0.9375rem;
117+
--ifm-line-height-base: 1.6;
118+
--ifm-h1-font-size: 2rem;
119+
--ifm-h2-font-size: 1.5rem;
120+
--ifm-h3-font-size: 1.25rem;
121+
--ifm-h4-font-size: 1rem;
122+
--ifm-heading-margin-bottom: 1rem;
123+
--ifm-spacing-vertical: 1rem;
124+
--ifm-paragraph-margin-bottom: 1rem;
113125
}
114126

115127
/* Sets the main top-left logo size */
116128
.navbar__logo {
117-
height: 3rem;
129+
height: 2.5rem;
118130
margin-right: 0;
119131
}
120132

@@ -246,7 +258,7 @@ nav.menu {
246258
.theme-doc-sidebar-item-category-level-2,
247259
.theme-doc-sidebar-item-category-level-3,
248260
.theme-doc-sidebar-item-category-level-4 {
249-
font-size: 0.8125rem;
261+
font-size: 0.875rem;
250262
}
251263

252264
/* reset padding on container because we added footer inside of it */
@@ -256,7 +268,7 @@ main > .container {
256268

257269
/* Increase the padding on the main text */
258270
main > .container > .row {
259-
padding: 1rem var(--convex-container-padding-horizontal) 2rem;
271+
padding: 0.75rem var(--convex-container-padding-horizontal) 1.5rem;
260272
margin: 0;
261273
}
262274

@@ -323,20 +335,20 @@ article code {
323335
/* START: Custom cards implementation */
324336
.cards {
325337
display: grid;
326-
gap: 1.25rem;
327-
margin: 2rem 0 3rem;
338+
gap: 1rem;
339+
margin: 1.5rem 0 2.5rem;
328340
}
329341

330342
.qs-cards {
331343
display: grid;
332-
gap: 1.25rem;
333-
margin: 2rem 0 3rem;
344+
gap: 1rem;
345+
margin: 1.5rem 0 2.5rem;
334346
}
335347

336348
.component-cards {
337349
display: grid;
338-
gap: 1.25rem;
339-
margin: 2rem 0 3rem;
350+
gap: 1rem;
351+
margin: 1.5rem 0 2.5rem;
340352
}
341353

342354
/* This magic number 462 is the size of the article div container as rendered */
@@ -363,10 +375,10 @@ article code {
363375

364376
a.card {
365377
box-shadow: none;
366-
padding: 1.75rem 1rem;
378+
padding: 1.25rem 1rem;
367379
border: 1px solid var(--ifm-toc-border-color);
368380
flex-direction: row;
369-
gap: 1rem;
381+
gap: 0.75rem;
370382
align-items: center;
371383
max-width: 550px;
372384
text-decoration: none;
@@ -393,7 +405,7 @@ a.card:hover {
393405
}
394406

395407
a.card h2 {
396-
font-size: 1rem;
408+
font-size: 0.9375rem;
397409
}
398410

399411
a.card p {
@@ -484,18 +496,18 @@ a.pagination-nav__link .pagination-nav__label:hover {
484496

485497
/* Stylize the top doc headings to match convex.dev */
486498
.markdown h1:first-child {
487-
--ifm-h1-font-size: 2.5rem;
488-
margin-top: 1.75rem;
499+
--ifm-h1-font-size: 2rem;
500+
margin-top: 1.25rem;
489501
--ifm-heading-font-family: "GT America", system-ui, "Segoe UI", Roboto,
490502
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
491503
"Segoe UI Symbol";
492504
font-weight: 700;
493-
letter-spacing: -0.03em;
505+
letter-spacing: -0.01em;
494506
}
495507

496508
@media (min-width: 997px) {
497509
.markdown h1:first-child {
498-
--ifm-h1-font-size: 3.5rem;
510+
--ifm-h1-font-size: 2.5rem;
499511
}
500512
}
501513

@@ -508,7 +520,7 @@ h4 {
508520
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
509521
"Segoe UI Symbol";
510522
font-weight: 700;
511-
letter-spacing: -0.025em;
523+
letter-spacing: -0.01em;
512524
}
513525

514526
h2.text--truncate {
@@ -620,8 +632,8 @@ html[data-theme="dark"] .convex-menu-header {
620632
.theme-doc-sidebar-item-link-level-1 > a::before,
621633
.theme-doc-sidebar-item-category-level-1 > div > a::before {
622634
padding-left: 0.125rem;
623-
padding-right: 0.625rem;
624-
padding-top: 0.0625rem;
635+
padding-right: 0.5rem;
636+
padding-top: 0;
625637
width: 1rem;
626638
height: 1.0625rem;
627639
content: var(--convex-icon);
@@ -630,7 +642,7 @@ html[data-theme="dark"] .convex-menu-header {
630642

631643
/* Ensures all menu items are the same height, with or without a submenu. */
632644
.menu__link {
633-
min-height: 2.125rem;
645+
min-height: 1.875rem;
634646
}
635647

636648
/* START: Icons for each top level item */
@@ -892,11 +904,11 @@ main article > div {
892904

893905
/* START: StepByStep styling */
894906
.convex-step-by-step {
895-
margin-bottom: 2.5rem;
907+
margin-bottom: 2rem;
896908
}
897909

898910
.convex-step {
899-
margin-bottom: 2.5rem;
911+
margin-bottom: 2rem;
900912
}
901913

902914
@media (min-width: 997px) {
@@ -967,14 +979,14 @@ main .container .col[class*="docItemCol"] {
967979
display: flex;
968980
flex-direction: column;
969981
justify-content: left;
970-
gap: 1em;
971-
padding: 1.5rem;
982+
gap: 0.75rem;
983+
padding: 1.25rem;
972984
background-color: var(--ifm-color-info-contrast-background);
973985
border: var(--ifm-alert-border-width) solid var(--ifm-alert-border-color);
974986
border-left-width: var(--ifm-alert-border-left-width);
975987
border-radius: var(--ifm-alert-border-radius);
976988
box-shadow: var(--ifm-alert-shadow);
977-
margin-bottom: 2rem;
989+
margin-bottom: 1.5rem;
978990
}
979991

980992
@media (min-width: 997px) {
@@ -1083,7 +1095,7 @@ h2.zen-header {
10831095
/* Fix pages without Table of Contents on the right should not be
10841096
too wide, except for all the quick starts */
10851097
html:not([class*="docs-doc-id-quickstart/"]) main > .container > .row .col {
1086-
max-width: 966px;
1098+
max-width: 860px;
10871099
}
10881100

10891101
/* Border for screenshots that are confusing if left on white background */
@@ -1150,10 +1162,10 @@ html[data-theme="dark"] a.card.convex-invert-icon svg {
11501162
.StackPosts {
11511163
display: flex;
11521164
flex-direction: column;
1153-
gap: 1.25rem;
1165+
gap: 1rem;
11541166
container-type: inline-size;
1155-
margin-top: 3rem;
1156-
padding-top: 2rem;
1167+
margin-top: 2.5rem;
1168+
padding-top: 1.5rem;
11571169
border-top: 1px solid var(--ifm-toc-border-color);
11581170
}
11591171

@@ -1165,7 +1177,7 @@ html[data-theme="dark"] a.card.convex-invert-icon svg {
11651177
align-items: center;
11661178
gap: 0.375rem;
11671179
font-weight: bold;
1168-
font-size: 1.5rem;
1180+
font-size: 1.25rem;
11691181
}
11701182

11711183
.StackPosts-title-imageLink {
@@ -1189,7 +1201,7 @@ html[data-theme="dark"] .StackPosts-title-image--dark {
11891201
.StackPosts-posts {
11901202
display: flex;
11911203
flex-direction: column;
1192-
gap: 1.5rem;
1204+
gap: 1.25rem;
11931205
}
11941206

11951207
@container (min-width: 45rem) {
@@ -1259,8 +1271,8 @@ html[data-theme="dark"] .StackPosts-title-image--dark {
12591271
/* START: Large cards implementation */
12601272
.large-cards {
12611273
display: grid;
1262-
gap: 1.25rem;
1263-
margin: 2rem 0 3rem;
1274+
gap: 1rem;
1275+
margin: 1.5rem 0 2.5rem;
12641276
}
12651277

12661278
@container (width > 743px) {
@@ -1271,15 +1283,15 @@ html[data-theme="dark"] .StackPosts-title-image--dark {
12711283

12721284
a.large-card {
12731285
box-shadow: none;
1274-
padding: 1.5rem;
1286+
padding: 1.25rem;
12751287
border: 1px solid var(--ifm-toc-border-color);
12761288
border-radius: var(--ifm-card-border-radius);
12771289
display: flex;
12781290
flex-direction: column;
12791291
justify-content: center;
12801292
gap: 0.5rem;
12811293
height: 100%;
1282-
min-height: 150px;
1294+
min-height: 130px;
12831295
text-decoration: none;
12841296
background-color: var(--ifm-background-color);
12851297
}
@@ -1292,7 +1304,7 @@ a.large-card:hover {
12921304
}
12931305

12941306
a.large-card h2 {
1295-
font-size: 1.25rem;
1307+
font-size: 1.125rem;
12961308
margin: 0;
12971309
}
12981310

@@ -1308,8 +1320,8 @@ a.large-card p {
13081320
/* Video link cards */
13091321
.video-cards {
13101322
display: grid;
1311-
gap: 1.25rem;
1312-
margin: 2rem 0 3rem;
1323+
gap: 1rem;
1324+
margin: 1.5rem 0 2.5rem;
13131325
grid-template-columns: repeat(1, minmax(0, 1fr));
13141326
}
13151327

@@ -1321,7 +1333,7 @@ a.large-card p {
13211333

13221334
a.video-card {
13231335
box-shadow: none;
1324-
padding: 1.5rem;
1336+
padding: 1.25rem;
13251337
border: 1px solid var(--ifm-toc-border-color);
13261338
border-radius: var(--ifm-card-border-radius);
13271339
display: flex;

npm-packages/docs/static/img/sidebar-icons/paper-plane.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)