From cc3598c8a8c4a85d3a619d27267ff1f3679df40a Mon Sep 17 00:00:00 2001 From: jonusgreen <86344954+jonusgreen@users.noreply.github.com> Date: Tue, 11 Mar 2025 19:10:21 +0300 Subject: [PATCH] Add: Use for Responsive Typography --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 5b6eb3e..f2c8754 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,14 @@ code { font-family: "Dank Mono", system-ui-monospace; } ``` +### Use `clamp()` for Responsive Typography + +Instead of using media queries to adjust font sizes, you can use the `clamp()` function to create fluid typography that scales smoothly between a minimum and maximum size based on the viewport width. + +```css +h1 { + font-size: clamp(1.5rem, 5vw, 3rem); +} H/T to Adam Argyle for sharing this protip and [demo](https://codepen.io/argyleink/pen/VwYJpgR).