Problem/Motivation

Sass is throwing an error when using rem():

[23:02:19] Starting 'sass'...
sass/abstracts/variables/_units.scss
Error: 2 arguments required, but only 1 was passed.
   ╷
11 │ $page-margin: rem(20);
   │               ^^^^^^^
   ╵
  sass/abstracts/variables/_units.scss 11:15  @import
  sass/custom.scss 14:9                       root stylesheet

Steps to reproduce

Run `gulp sass`

CommentFileSizeAuthor
#6 3381323-6.patch892 bytesdineshkumarbollu
#4 3381323-3.patch478 bytesdineshkumarbollu

Comments

JonesUI created an issue. See original summary.

jonesui’s picture

I came across this relevant post on StackOverflow...
https://stackoverflow.com/a/76878307

The CSS rem() function required 2 parameters: https://developer.mozilla.org/en-US/docs/Web/CSS/rem

The rem() CSS function returns a remainder left over when the first parameter is divided by the second parameter, similar to the JavaScript remainder operator (%)

If you created a custom rem() function, I suggest naming it something else as there could be a conflict.

jonesui’s picture

I changed the name of the function from rem() to rem-calc() and replaced the instances where it is used.
This cleared up my errors.

dineshkumarbollu’s picture

StatusFileSize
new478 bytes

provided patch according to comment#3,please review.

jonesui’s picture

@dineshkumarbollu
Your patch also needs to change the name of the actual function in sass/abstracts/_functions.scss to rem-calc()

dineshkumarbollu’s picture

StatusFileSize
new892 bytes

@JonesUI
Thanks for review, I am providing new patch please review.