没有与sass bootstrap集成显示的图标 [英] glyphicons not showing with sass bootstrap integration

查看:162
本文介绍了没有与sass bootstrap集成显示的图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用这个教程将bootstrap集成到我的项目中:

https://laravel-news.com/2015/10/setup-bootstrap-sass-with-laravel-elixir/



这将一个app.css文件放在css文件夹中。
但是,如果我尝试使用glyphicons他们不出现。
所以我试着修改这个elixir文件:

  elixir(function(mix){

mix.sass('app.scss')
.browserify('app.js')
.copy('node_modules / bootstrap-sass / assets / fonts','public / css / fonts')

});

字体文件夹复制到public / css / fonts下,但是没有图标显示。我在这里错过了什么?任何线索?

在我的app.css路径似乎是正确的,例如:

  src:url(fonts / bootstrap / glyphicons-halflings-regular.eot); 


解决方案


我所做的只是检查了浏览器中的请求路径:

  ../ build / fonts / bootstrap / glyphicons-halflings-regular.woff2 

所以我刚刚添加到gulp.js中:

  mix.copy('node_modules / bootstrap-sass / assets / fonts / bootstrap /','public / build / fonts / bootstrap') ; 

然后在终端:



<$ p $对于我来说,这已经成为了诀窍!

I used this tutorial to integrate bootstrap in my project:

https://laravel-news.com/2015/10/setup-bootstrap-sass-with-laravel-elixir/

This places an app.css file in the css folder. However if I try to use glyphicons they don't show up. So I tried to modify the elixir file like this:

    elixir(function(mix) {

    mix.sass('app.scss')
        .browserify('app.js')
        .copy('node_modules/bootstrap-sass/assets/fonts', 'public/css/fonts')   

});

The fonts folder is copied under public/css/fonts but yet no icon shows up. What am I missing here? Any clue?

in my app.css the path seems correct, for example:

src: url("fonts/bootstrap/glyphicons-halflings-regular.eot");

解决方案

I had the same problem with fresh install of laravel 5.2. What I did is just inspected the request path in browser which was :

../build/fonts/bootstrap/glyphicons-halflings-regular.woff2

so I just added to gulp.js this :

mix.copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/','public/build/fonts/bootstrap'); 

and afterwards in terminal :

gulp

That did the trick for me!

这篇关于没有与sass bootstrap集成显示的图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