Skip to content

SASS assets don't load the way Sprocket loads them #2

@zinkkrysty

Description

@zinkkrysty

I can't use rails helpers within .sass files or import external libraries that belong to a gem (e.g. Bourbon)

My .sass file looks like this:

@import 'bourbon'
@import 'variables'

.text
  color: $my_color_1
  background-color: $my_color_2
  background-image: image-url('email/email_bg_blue.jpg')
  @include inline_block

The external library is not that important (I need it because I include some mixins in my _variables.css.sass file) - this can be fixed by a refactor in my code

But the important part is being able to use Rails' asset helpers like image-url because we use cloud asset hosting and can't hard-code the path to the image background in the .sass file.

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