-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Dart Sass v1.80.1 deprecation warning #12961
Comments
This test fails with Dart Sass v1.80.1. // Issue #12961
func TestDartSassVars(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
disableKinds = ['page','section','rss','sitemap','taxonomy','term']
-- layouts/index.html --
{{ $opts := dict "transpiler" "dartsass" "outputStyle" "compressed" "vars" (dict "color" "red") }}
{{ with resources.Get "main.scss" | css.Sass $opts }}
{{ .Content }}
{{ end }}
-- assets/main.scss --
@use "hugo:vars" as v;
body {color: v.$color;}
`
b := hugolib.Test(t, files, hugolib.TestOptWarn())
b.AssertFileContent("public/index.html", "body{color:red}")
b.AssertLogContains("! WARN Dart Sass: hugo:vars") // failing assertion
} The warning message generated by the above is:
https://sass-lang.com/blog/import-is-deprecated/#built-in-functions |
hugo/resources/resource_transformers/tocss/internal/sass/helpers.go Lines 52 to 58 in e971b7d
This solves the problem when using the Dart Sass transpiler: varsSlice = append(varsSlice, fmt.Sprintf("%s%s: string.unquote(%q);", prefix, k, v))
}
}
}
sort.Strings(varsSlice)
varsStylesheet = `@use "sass:string";` + "\n" + strings.Join(varsSlice, "\n")
return varsStylesheet
} But the containing function ( |
I guess adding some kind of identifier as the first arg to CreateVarsStyleSheet would solve it. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Testing Dart Sass v1.80.1
Why we're getting this is unclear at the moment.
The text was updated successfully, but these errors were encountered: