Skip to content

SCSS - how to insert ruby variable? #733

Description

@gapipro

I am trying to inject ruby variable into sass but I can't find any help on how to do it.

If I use CSS engine then it can be done like so:

  css:
    .remodal-overlay:after {
      background-image: url(#{variables['palette-background-color']});
    }

But when I try to do same thing with SCSS I get error:

Invalid CSS after "...r : #{variables": expected "}", was "["palette-backg..."

And here is my scss:

  scss:

    $color : #{variables["palette-background-color"]};

    .remodal-overlay:after {
      background-image:$color;
    }

Should I set local variables in ruby before using them in scss?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions