Where is the sass "font-url" method defined?

bourbon uses font-url here .

Rails has a font_url method, which I'm pretty sure what is being called. However, I cannot find where the connection is made between these two things. I studied the code bases of bourbon, sassi, sass flight, and rails.

Where is the font-url indicated and / or is the connection between it and the font_url rails made?

Update

Clarification: my ultimate goal is to identify my own rubyland helpers who are siblings for font_url.

+8
ruby-on-rails sass bourbon
source share
1 answer

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

When using the resource pipeline, asset paths must be rewritten, and sass-rails provides -url and -path helpers (portable to Sass, underlined in Ruby) for the following asset classes: image, font, video, audio, JavaScript, and style sheets.

So, if you use font-url("some_font") , it will look for some_font in the app / assets / font directory

Update:

As mentioned in the docs, if you use sass, then you can use your assets with bent URLs (image-url), but if you use a ruby ​​file, then those helpers would be underscored (image_url), probably because Ruby is not likes that you have methods or variables with a hyphen in the name syntactically, but semantically, there was nothing wrong

+7
source share

All Articles