Skip to content

'null' not getting interpolated as empty string #33

@squarestar

Description

@squarestar

In this mixin:

@mixin Rounded($radius1, $direction: null, $radius2: false) {
    $corner: null;
    @if $direction == TL { $corner: top-left-; }
    @if $direction == TR { $corner: top-right-; }
    @if $direction == BL { $corner: bottom-left-; }
    @if $direction == BR { $corner: bottom-right-; }
    @if $radius2 {
        -webkit-border-#{$corner}radius: $radius1 $radius2;
                border-#{$corner}radius: $radius1 $radius2;
    } @else {
        -webkit-border-#{$corner}radius: $radius1;
                border-#{$corner}radius: $radius1;
    }
}

The value of $corner is written as 'null' instead of an empty string, as indicated by the manual:

Null values are treated as empty strings for string interpolation:
$value: null;
p:before {
content: "I ate #{$value} pies!";
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions