Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add nested hugo:vars support #14705

@bep

Description

@bep

Relates to #14699.

@import "hugo:vars";
@import "hugo:vars/mobile" (max-width: 650px);

And then:

{{ with resources.Get "sass/main.css" }}
  {{ $opts := dict
    "vars" (dict 
         "primary-color" "blue"
          "mobile" (dict "somemobilevar" "foo)
     ))
  }}
  {{ with . | css.Build $opts }}
      <link rel="stylesheet" href="{{ .RelPermalink }}">
  {{ end }}
{{ end }}
  • The above should be trivial to implement for css.Build
  • I'm not sure about css.Sass (or: it would be trivial to implement, but I'm not sure Dart Sass' import supports the relevant syntax), but we should try to make this work for both css.Build and css.Sass (but we don't spend time on the libsass transpiler, which is deprecated).

Relevant documentation:

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions