在 Bootstrap 3 中用 Glyphicons PRO 替换标准的 Glyphicons Halflings? [英] Replacing the standard Glyphicons Halflings with Glyphicons PRO in Bootstrap 3?

查看:20
本文介绍了在 Bootstrap 3 中用 Glyphicons PRO 替换标准的 Glyphicons Halflings?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经购买了完整的 Glyphicons PRO 软件包,并希望将其与 Bootstrap 3 一起使用.

I've bought the full Glyphicons PRO package and want to use it with Bootstrap 3.

但是,我似乎无法找到有关如何执行此操作的全面文档.Glyphicons 站点缺少如何使用部分",随附的 PDF 也没有太大帮助 - 它提到了一个不属于下载包的 glyphicons.css 文件...

However, I can't seem to find comprehensive documentation on how to do this. The Glyphicons site lacks a "How to use section" and an accompanying PDF isn't much help either - it was mentioning a glyphicons.css file that wasn't part of the download package...

非常感谢有关如何进行此替换的任何帮助.

推荐答案

正如在上面的一些评论中提到的,与 Glyphicons PRO 包中的引导程序免费版本相比,它们是 Glyphicons 的引导程序免费版本的不同之处.

As mentioned in some comments above, they are differences in the bootstrap FREE version of Glyphicons compared to the one from the Glyphicons PRO package.

回顾一下,这里是主要区别:

As a recap, here as the main differences:

  • [区别]:[Bootstrap's Glyphicons FREE] VS [Glyphicons PRO]
  • 图标字体名称 : "glyphicons-halflings-regular" VS "glyphicons-regular"
  • css 类名 : "glyphicon" , "glyphicon-"* VS "glyphicons" , "glyphicons-"*
  • 字体系列:Glyphicons Halflings" VS Glyphicons Regular"
  • [difference] : [Bootstrap's Glyphicons FREE] VS [Glyphicons PRO]
  • icon font name : "glyphicons-halflings-regular" VS "glyphicons-regular"
  • css class names : "glyphicon" , "glyphicon-"* VS "glyphicons" , "glyphicons-"*
  • font family : "Glyphicons Halflings" VS "Glyphicons Regular"

鉴于 Bootstrap 的 Glyphicons 是 Glypicons PRO 的子集,您不应该同时使用两者,而是替换 vanilla Bootstrap 的 glyphicons.less 文件(在 Bootstrap 的less"文件夹中)来自 PRO 包中的一个.

Given that Bootstrap's Glyphicons is a subset of Glypicons PRO, you shouldn't use both, but instead replace the vanilla Bootstrap's glyphicons.less file (in the Bootstrap "less" folder) by the one from the PRO package.

如果您使用 js 构建工具,例如 Bower &Grunt,您可以让 grunt-contrib-copy 任务为您自动化:

If you are using js build tools like Bower & Grunt, you can have the grunt-contrib-copy task to automate that for you:

copy: {
server: {               
    files: [{//replace the vanilla Bootstrap's FREE glyphicons.less by the PRO's version
        expand: true,
        dot: true,
        cwd: 'path/to/your/less', //put glyphicons.less (PRO version) here                  
        dest:'path/to/bower_components/bootstrap/less',
        src: 'glyphicons.less'
    }]
}

}

这个任务可以注册在:

 grunt.registerTask('serve', [
    'copy:server', //replace the vanilla bootstrap's glyphicons
     // your other tasks here, for eg: 
     // 'less:server', // to compile the less

    ]);

并将继续运行:

grunt serve

这篇关于在 Bootstrap 3 中用 Glyphicons PRO 替换标准的 Glyphicons Halflings?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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