Simplified Fluid Typography

PHOTO EMBED

Thu Oct 27 2022 13:28:14 GMT+0000 (Coordinated Universal Time)

Saved by @Sebhart #typography #css #fluid

html {
  font-size: min(max(1rem, 4vw), 22px);
}

/* or */

body {
  font-size: clamp(100%, 1rem + 2vw, 24px);
}

/* with variables */

h1 {
  --minFontSize: 32px;
  --maxFontSize: 200px;
  --scaler: 10vw;
  font-size: clamp( var(--minFontSize), var(--scaler), var(--maxFontSize) );
}
content_copyCOPY

https://css-tricks.com/simplified-fluid-typography/