Skip to main content

Typography

VLN uses a modern, readable typography system with Inter for UI and JetBrains Mono for code.

Font Families

Inter (Primary)

Usage: UI, headings, body text, buttons, navigation

  • Weights: 400 (Regular), 500 (Medium), 600 (Semi-Bold), 700 (Bold)
  • License: SIL Open Font License
  • Source: Google Fonts
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

JetBrains Mono (Code)

Usage: Code blocks, code snippets, monospaced data

  • Weights: 400 (Regular), 500 (Medium)
  • License: SIL Open Font License
  • Source: Google Fonts
font-family: 'JetBrains Mono', 'Courier New', monospace;

Type Scale

Desktop Scale

StyleSizeWeightLine HeightUsage
H160px (3.75rem)7001.2Page titles
H248px (3rem)7001.25Section headers
H336px (2.25rem)6001.3Subsection headers
H424px (1.5rem)6001.4Card titles
H520px (1.25rem)6001.5Small headings
H618px (1.125rem)6001.5Tiny headings
Body Large18px (1.125rem)4001.6Intro paragraphs
Body16px (1rem)4001.6Default text
Body Small14px (0.875rem)4001.5Secondary text
Caption12px (0.75rem)4001.4Labels, captions
Code14px (0.875rem)4001.5Code blocks

Mobile Scale

On mobile devices (< 768px), scale down by 0.75x:

StyleMobile SizeDesktop Size
H145px60px
H236px48px
H327px36px
H421px24px
Body16px16px

Tailwind Classes

// Headings
<h1 className="text-5xl md:text-6xl font-bold">H1 Heading</h1>
<h2 className="text-4xl md:text-5xl font-bold">H2 Heading</h2>
<h3 className="text-3xl md:text-4xl font-semibold">H3 Heading</h3>
<h4 className="text-2xl font-semibold">H4 Heading</h4>
<h5 className="text-xl font-semibold">H5 Heading</h5>
<h6 className="text-lg font-semibold">H6 Heading</h6>

// Body text
<p className="text-lg">Large body text</p>
<p className="text-base">Default body text</p>
<p className="text-sm">Small body text</p>
<p className="text-xs">Caption text</p>

// Code
<code className="font-mono text-sm">inline code</code>

Usage Examples

Hero Section

<section className="py-20">
<h1 className="text-5xl md:text-6xl font-bold mb-6">
VLN Design System
</h1>
<p className="text-lg md:text-xl text-gray-400 max-w-2xl">
Build beautiful, accessible interfaces with our design standards
</p>
</section>

Card Title

<div className="bg-vln-bg-lighter p-6 rounded-vln">
<h4 className="text-2xl font-semibold mb-2">Card Title</h4>
<p className="text-sm text-gray-400 mb-4">Subtitle or description</p>
<p className="text-base">Body content goes here...</p>
</div>

Code Block

<pre className="bg-vln-bg p-4 rounded-lg overflow-x-auto">
<code className="font-mono text-sm text-vln-sage">
npm install @vln/components
</code>
</pre>

Text Colors

// Primary text
<p className="text-white">Primary text</p>

// Secondary text
<p className="text-gray-300">Secondary text</p>

// Muted text
<p className="text-gray-400">Muted text</p>

// Disabled text
<p className="text-gray-600">Disabled text</p>

// Accent colors
<p className="text-vln-sage">Success text</p>
<p className="text-vln-sky">Info text</p>
<p className="text-vln-amber">Warning text</p>
<p className="text-red-500">Error text</p>

Text Alignment

<p className="text-left">Left aligned (default)</p>
<p className="text-center">Center aligned</p>
<p className="text-right">Right aligned</p>
<p className="text-justify">Justified text</p>

Text Truncation

// Single line truncate
<p className="truncate">Very long text that will be cut off...</p>

// Multi-line clamp
<p className="line-clamp-2">
Long text that will be truncated after two lines with ellipsis...
</p>

<p className="line-clamp-3">
Even longer content that will show three lines maximum...
</p>

Best Practices

✅ Do

  • Use Inter for all UI text
  • Use JetBrains Mono for code
  • Maintain consistent line heights
  • Use responsive text sizes
  • Ensure sufficient contrast (WCAG AAA)
  • Limit line length to 60-80 characters

❌ Don't

  • Mix too many font sizes on one page
  • Use font sizes below 12px
  • Ignore responsive scaling
  • Use poor contrast ratios
  • Create walls of text without breaks

Accessibility

Contrast Ratios

All text must meet WCAG AAA standards:

  • Normal text: 7:1 minimum
  • Large text (18px+): 4.5:1 minimum

Tested Combinations

Text ColorBackgroundRatioGrade
WhiteDark (#0a0e0f)19.2:1AAA ✅
SageDark (#0a0e0f)8.2:1AAA ✅
SkyDark (#0a0e0f)9.5:1AAA ✅
AmberDark (#0a0e0f)11.2:1AAA ✅
Gray-300Dark (#0a0e0f)12.6:1AAA ✅

Readable Text

// Maximum line length for readability
<p className="max-w-prose">
Content with optimal line length for reading comfort...
</p>

// Adequate line spacing
<p className="leading-relaxed">
Text with comfortable line height for extended reading...
</p>

Loading Fonts

// app/layout.tsx
import { Inter, JetBrains_Mono } from 'next/font/google';

const inter = Inter({
subsets: ['latin'],
weight: ['400', '500', '600', '700'],
variable: '--font-inter',
});

const jetbrainsMono = JetBrains_Mono({
subsets: ['latin'],
weight: ['400', '500'],
variable: '--font-jetbrains-mono',
});

export default function RootLayout({ children }) {
return (
<html lang="en" className={`${inter.variable} ${jetbrainsMono.variable}`}>
<body className="font-sans">{children}</body>
</html>
);
}

Tailwind Config

// tailwind.config.ts
module.exports = {
theme: {
extend: {
fontFamily: {
sans: ['var(--font-inter)', 'Inter', 'sans-serif'],
mono: ['var(--font-jetbrains-mono)', 'JetBrains Mono', 'monospace'],
},
},
},
};

CSS Import (Alternative)

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
--font-inter: 'Inter', sans-serif;
--font-jetbrains-mono: 'JetBrains Mono', monospace;
}

body {
font-family: var(--font-inter);
}

code, pre {
font-family: var(--font-jetbrains-mono);
}