3 ms·
With that said, they lose the plot a bit when the iPhone X's safe area adds unnecessary padding outside of the notch, and then double down on that mistake when
by alwillis 9y ago
With that said, they lose the plot a bit when the iPhone X's safe area adds unnecessary padding outside of the notch, and then double down on that mistake when they talk about their brand new `min()` and `max()` functions.
These functions aren’t Apple’s and they're not new.
There was a proposal a year ago to add them back to CSS, which means they were existed in some W3C or WHATWG specification proposal before that: https://github.com/w3c/csswg-drafts/issues/544 https://github.com/w3c/csswg-drafts/issues/544
The link in the article will take you to the current specification: https://drafts.csswg.org/css-values/#calc-notation https://drafts.csswg.org/css-values/#calc-notation
- om2 9y agomin() and max() are actually super useful beyond handling the iPhone X safe areas, here's a Tweet with some examples of other ways to use it: https://twitter.com/iamvdo/status/910074435159420928 https://twitter.com/iamvdo/status/910074435159420928 In brief, it lets you replace the "CSS locks" pattern which is a super awkward way to apply clamping to a flexible size. min()/max() makes it much easier.