Tell Sass to use CSS `max()` function

This commit is contained in:
Karina Kwiatek 2021-08-12 01:13:52 +02:00
parent 31bcc33850
commit 78d67d2f49
1 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,8 @@
padding-bottom: map-get($spacers, 3); padding-bottom: map-get($spacers, 3);
// Sass doesn't know about the safe-area-inset-* env vars and throws a syntax error // Sass doesn't know about the safe-area-inset-* env vars and throws a syntax error
// We can get around this by using unquote() // We can get around this by using unquote()
padding-left: unquote('max(15px, env(safe-area-inset-left))'); // Sass also has its own built-in max() function which is not the same as the CSS one
padding-right: unquote('max(15px, env(safe-area-inset-right))'); // In order to use the correct one we can write it as Max() instead
padding-left: unquote('Max(15px, env(safe-area-inset-left))');
padding-right: unquote('Max(15px, env(safe-area-inset-right))');
} }