Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Responsive typography
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Gunnar Bittersmann
July 08, 2019
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Responsive typography
Gunnar Bittersmann
July 08, 2019
More Decks by Gunnar Bittersmann
See All by Gunnar Bittersmann
Responsive typography 2
gunnarbittersmann
0
180
Go home, Prettifier, you’re drunk!!
gunnarbittersmann
0
130
3 Fehler sind zu finden
gunnarbittersmann
0
210
TIL that the future :has already begun
gunnarbittersmann
0
140
TIL how to clear floats
gunnarbittersmann
0
150
TIL about showModal (from small things big things one day come)
gunnarbittersmann
0
150
Inclusive Design 24 2022 – Gunnar’s picks
gunnarbittersmann
0
120
The color rebeccapurple
gunnarbittersmann
0
210
Mehrsprachige Websites
gunnarbittersmann
0
130
Other Decks in Programming
See All in Programming
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
210
Hono + Inertia + React で LP を構築した話
oukayuka
2
110
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
320
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
340
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
340
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
1.1k
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
4
1.7k
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
560
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
170
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
220
Android CLI
fornewid
0
230
Building a Meta Ray-Ban display app
akkeylab
0
170
Featured
See All Featured
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
290
Scaling GitHub
holman
464
140k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
950
Building an army of robots
kneath
306
46k
What's in a price? How to price your products and services
michaelherold
247
13k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Amusing Abliteration
ianozsvald
1
260
[SF Ruby Conf 2025] Rails X
palkan
2
1.3k
Building Applications with DynamoDB
mza
96
7.2k
The Cult of Friendly URLs
andyhume
79
7k
Transcript
RESPONSIVE TYPOGRAPHY
LEGIBLE READABLE
LEGIBLE 1Il Gill Sans 1Il Helvetica 1Il Franklin Gothic
FS 1Il Source Sans Pro
READABLE Schriftgröße Zeilenlänge Zeilenabstand 16px 1em 65 Zeichen/Zeile 1.5
body { font-size: 1rem } h1 { font-size: 1.625rem }
h2 { font-size: 1.375rem }
body { font-size: 1rem } h1 { font-size: 1.625rem }
h2 { font-size: 1.375rem } @media (min-width: 22.5em) { body { font-size: 1.125rem } } @media (min-width: 45em) { body { font-size: 1.25rem } }
body { font-size: 1rem } h1 { font-size: 1.625rem }
h2 { font-size: 1.375rem } @media (min-width: 22.5em) { body { font-size: 1.125rem } h1 { font-size: 1.778rem } h2 { font-size: 1.333rem } } @media (min-width: 45em) { body { font-size: 1.25rem } h1 { font-size: 1.8rem } h2 { font-size: 1.4rem } }
body { font-size: var(--medium) } h1 { font-size: var(--x-large) }
h2 { font-size: var(--large) } :root { --medium: 1rem; --large: 1.375rem; --x-large: 1.625rem; } @media (min-width: 22.5em) { :root { --medium: 1.125rem; --large: 1.778rem; --x-large: 1.333rem; } } @media (min-width: 45em) { :root { --medium: 1.25rem; --large: 1.8rem; --x-large: 1.43rem; } }
body { font-size: 1.25rem; font-size: var(--medium); } h1 { font-size:
1.8rem; font-size: var(--x-large); } h2 { font-size: 1.4rem; font-size: var(--large); } :root { --medium: 1rem; --large: 1.375rem; --x-large: 1.625rem; } @media (min-width: 22.5em) { :root { --medium: 1.125rem; --large: 1.778rem; --x-large: 1.333rem; } } @media (min-width: 45em) { :root { --medium: 1.25rem; --large: 1.8rem; --x-large: 1.43rem; } }
$type-config = { breakpoint: 0 font-sizes: { x-small: 12 1.3
button: 13 1 small: 14 1.3 medium: 16 1.4 large: 22 1.2 x-large: 26 1.2 } },{ breakpoint: 360 font-sizes: { x-small: 12 1.3 button: 14 1 small: 16 1.3 medium: 18 1.5 large: 24 1.2 x-large: 32 1.2 } },{ breakpoint: 720 font-sizes: { x-small: 12 1.3 button: 14 1 small: 16 1.3
$fallback-font-sizes = $type-config[2][font-sizes] $px-factor = 16 set-font-size($font-size, importance = false)
font-size: ($fallback-font-sizes[$font-size][0]/$px-factor)rem (importance is important ? !important :) font-size: s('var(--font-size-%s, %s)', $font-size, ($fallback-font-sizes[$font-size][0]/ $px-factor)rem) (importance is important ? !important :) set-line-height($font-size, importance = false) line-height: $fallback-font-sizes[$font-size][1] (importance is important ? !important :) line-height: s('var(--line-height-%s, %s)', $font-size, $fallback-font-sizes[$font-size][1]) (importance is important ? !important :) set-font-size-line-height($font-size, importance = false) set-font-size($font-size, importance) set-line-height($font-size, importance) :root for $screen-size in $type-config @media (min-width: ($screen-size[breakpoint]/$px-factor)em) for $key, $value in $screen-size[font-sizes] --font-size-{$key}: ($value[0]/$px-factor)rem --line-height-{$key}: $value[1]
body set-font-size-line-height(medium) h1 set-font-size-line-height(x-large) h2 set-font-size-line-height(large)
FLUID TYPOGRAPHY
calc((18 - 16)/640 * 100vw + (16 - (18 -
16)/2) * 1rem/16) f(x) = m x + n f(x) = m (x − 320) + 16 m = = = Δy Δx 18 − 16 960 − 320 18 − 16 640 18 − 16 640 f(x) = (x − 320) + 16 18 − 16 640 18 − 16 2 = x + 16 − Schriftgröße: 16px bei 320px Breite, 18px bei 960px Breite
body { font-size: calc((18 - 16)/640 * 100vw + (16
- (18 - 16)/2) * 1rem/16); } Überschrift: 26px bei 320px Breite, 36px bei 960px Breite h1 { font-size: calc((36 - 26)/640 * 100vw + (26 - (36 - 26)/2) * 1rem/16); } Schriftgröße: 16px bei 320px Breite, 18px bei 960px Breite
body { --font-size-320: 16; --font-size-960: 18; } h1 { --font-size-320:
26; --font-size-960: 36; } body, h1 { font-size: calc((var(--font-size-960) - var(--font-size-320))/640 * 100vw + (var(--font-size-320) - (var(--font-size-960) - var(--font-size-320))/2) * 1rem/16); }