Skip to content

min/Min and max/Max: is something needed in the sass package? #92

@maelle

Description

@maelle
sass::sass("body {width: Max(100%, 20rem);}")

<style>body {
  width: Max(100%, 20rem);
}
</style>
sass::sass("body {width: max(100%, 20rem);}")
#> Error in compile_data(sass_input, options): Internal Error: Incompatible units: ' 0x0.0563a3c94b18p-1022nd 'rem'.

Created on 2021-07-13 by the reprex package (v2.0.0)

@cpsievert as an answer to r-lib/pkgdown#1682 (comment)

I think it's because libsass does not support https://sass-lang.com/documentation/syntax/special-functions#min-and-max yet? The docs state "LibSass and Ruby Sass currently always parse min() and max() as Sass functions. To create a plain CSS min() or max() call for those implementations, you can write something like unquote("min(#{$padding}, env(safe-area-inset-left))") instead."

I switched to using "Max" instead of "max" after reading https://css-tricks.com/when-sass-and-new-css-features-collide/#the-solution, and it just works and is less verbose than the solution from sass docs. 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions