Building Your Learning Module...
Getting things ready for you!
Find videos you like?
Save to resource drawer for future reference!
• Multiple files (Regular.woff, Bold.woff, etc.)
• ~100KB × 6 styles = 600KB
• Fixed weights (400, 700)
• More HTTP requests
• One file (Variable.woff2)
• ~150KB total
• Any weight (100-900)
• Smooth animations!
CSS Property: font-weight
font-weight: 350;CSS Property: font-stretch
font-stretch: 115%;CSS Property: font-style: oblique
font-style: oblique 10deg;CSS Property: font-style: italic
font-style: italic;CSS Property: font-optical-sizing
font-optical-sizing: auto;font-weight when available - they're easier to read and maintain!For custom axes or fine-grained control, use font-variation-settings:
/* Single axis */
font-variation-settings: 'wght' 650;
/* Multiple axes */
font-variation-settings:
'wght' 500,
'wdth' 120,
'slnt' -5;
/* Custom axes (font-specific) */
font-variation-settings:
'wght' 600,
'GRAD' 150; /* Custom gradient axis */⚠️ Axis names must be in quotes and exactly 4 characters!
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<div class="container">
<h1>✨ Variable Fonts Demo</h1>
<div class="demo-section">
<div class="label">Standard Weights (100, 300, 500, 700, 900)</div>
<div class="grid">
<div class="weight-card">
<div class="demo-text weight-100">Aa</div>
<div class="weight-value">100 Thin</div>
</div>
<div class="weight-card">
<div class="demo-text weight-300">Aa</div>
<div class="weight-value">300 Light</div>
</div>
<div class="weight-card">
<div class="demo-text weight-500">Aa</div>
<div class="weight-value">500 Medium</div>
</div>
<div class="weight-card">
<div class="demo-text weight-700">Aa</div>
<div class="weight-value">700 Bold</div>
</div>
<div class="weight-card">
<div class="demo-text weight-900">Aa</div>
<div class="weight-value">900 Black</div>
</div>
</div>
</div>
<div class="demo-section">
<div class="label">🎯 Custom Weights (450, 650) - Only possible with Variable Fonts!</div>
<div class="grid" style="grid-template-columns: 1fr 1fr;">
<div class="weight-card">
<div class="demo-text weight-450">Aa</div>
<div class="weight-value">450 Custom</div>
</div>
<div class="weight-card">
<div class="demo-text weight-650">Aa</div>
<div class="weight-value">650 Custom</div>
</div>
</div>
</div>
<div class="demo-section">
<div class="label">🎬 Animated Weight (300 → 900)</div>
<div style="text-align: center; padding: 30px; background: linear-gradient(135deg, #667eea, #764ba2); border-radius: 12px;">
<div class="demo-text animated" style="color: white; font-size: 64px;">
Variable!
</div>
</div>
</div>
</div>
</body>
</html>Loading preview...
@font-face {
font-family: 'InterVariable';
src: url('Inter-Variable.woff2') format('woff2-variations');
font-weight: 100 900; /* Range */
font-display: swap;
}UI, body text
Google Material
Adobe, readable
Code & UI
font-weight: 450;