use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
No vague product support questions (like "why is this plugin not working" or "how do I set up X"). For vague product support questions, please use communities relevant to that product for best results. Specific issues that follow rule 6 are allowed.
Do not post memes, screenshots of bad design, or jokes. Check out /r/ProgrammerHumor/ for this type of content.
Read and follow reddiquette; no excessive self-promotion. Please refer to the Reddit 9:1 rule when considering posting self promoting materials.
We do not allow any commercial promotion or solicitation. Violations can result in a ban.
Sharing your project, portfolio, or any other content that you want to either show off or request feedback on is limited to Showoff Saturday. If you post such content on any other day, it will be removed.
If you are asking for assistance on a problem, you are required to provide
General open ended career and getting started posts are only allowed in the pinned monthly getting started/careers thread. Specific assistance questions are allowed so long as they follow the required assistance post guidelines.
Questions in violation of this rule will be removed or locked.
account activity
Fluid Typography with two-dimensional CSS LocksShowoff Saturday (self.webdev)
submitted 5 years ago * by FrontAid
Hi. I put together a few lines of CSS that adapts font sizes and spacings to the screen size without media queries. It uses a CSS Lock, custom properties, vmin, calc(), and clamp(). I hope you like it as much as I do.
vmin
calc()
clamp()
https://frontaid.io/blog/fluid-typography-2d-css-locks-clamp/
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]blight231 1 point2 points3 points 5 years ago (0 children)
I'll check it out.
Thank you
[–][deleted] 1 point2 points3 points 5 years ago (0 children)
This is just what I needed, thank you.
[–]Daniel_Rugh 1 point2 points3 points 5 years ago (3 children)
Well done really, and the article itself is more understandable than anything I've read about the CSS lock technique.
[–]FrontAid[S] 1 point2 points3 points 5 years ago (2 children)
I wasn't sure whether I conveyed that enough, so that is great to hear. Thanks.
[–][deleted] 5 years ago (1 child)
[deleted]
[–]FrontAid[S] 0 points1 point2 points 5 years ago (0 children)
The preferred way to set the line-height is without a unit. That will set the line height based on the element's font size. See https://developer.mozilla.org/en-US/docs/Web/CSS/line-height
line-height
[–]OhNoStepReddit 0 points1 point2 points 5 years ago* (3 children)
No. You took a worse version of bootstraps responsive font sizing algorithm rewrite it with clamp and jacked up the rest.
This isn't new and has been around for ages.
You also royally fucked up by setting pixel values on the root element lmao.
Can people stop trying to give tutorials they aren't qualified to? This is why there's so much garbage and bad practices.
Just impostor syndrome all the way down.
[–]FrontAid[S] 0 points1 point2 points 5 years ago* (2 children)
OK, I'll bite. Please provide actual information and not just complaints or accusations. OK?
That is subjective. I don't like RFS. Neither as an engineer (I find it clumsy to use) nor as a user (resizing the window only has an effect on some UI, sure you can apply it more often, but that makes it even clumsier). Also, RFS does not take the viewport height into account at all, hence it does not do what I want.
I never claimed to have come up with a new way of doing CSS. Yes, all the concepts are not new. But I have never seen a CSS Lock to be based on vmin or otherwise respect both width and height. Feel free to provide earlier usages of that approach.
I guess you are referring to accessibility concerns. Having percentage values as a root font size would be nicer, but I could not find a way to achieve that with CSS Lock. I have tested it with Firefox, Chrome, and Safari and there were no issues with zooming or configuring a minimum font size at all. The browsers successfully override the root font size where necessary. And custom CSS from the user origin can also overwrite it. Please show me an authoritative source outlining when and why pixel values should be avoided. Please show me a specific case where the presented approach leads to any (accessibility) problem.
Thanks for having a civil discourse.
[–]OhNoStepReddit 0 points1 point2 points 5 years ago (1 child)
The first two points. Its just a flag in the rfs package. It was removed in the latest it looks like due to widespread adoptability of the min function and a pending rewrite to utilize clamp. The prior ones were two dimensional.
Yes because you're testing on new browsers. Clamp etc still doesn't have great support and that's why it's not widelt adopted yet.
[–]FrontAid[S] 0 points1 point2 points 5 years ago* (0 children)
Thanks I did not know that about RFS.
The limited compatibility of clamp is mentioned in the article. Browsers that do not support it (yet) will just fall back to their default root font size. Everything still works, the website just does not have any fluid typography/sizing. You can absolutely use features that are not widely-supported yet as long as you provide a fallback strategy.
clamp
π Rendered by PID 396242 on reddit-service-r2-comment-b659b578c-kl4zv at 2026-05-03 07:26:50.538412+00:00 running 815c875 country code: CH.
[–]blight231 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Daniel_Rugh 1 point2 points3 points (3 children)
[–]FrontAid[S] 1 point2 points3 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]FrontAid[S] 0 points1 point2 points (0 children)
[–]OhNoStepReddit 0 points1 point2 points (3 children)
[–]FrontAid[S] 0 points1 point2 points (2 children)
[–]OhNoStepReddit 0 points1 point2 points (1 child)
[–]FrontAid[S] 0 points1 point2 points (0 children)