glenn2223/vscode-live-sass-compiler

Compilation Error Error: 2 arguments required, but only 1 was passed.

selyounsi opened this issue · 3 comments

ERROR:
Compilation Error Error: 2 arguments required, but only 1 was passed.

What should be the error here, otherwise this also worked in the past ?

// * Converts a pixel value to rem, relative to the body font size (or any other value).
// *
// * Usage:
// * font-size:rem(12px) (if based on body font size)
// * font-size:rem(12px, 18px) (if based on a parent with a relativ font size of 18px)
// *
// * @param  {string} $to-size   Target pixel value
// * @param  {string} $from-size: $base-font-size (optional) Font size of the parent
// * @return {string}           Calculated rem value
@function rem($to-size, $from-size: $base-font-size) {
  @if $to-size == 0px { @return 0 }
  @return $to-size / $from-size * 1rem;
}

max-width: rem($rowMaxWidth);

SASS made change in v1.65 to allow new, currently experimental, functions to be parsed as valid CSS. Segment copied below, for reference

1.65.0

  • All functions defined in CSS Values and Units 4 are now parsed as calculation
    objects: round(), mod(), rem(), sin(), cos(), tan(), asin(), acos(), atan(), atan2(), pow(), sqrt(), hypot(), log(), exp(), abs(), and sign().

  • Deprecate explicitly passing......

As you can see rem() is one of these. It's a function that gives you the remainder of two divisible numbers.

You will need to rename your function to something else, maybe asRem(), to remove the error

Hope this helps 😁

UPDATE: SASS released v1.65 which rolled back support for CSS Units and Values 4 as it caused an unintentional breaking change (as was the case with this issue). The extension was patched in v6.1.1 to reflect this. Support will be coming back but not before proper deprecation warning have been in place for at least 3 months


Closing as fixed in V6.1.1

Hey, many thanks for your quick reply, I set the extension to the penultimate version on the same day so that I could continue working quickly. I had also looked into it shortly after and read that it was the latest version of SASS itself, but it sounds like good news!