@@Julian
h1 { font-size: clamp(2rem, 5vw, 4rem); }und gerade jetzt:
h1 { font-size: 5vw; /* Schriftgröße passt sich der Breite des Fensters an */ }Was ist sinnvoller?
Das Erste – mit clamp().
Es ist auch nicht schwer, sinnvoller als das Zweite zu sein, da dessen Sinnhaftigkeit nahe 0 ist: Man hat keine Möglichkeit, mit [⌘][+] / [⌘][−] die Schriftgröße zu ändern. (Und das liegt nicht an der fehlenden [⌘]-Taste; auf solchen Systemen nimmt man halt das Äquivalent.)
Die Schriftgröße darf einen bestimmten festen(!) Wert nicht unterschreiten. Auch die Beschränkung nach oben bietet sich an.
Meist wird man die Schriftgröße auch nicht proportional zur Viewportgröße wachsen lassen wollen, sondern langsamer: sowas wie clamp(2rem, 1rem + 3vw, 4rem).
🖖 Live long and prosper
--
“In my home, the America I love, the America I've written about, that has been a beacon of hope and liberty for 250 years, is currently in the hands of a corrupt, incompetent and treasonous administration. Tonight, we ask all who believe in democracy and the best of our American spirit, to rise with us, raise your voices against authoritarianism, and let freedom reign.”
— Bruce Springsteen, Manchester 2025-05-14
“In my home, the America I love, the America I've written about, that has been a beacon of hope and liberty for 250 years, is currently in the hands of a corrupt, incompetent and treasonous administration. Tonight, we ask all who believe in democracy and the best of our American spirit, to rise with us, raise your voices against authoritarianism, and let freedom reign.”
— Bruce Springsteen, Manchester 2025-05-14