3 ms·
Why call linear interpolation a "lock"? It's amusing to see "calc" in CSS. You're only allowed the operators + - * /. No functions. Want to bet people start d
by Animats 10y ago
Why call linear interpolation a "lock"?
It's amusing to see "calc" in CSS. You're only allowed the operators + - * /. No functions. Want to bet people start demanding user-defined functions?
- prashnts 10y agoThe article essentially talks about producing something that is: font-size, line-height = function(viewport_width, max, min) in CSS. I think a closer analogy would be comparing it to timing/easing functions, rather than linear interpolation.
- majewsky 10y ago> Want to bet people start demanding user-defined functions? Doesn't Sass/SCSS already do that?
- spartanatreyu 10y agoIt does but just like css variables it'll eventually be rolled into css or inspire something else that performs a similar function that gets rolled into css. "Eventually"
- Rafert 10y agoIt refers to a waterlock, as explained in the linked Tim Brown blog post: http://blog.typekit.com/2016/08/17/flexible-typography-with-css-locks/ http://blog.typekit.com/2016/08/17/flexible-typography-with-...
- kevhito 10y agoI agree that "lock" is a really poorly chosen word here. The explanation and diagram with a canal lock on that page is... unusual. It's a cutaway diagram of a physical canal lock, re-purposed as an mathematical graph (with x as the "viewport width" independent axis, and y as the "line height" dependent axis). But then it keeps the center portion moving up and down as if it is still a canal lock, so it can't really be a mathematical function at all. The word "clamped" should have been used instead of "lock". They just want the text size to scale linearly with page width, but they want to "clamp" the text size so that it always stays within some reasonable (min, max) range. They could have also called it "piecewise linear".
- Cogito 10y agoLock makes sense to me, even if I don't think it is the best description. There are two water levels, high and low side of the lock. The lock smoothly transitions you from one level to the other. A media query without the transition would be like navigating a boat down a waterfall rather than down a lock; jarring!