Helpers are not available by default for .css file templates. They are designed to help only in construction. However, you can try the workaround mentioned here with an initializer:
Rails.application.assets.context_class.instance_eval do include YourHelperModule end
Alternatively, if you only need this for one or more files, you can use the solution mentioned here by adding this code at the beginning of .css.erb:
<% environment.context_class.instance_eval { include YourHelperModule } %>
source share