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) .

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions