Where does the sass “font-url” method get defined?

不问归期 提交于 2019-12-04 02:14:48

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!