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

Fails on valid SCSS #227

Open
ClayShentrup opened this issue Oct 21, 2021 · 1 comment
Open

Fails on valid SCSS #227

ClayShentrup opened this issue Oct 21, 2021 · 1 comment

Comments

@ClayShentrup
Copy link

See this error from the latest Tagify.

Error: Invalid CSS after "...    $size: math": expected expression (e.g. 1px, bold), was ".div(-$tagMargin, 2"
        on line 267:32 of node_modules/@yaireo/tagify/src/tagify.scss
        from line 23:1 of app/assets/stylesheets/application.scss
>>                     $size: math.div(-$tagMargin, 2);

yairEO/tagify#921 (comment)

Here's the offending section:

&::before{
                    $size: math.div(-$tagMargin, 2);
                    $size: -2px;
                    top:$size; right:$size; bottom:$size; left:$size;
                    box-shadow: 0 0 0 $tag-inset-shadow-size $tag-hover inset;
                    box-shadow: 0 0 0 var(--tag-inset-shadow-size, $tag-inset-shadow-size) var(--tag-hover, $tag-hover) inset;
                  //  box-shadow: 0 0 0 0 $tag-remove inset
                }

Whereas the npm sass (formerly dart-sass) package says it's valid.

@ahorek
Copy link

ahorek commented Nov 4, 2021

yes, it's a valid syntax, but libsass uses an older standard that doesn't support math functions yet https://github.com/sass/libsass

you can apply a workaround

$size: -$tagMargin / 2;

this will work, but on the other hand, I'll produce a deprecation warning on dart-sass.

I think there's nothing we can do here, we have to wait for libsass to support the new syntax, but it's unlikely to happen anytime soon.

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

2 participants