Skip to content

Commit 6a8a0a4

Browse files
committed
Typography improvements
1 parent 590854c commit 6a8a0a4

File tree

1 file changed

+38
-63
lines changed

1 file changed

+38
-63
lines changed

src/css/custom.css

Lines changed: 38 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,18 @@
3838

3939
--list-inset: 24px;
4040
--block-spacing-small: 8px;
41-
--block-spacing: 20px;
41+
--block-spacing: 2rem;
4242
--text-regular-size: 14px;
43-
--h1-size: var(--title-5-size);
44-
--h1-line-height: var(--title-5-line-height);
45-
--h1-letter-spacing: var(--title-5-letter-spacing);
46-
--h2-size: var(--title-3-size);
47-
--h2-line-height: var(--title-3-line-height);
48-
--h2-letter-spacing: var(--title-3-letter-spacing);
49-
--h2-bottom-margin: 12px;
50-
--h3-size: 20px;
51-
--h3-line-height: 1.6;
52-
--h3-letter-spacing: 0;
53-
--h3-bottom-margin: 6px;
54-
--h4-size: var(--title-1-size);
55-
--h4-line-height: var(--title-1-line-height);
56-
--h4-letter-spacing: var(--title-1-letter-spacing);
57-
--h4-bottom-margin: 10px;
43+
--header-line-height: 1.25em;
44+
--header-letter-spacing: -0.02em;
45+
--header-bottom-margin: 1rem;
46+
--header-bottom-spacing: 0.75em;
47+
--header-top-spacing: 1.75em;
48+
--h1-size: 2rem;
49+
--h2-size: 1.65rem;
50+
--h3-size: 1.4rem;
51+
--h4-size: 1.25rem;
5852
--figure-margin: 20px;
59-
--block-spacing: 16px;
6053
--p-size: var(--text-regular-size);
6154
--p-line-height: var(--text-regular-line-height);
6255
--p-letter-spacing: var(--text-regular-letter-spacing);
@@ -1511,22 +1504,6 @@ body {
15111504
transition: transform 0.25s;
15121505
}
15131506

1514-
/* Ensure headings are at full brightness */
1515-
.theme-doc-markdown h1,
1516-
.theme-doc-markdown h2,
1517-
.theme-doc-markdown h3,
1518-
.theme-doc-markdown h4,
1519-
.theme-doc-markdown h5,
1520-
.theme-doc-markdown h6 {
1521-
color: hsl(var(--foreground)) !important; /* 100% brightness */
1522-
font-weight: 700; /* Bold for h1-h3 */
1523-
}
1524-
1525-
.theme-doc-markdown h4,
1526-
.theme-doc-markdown h5,
1527-
.theme-doc-markdown h6 {
1528-
font-weight: 600; /* Slightly less bold for smaller headings */
1529-
}
15301507

