Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-07-31 17:53:03 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-07-31 17:53:03 +0300
commit88e447c449608523d87c517396bde31a62f392b6 (patch)
treeb336b9eceaacddfc35e35449802453211b5f0836 /hugolib
parentb718d743b7a2eff3bea74ced57147825294a629f (diff)
tocss/scss: Improve _ prefix handling in SCSS imports
See #5008
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/resource_chain_test.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/hugolib/resource_chain_test.go b/hugolib/resource_chain_test.go
index 3d13d3912..3e199d318 100644
--- a/hugolib/resource_chain_test.go
+++ b/hugolib/resource_chain_test.go
@@ -114,7 +114,7 @@ func TestSCSSWithThemeOverrides(t *testing.T) {
b.WithSourceFile(filepath.Join(scssThemeDir, "components", "_imports.scss"), `
@import "moo";
-
+@import "_boo";
`)
b.WithSourceFile(filepath.Join(scssThemeDir, "components", "_moo.scss"), `
@@ -125,6 +125,14 @@ moo {
}
`)
+ b.WithSourceFile(filepath.Join(scssThemeDir, "components", "_boo.scss"), `
+$boolor: orange;
+
+boo {
+ color: $boolor;
+}
+`)
+
b.WithSourceFile(filepath.Join(scssThemeDir, "main.scss"), `
@import "components/imports";
@@ -138,6 +146,14 @@ moo {
}
`)
+ b.WithSourceFile(filepath.Join(scssDir, "components", "_boo.scss"), `
+$boolor: green;
+
+boo {
+ color: $boolor;
+}
+`)
+
b.WithTemplatesAdded("index.html", `
{{ $cssOpts := (dict "includePaths" (slice "node_modules/foo" ) ) }}
{{ $r := resources.Get "scss/main.scss" | toCSS $cssOpts | minify }}
@@ -145,7 +161,7 @@ T1: {{ $r.Content }}
`)
b.Build(BuildCfg{})
- b.AssertFileContent(filepath.Join(workDir, "public/index.html"), `T1: moo{color:#ccc}`)
+ b.AssertFileContent(filepath.Join(workDir, "public/index.html"), `T1: moo{color:#ccc}boo{color:green}`)
}