oddbird / accoutrement

Combined Sass Accoutrement tools, with option for individual module imports
MIT License
37 stars 6 forks source link

Modules scale #92

Closed dvdherron closed 2 years ago

dvdherron commented 2 years ago

Description

Upgrade the Scale module to use Sass modules

dvdherron commented 2 years ago

I want Accoutrement on Sass Modules

dvdherron commented 2 years ago

no rush @mirisuzanne @stacyk but I'm stuck trying to figure out an issue with a value returning null from the size function in ./sass/scale/size

If you try to run the second test in ./test/scale/size ("Get size from unit adjustment"), it errors with this message:

Error: $number: null is not a number.
    ╷
120 │   $from-unit: math.unit($length);
    │               ^^^^^^^^^^^^^^^^^^
    ╵
  sass/scale/_units.scss 120:15                          convert-units()
  sass/tokens/_parse.scss 185:13                         do()
  sass/tokens/_parse.scss 334:15                         compile-token()
  sass/tokens/_api.scss 295:16                           get()
  sass/scale/_size.scss 46:10                            size()
  test/scale/_size.scss 21:29                            @content
  node_modules/sass-true/sass/test/_test.scss 50:5       @content
  node_modules/sass-true/sass/test/_test.scss 24:3       test()
  node_modules/sass-true/sass/test/_test.scss 49:3       it()
  test/scale/_size.scss 20:5                             @content

The $length value comes from the size function (called from the convert-units function, line #119 in sass/scale/units)

If I check what $length is just before line #119 with @debug $length, I get 20px. If I make the same @debug statement immediately after line #119, I get null.

Any idea what could be the cause of this?