15311508
/* Content spacing and layout */
15321509
.theme-doc-markdown {
@@ -1562,44 +1539,40 @@ main[class*="docMainContainer"] {
15621539
/* Heading styles */
15631540
.theme-doc-markdown h1,
15641541
.theme-doc-markdown h2,
1565-
.theme-doc-markdown h3 {
1566-
color: hsl(var(--foreground)) !important;
1567-
background: none !important;
1568-
-webkit-background-clip: unset !important;
1569-
background-clip: unset !important;
1542+
.theme-doc-markdown h3,
1543+
.theme-doc-markdown h4,
1544+
.theme-doc-markdown h5,
1545+
.theme-doc-markdown h6 {
1546+
background: none;
1547+
background-clip: unset;
1548+
color: hsl(var(--foreground));
1549+
letter-spacing: var(--header-letter-spacing);
1550+
line-height: var(--header-line-height);
1551+
margin-bottom: var(--header-bottom-spacing);
1552+
margin-top: var(--header-top-spacing);
15701553
}
15711554

15721555
.theme-doc-markdown h1 {
1573-
font-size: 2.5rem;
1556+
font-size: var(--h1-size);
15741557
font-weight: 600;
1575-
letter-spacing: -0.025em;
1576-
line-height: 1.2;
15771558
margin-top: 0;
1578-
margin-bottom: 1.5rem;
15791559
}
15801560

15811561
.theme-doc-markdown h2 {
1582-
font-size: 1.5rem;
1562+
font-size: var(--h2-size);
15831563
font-weight: 600;
1584-
letter-spacing: -0.025em;
1585-
margin-top: 1.5rem;
1586-
margin-bottom: 1rem;
15871564
}
15881565

15891566
.theme-doc-markdown h3 {
1590-
font-size: 1.25rem;
1567+
font-size: var(--h3-size);
15911568
font-weight: 600;
1592-
margin-top: 1.25rem;
1593-
margin-bottom: 0.75rem;
15941569
}
15951570

15961571
.theme-doc-markdown h4,
15971572
.theme-doc-markdown h5,
15981573
.theme-doc-markdown h6 {
1599-
font-size: 1.25rem;
1574+
font-size: var(--h4-size);
16001575
font-weight: 500;
1601-
margin-top: 1.25rem;
1602-
margin-bottom: 0.5rem;
16031576
}
16041577

16051578
/* Paragraph spacing - match roocode.com */
@@ -1627,15 +1600,17 @@ main[class*="docMainContainer"] {
16271600
/* List spacing */
16281601
.theme-doc-markdown ul,
16291602
.theme-doc-markdown ol {
1630-
margin-bottom: 1.5rem;
1631-
padding-left: 1.5rem;
1603+
margin-bottom: calc(var(--block-spacing));
1604+
padding-left: var(--list-inset);
16321605
}
16331606

16341607
.theme-doc-markdown li {
1635-
margin-bottom: 0.5rem;
1636-
line-height: 1.625;
1608+
margin-bottom: calc(var(--block-spacing) / 4);
1609+
font-size: var(--text-regular-size);
1610+
line-height: var(--text-regular-line-height);
16371611
color: hsl(var(--foreground) / 0.9); /* Match paragraph brightness */
16381612
font-weight: 400;
1613+
16391614
}
16401615

16411616
/* Nested list spacing */
@@ -1647,7 +1622,7 @@ main[class*="docMainContainer"] {
16471622

16481623
/* Code blocks with roocode.com styling */
16491624
.theme-code-block {
1650-
margin: 2rem 0; /* More spacing */
1625+
margin: var(--figure-margin) 0;
16511626
border-radius: calc(var(--radius)) !important;
16521627
overflow: hidden;
16531628
box-shadow: var(--block-shadow) !important;
@@ -1687,7 +1662,7 @@ main[class*="docMainContainer"] {
16871662
background: hsl(var(--background) / 0.5);
16881663
backdrop-filter: blur(16px);
16891664
padding: 1rem 1.5rem;
1690-
margin: 2rem 0;
1665+
margin: var(--figure-margin) 0;
16911666
border-radius: 0 calc(var(--radius)) calc(var(--radius)) 0;
16921667
}
16931668

@@ -1699,7 +1674,7 @@ main[class*="docMainContainer"] {
16991674

17001675
/* Admonitions (alerts) with roocode.com style */
17011676
.theme-admonition {
1702-
margin: 2rem 0 !important;
1677+
margin: var(--figure-margin) 0 !important;
17031678
padding: 1.5rem !important;
17041679
border-radius: calc(var(--radius) + 4px) !important;
17051680
border: 1px solid hsl(var(--border) / 0.5) !important;
@@ -1719,7 +1694,7 @@ main[class*="docMainContainer"] {
17191694
/* Tables with roocode.com styling */
17201695
.theme-doc-markdown table {
17211696
width: 100%;
1722-
margin: 2rem 0;
1697+
margin: var(--figure-margin) 0;
17231698
border-collapse: separate;
17241699
border-spacing: 0;
17251700
border-radius: calc(var(--radius)/2);
@@ -1866,7 +1841,7 @@ main[class*="docMainContainer"] {
18661841
height: auto;
18671842
border-radius: var(--radius);
18681843
outline: 1px solid hsl(var(--border));
1869-
margin: 1rem 0;
1844+
margin: var(--block-spacing) 0;
18701845
overflow: hidden;
18711846
box-shadow: var(--block-shadow);
18721847
transition: transform 0.1s;
@@ -1896,8 +1871,8 @@ main[class*="docMainContainer"] {
18961871
.theme-doc-markdown hr {
18971872
border: none;
18981873
height: 1px;
1899-
background: hsl(var(--border) / 0.5);
1900-
margin: 3rem 0; /* Reduced from 3rem */
1874+
background: hsl(var(--border) / 0.75);
1875+
margin: var(--block-spacing) 0;
19011876
position: relative;
19021877
}
19031878

0 commit comments

Comments
 (0)