Skip to content

Instantly share code, notes, and snippets.

@nocodesupplyco
Created December 16, 2022 18:39
Show Gist options
  • Save nocodesupplyco/46206bcdf0954a68544c91e2c1fb8056 to your computer and use it in GitHub Desktop.
Save nocodesupplyco/46206bcdf0954a68544c91e2c1fb8056 to your computer and use it in GitHub Desktop.
CSS Clamp
/* Static values */
font-size: clamp(1rem, 2.5vw, 2rem);
width: clamp(20rem, 30vw, 70rem);
/* Calculated values */
width: clamp(100px, calc(30% / 2rem + 10px), 900px);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment