3

Never heard of clamp(), a css thing for responsive sizing based on min max values. I shall certainly be investigating this on my next project. I ca’t be the only one who has never used this can I?
Plus is supported on all modern browsers!

https://developer.mozilla.org/en-US...

Comments
  • 2
    Summoning the CSS guru @kiki
  • 0
    you can learn a new thing almost every day here. thanks 4 sharing =]
  • 3
    Clamp is part of most standard libraries of any language, not just CSS.
  • 1
    @Lensflare the more you know...
  • 0
    I had mixed experience with it an year or so ago when I first saw it at work-code. I thought it'd be amazing to use for auto-resizing cards until a certain width and then increasing row-count, but it always ended up iffy. Then again I suck at CSS xD If your exp is good lemme know, I'll take another look too
  • 3
    yeah, I use it.

    If you don't use viewport-relative units like vh and vw, you don't need it. If you do, using them together with clamp is a perfect solution to make a heading that occupies exactly one line and spans left to right no matter what. Akin to a newspaper main headline. This is how I use it primarily.

    Though it will heavily depend on the typeface you choose. Fonts might not load. Custom fonts are outright disabled in iOS lockdown mode. So, if you want to make a headline like this, choose a web-safe typeface like Arial or Verdana.
  • 0
    @kiki what do you mean by custom fonts being disabled in IOS? All google fonts work in iOS?
  • 0
    @helloworld only in lockdown mode
Add Comment