Using fonts with Rails asset pipeline

前端 未结 12 1828
慢半拍i
慢半拍i 2020-11-22 14:52

I have some fonts being configured in my Scss file like so:

@font-face {
  font-family: \'Icomoon\';
  src: asset-url(\'icoMoon.eot?#iefix\', font) format(\'         


        
12条回答
  •  爱一瞬间的悲伤
    2020-11-22 15:20

    If you don't want to keep track of moving your fonts around:

    # Adding Webfonts to the Asset Pipeline
    config.assets.precompile << Proc.new { |path|
      if path =~ /\.(eot|svg|ttf|woff)\z/
        true
      end
    }
    

提交回复
热议问题