1

I'm using CodeKit to compile .scss using libsass. In these files I want to include some Liquid templating

.some-class {
    color: {{ settings.color_primary }};
}

Throws and error though. Is there a way to tell the preprocessor to let this pass through?

Thanks

Kevmon
  • 947
  • 1
  • 11
  • 25

1 Answers1

2

Use sass interpolations to insert anything literally

.some-class {
    color: #{ "{{ settings.color_primary }}" };
}

You may also use a helper function for nicer syntax

@function liquid-var($name) {
    @return #{ "{{ " + $name + " }}" };
}

.some-class {
    color: liquid-var("settings.color_primary");
}
Marcel Greter
  • 275
  • 1
  • 10