mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 04:52:45 +08:00
FIX: missing image-url helper
This commit is contained in:
parent
ee3d4f2a27
commit
ba9339b8d7
|
@ -1,7 +1,10 @@
|
|||
module Stylesheet
|
||||
module ScssFunctions
|
||||
def asset_url(path)
|
||||
SassC::Script::String.new("url('#{ActionController::Base.helpers.asset_path(path.value)}')")
|
||||
SassC::Script::String.new("url('#{ActionController::Base.helpers.asset_url(path.value)}')")
|
||||
end
|
||||
def image_url(path)
|
||||
SassC::Script::String.new("url('#{ActionController::Base.helpers.image_url(path.value)}')")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -16,6 +16,13 @@ describe Stylesheet::Compiler do
|
|||
expect(css).to include("url('/foo.png')")
|
||||
expect(css).not_to include('asset-url')
|
||||
end
|
||||
|
||||
it "supports image-url" do
|
||||
css,_map = Stylesheet::Compiler.compile(".body{background-image: image-url('foo.png');}","test.scss")
|
||||
|
||||
expect(css).to include("url('/images/foo.png')")
|
||||
expect(css).not_to include('image-url')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user