style: Improve typography with scale, spacing, and mobile optimizations

This commit is contained in:
Paul Gauthier (aider) 2025-03-21 13:56:07 -07:00
parent 279e7e1456
commit 0eb26fffe1
2 changed files with 107 additions and 12 deletions

View file

@ -18,6 +18,27 @@
--body-line-height: 1.7; --body-line-height: 1.7;
--paragraph-spacing: 1.6rem; --paragraph-spacing: 1.6rem;
--heading-spacing: 1.8rem; --heading-spacing: 1.8rem;
/* Typographic scale */
--text-xs: 0.75rem; /* 12px */
--text-sm: 0.875rem; /* 14px */
--text-base: 1rem; /* 16px */
--text-md: 1.125rem; /* 18px */
--text-lg: 1.25rem; /* 20px */
--text-xl: 1.5rem; /* 24px */
--text-2xl: 1.875rem; /* 30px */
--text-3xl: 2.25rem; /* 36px */
--text-4xl: 3rem; /* 48px */
/* Spacing rhythm values */
--space-1: 0.25rem;
--space-2: 0.5rem;
--space-3: 0.75rem;
--space-4: 1rem;
--space-6: 1.5rem;
--space-8: 2rem;
--space-12: 3rem;
--space-16: 4rem;
} }
* { * {
@ -26,6 +47,31 @@
box-sizing: border-box; box-sizing: border-box;
} }
html {
scroll-behavior: smooth;
}
h1, h2, h3, h4, h5, h6 {
letter-spacing: -0.025em;
font-weight: 700;
}
h1 {
font-size: var(--text-4xl);
line-height: 1.1;
font-weight: 800;
}
h2 {
font-size: var(--text-2xl);
line-height: 1.2;
}
h3 {
font-size: var(--text-xl);
line-height: 1.3;
}
body { body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-size: 16px; font-size: 16px;
@ -61,7 +107,7 @@ nav {
.logo { .logo {
font-size: 1.8rem; font-size: 1.8rem;
font-weight: 700; font-weight: 600;
font-family: 'GlassTTYVT220', monospace; font-family: 'GlassTTYVT220', monospace;
color: var(--terminal-green); color: var(--terminal-green);
text-decoration: none; text-decoration: none;
@ -78,6 +124,9 @@ nav {
text-decoration: none; text-decoration: none;
font-weight: 500; font-weight: 500;
transition: color 0.3s; transition: color 0.3s;
font-size: var(--text-sm);
letter-spacing: 0.01em;
text-transform: uppercase;
} }
.nav-links a:hover { .nav-links a:hover {
@ -252,7 +301,7 @@ nav {
border-radius: 8px; border-radius: 8px;
padding: 30px; padding: 30px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
transition: transform 0.3s, box-shadow 0.3s; transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
border-left: 3px solid var(--primary); border-left: 3px solid var(--primary);
display: block; display: block;
color: inherit; color: inherit;
@ -262,7 +311,14 @@ nav {
.feature-card:hover { .feature-card:hover {
transform: translateY(-5px); transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
background-color: rgba(76, 110, 245, 0.03);
}
.feature-card p {
font-size: var(--text-base);
line-height: 1.6;
color: rgba(33, 37, 41, 0.9);
} }
.feature-card-header { .feature-card-header {
@ -284,14 +340,14 @@ nav {
} }
.feature-title { .feature-title {
font-size: 1.35rem; font-size: var(--text-lg);
color: var(--dark); color: var(--dark);
margin: 0; margin: 0;
position: relative; position: relative;
padding-bottom: 12px; padding-bottom: var(--space-3);
font-weight: 600; font-weight: 600;
letter-spacing: -0.25px; letter-spacing: -0.01em;
line-height: var(--heading-line-height); line-height: 1.3;
} }
.feature-title::after { .feature-title::after {
@ -309,17 +365,24 @@ nav {
background-color: #f8f9fb; background-color: #f8f9fb;
} }
code, pre, .code-block {
font-family: 'Fira Code', 'JetBrains Mono', 'SF Mono', Consolas, Monaco, 'Andale Mono', monospace;
font-feature-settings: "liga" 1, "calt" 1; /* Enable ligatures */
letter-spacing: -0.025em;
font-size: 0.95em;
}
.code-block { .code-block {
background-color: var(--code-bg); background-color: var(--code-bg);
border-radius: 8px; border-radius: 8px;
padding: 1.5rem; padding: 1.5rem;
color: white; color: white;
font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, 'Liberation Mono', Menlo, monospace;
font-size: 1.1rem; font-size: 1.1rem;
line-height: 1.6; line-height: 1.5;
margin: 1.5rem 0; margin: 1.5rem 0;
overflow-x: auto; overflow-x: auto;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
tab-size: 2;
} }
.testimonials { .testimonials {
@ -353,6 +416,8 @@ nav {
padding: 0 10px; padding: 0 10px;
font-size: 1.1rem; font-size: 1.1rem;
line-height: var(--body-line-height); line-height: var(--body-line-height);
text-wrap: balance;
hanging-punctuation: first;
} }
.testimonial-text::before, .testimonial-text::before,
@ -546,12 +611,15 @@ footer {
height: 28px; height: 28px;
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
font-size: 0.85rem; font-size: var(--text-xs);
font-weight: 600; font-weight: 600;
line-height: 1; line-height: 1;
text-decoration: none; text-decoration: none;
transition: transform 0.2s; transition: transform 0.2s;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
letter-spacing: 0.02em;
text-transform: uppercase;
} }
.github-badge:hover { .github-badge:hover {
@ -740,6 +808,30 @@ footer {
} }
} }
@media (max-width: 768px) {
:root {
/* Adjust scale for mobile */
--text-4xl: 2.5rem;
--text-2xl: 1.75rem;
--text-xl: 1.25rem;
}
body {
line-height: 1.5;
}
.feature-card p {
font-size: 0.9375rem;
}
/* Optimize testimonial display on mobile */
.testimonial-text {
font-size: 1rem;
line-height: 1.6;
text-wrap: pretty; /* Modern browsers will balance text */
}
}
@media (max-width: 576px) { @media (max-width: 576px) {
:root { :root {
--heading-line-height: 1.3; --heading-line-height: 1.3;

View file

@ -7,8 +7,11 @@ layout: none
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Aider - AI Pair Programming in Your Terminal</title> <title>Aider - AI Pair Programming in Your Terminal</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&display=swap"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://cdnjs.cloudflare.com">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap&text=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,/()%25&display=fallback">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&display=swap&display=fallback">
<link rel="stylesheet" href="/assets/home.css"> <link rel="stylesheet" href="/assets/home.css">
<!-- Add Prism.js CSS --> <!-- Add Prism.js CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css">