Gulp-sass: not compiling css variables

Created on 9 Apr 2018  路  1Comment  路  Source: dlmanning/gulp-sass

In a solution we're using sass variables to define css variables, which in turn is places into the code using postcss.

The problem we ran into was that this example:
$primary: #f00; :root { --section-hero-intro-title-color: $primary; --section-hero-intro-background: transparent; --section-hero-intro-before-background: transparent; } .example { color: var(--section-hero-intro-title-color); }
was compiled into this:
.example { color: $primary; }
where the expected result is:
.example { color: #f00; }

what ended up fixing the issue was npm installing [email protected].

Most helpful comment

I posted the issue on the node-sass github page as well, and they provided a fix:
:root { --foo: #{$bar}; }
see it here:

>All comments

I posted the issue on the node-sass github page as well, and they provided a fix:
:root { --foo: #{$bar}; }
see it here:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lindeberg picture lindeberg  路  7Comments

demurgos picture demurgos  路  5Comments

sstikkel picture sstikkel  路  8Comments

bertez picture bertez  路  8Comments

tbolon picture tbolon  路  6Comments