Using boostrap.css file in Rails production/heroku w/o LESS or SASS

前端 未结 2 1139
长发绾君心
长发绾君心 2021-01-23 16:16

I\'m trying to use the glyphicons provided by bootstrap in my rails 4.0beta1 app. Everything works fine in development, but in production nothing gets rendered, and in the herok

2条回答
  •  悲哀的现实
    2021-01-23 16:32

    Try this simple approach:

    background-image: url('gliphicons-halflings.png')
    

    EDIT: glyphicons.scc.scss.erb

    @font-face {
    font-family: 'Glyphicons';
    src: url('<%= asset_path('glyphicons-regular.eot')%>');
    src: url('<%= asset_path('glyphicons-regular.eot?#iefix')%>') format('embedded-opentype'), url('<%= asset_path('glyphicons-regular.woff')%>') format('woff'), url('<%= asset_path('glyphicons-regular.ttf')%>') format('truetype'), url('<%= asset_path('glyphicons-regular.svg#glyphicons_halflingsregular')%>') format('svg');
    font-weight: normal;
    font-style: normal;
    }
    
    [class^="glyphicons-"]:before {
    display: inline-block;
    font-family: 'Glyphicons';
    font-style: normal;
    font-weight: normal;
    text-decoration: inherit;
    *display: inline;
    *zoom: 1;
    

    }

提交回复
热议问题