Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does the sass "font-url" method get defined?

bourbon uses font-url here.

Rails has the method font_url which I'm fairly certain is what is being invoked. However, I can't find where the connection between these two things is made. I have explored the codebases of bourbon, sass, sass-rais, and rails.

Where is font-url defined, and/or the connection between it and rails's font_url made?

update

Clarification: my ultimate goal is to define my own helpers in rubyland which are siblings to font_url.

like image 865
John Bachir Avatar asked Aug 23 '14 02:08

John Bachir


1 Answers

font-url is a part of rails asset pipeline just like image-url. If you look at rail guides it clearly says

When using the asset pipeline, paths to assets must be re-written and sass-rails provides -url and -path helpers (hyphenated in Sass, underscored in Ruby) for the following asset classes: image, font, video, audio, JavaScript and stylesheet.

So if you are using font-url("some_font") it will look for some_font in app/assets/font directory

Update:

As it is mentioned in docs that if you are using sass then your can use your assets with hypenated urls(image-url) but if you are using a ruby file then those helpers would be underscored (image_url) probably because Ruby doesn't like you having methods or variables with hyphens in the name syntactically, but semantically, there's nothing wrong with it

like image 60
Mandeep Avatar answered Sep 22 '22 05:09

Mandeep