Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use a helper function instead of a constant

In Sass helper functions, use application helper `simple_fixed_url`, instead of interpolation a constant into a string directly.
  • Loading branch information...
commit f7d6dc742d5b9630f1a926bcb143660804fbf197 1 parent 63d54dc
@alexeymuranov authored
Showing with 6 additions and 7 deletions.
  1. +6 −7 lib_for_sass.rb
View
13 lib_for_sass.rb
@@ -1,22 +1,21 @@
# encoding: UTF-8 (magic comment)
require 'sass'
+require_relative 'helpers'
-# Needed for Bourbon SCSS library to be used correctly by `scss`:
+# For Bourbon SCSS library to be used correctly by `scss`:
require ::File.join(CTT2013.settings.views, 'stylesheets/bourbon/lib/bourbon')
# Custom sass functions
#
module ::Sass::Script::Functions
def banner_url
- ::Sass::Script::String.new(
- "url('#{ CTT2013::BASE_URL }images/bannerToulouse.jpg');"
- )
+ url = CTT2013::Helpers.simple_fixed_url('/images/bannerToulouse.jpg')
+ ::Sass::Script::String.new("url('#{ url }');")
end
def footer_home_button_background_url
- ::Sass::Script::String.new(
- "url('#{ CTT2013::BASE_URL }images/capitole.jpg');"
- )
+ url = CTT2013::Helpers.simple_fixed_url('/images/capitole.jpg')
+ ::Sass::Script::String.new("url('#{ url }');")
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.