Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@use "sass:color" error #253

Closed
dilotec-2015 opened this issue Nov 5, 2020 · 6 comments
Closed

@use "sass:color" error #253

dilotec-2015 opened this issue Nov 5, 2020 · 6 comments

Comments

@dilotec-2015
Copy link

dilotec-2015 commented Nov 5, 2020

hallo,

i want to use the color module of sass.
https://sass-lang.com/documentation/modules/color
So i do it like this:

@use "sass:color";

and then:

color.scale(#DDD, $lightness: -10%);

but i get following error:

PHP Fatal error:  Uncaught exception 'ScssPhp\ScssPhp\Exception\ParserException' with message 'parse error: failed at `background-color: color.scale($bg-color, $lightness: -$hover-val);
#0 D:\.......\scssphp\src\Parser.php(196): ScssPhp\ScssPhp\Parser->throwParseError()
#1 D:\.......\scssphp\src\Compiler.php(4338): ScssPhp\ScssPhp\Parser->parse('\r\n@use "sass:color')

what i'm doing wrong?

@Cerdic
Copy link
Collaborator

Cerdic commented Nov 5, 2020

sass modules are not supported (yet?) by scssphp see #55

@Cerdic Cerdic closed this as completed Nov 5, 2020
@stof
Copy link
Member

stof commented Nov 5, 2020

use the global function instead (scale-color(#DDD, $lightness: -10%))

@stof
Copy link
Member

stof commented Nov 5, 2020

but i get following error:

your report here shows the stack trace, but does not show the error message (which probably came above that)

@dilotec-2015
Copy link
Author

dilotec-2015 commented Nov 5, 2020 via email

@stof
Copy link
Member

stof commented Nov 5, 2020

hmm we might want to improve the error by failing early on @use

@stof
Copy link
Member

stof commented Nov 7, 2020

That's weird to me. I get the parse error on @use "sass:color"; already.

I tried with this input:

@use "sass:color";

a {
  background-color: color.scale(#DDD, $lightness: -10%);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants