jekyll / jekyll-sass-converter

A Sass converter for Jekyll.

Home Page:http://rubygems.org/gems/jekyll-sass-converter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sass Variables do not Compile Without Interpolation Syntax

bryantwells opened this issue · comments

  • I am on (or have tested on) macOS 10+
  • I was trying to build.

My Reproduction Steps

Running jekyll serve --watch jekyll serve jekyll build etc...

Input

main.scss

@function max-size($vw) {
    @return ($vw / 100) * $max-width
}

$max-width: 1200px;
$base-font-size: 3.5vw;
$sm-font-size: 2vw;
$lg-font-size: 12.9vw;

@import 'base.scss';

base.css

:root {
    --base-font-size: $base-font-size;
    --sm-font-size: $sm-font-size;
    --lg-font-size: $lg-font-size;

    @media (min-width: $max-width) {
        --base-font-size: max-size(3.5);
        --sm-font-size: max-size(2);
        --lg-font-size: max-size(12.9);
    }
}

Output

main.css

:root {
    --base-font-size: $base-font-size;
    --sm-font-size: $sm-font-size;
    --lg-font-size: $lg-font-size;

    @media (min-width: 1200px) {
        --base-font-size: max-size(3.5);
        --sm-font-size: max-size(2);
        --lg-font-size: max-size(12.9);
    }
}

After trying to figure out what the hell was going on here for a couple hours — I found out that these stylesheets do compile correctly, if every variable instance and function reference is wrapped in a interpolation tag ( #{} ).

For reference: when using the standalone sass gem (as well as node-sass) the resulting stylesheet is compiled as expected (without interpolation tags).

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.