我已购买完整的Glyphicons PRO套餐,并希望将其与Bootstrap 3一起使用。然而,我似乎找不到关于如何实现此操作的全面文档。Glyphicons网站缺少“如何使用”部分,附带的PDF也没有什么帮助-它提到了一个不在下载包中的glyphicons.css文件...非常感谢任何有关如何进行替换的帮助。
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文件夹中有一个字体文件夹(大多在CSS文件夹中),其中包含了Glyphicons字体。
这些需要用您拥有的专业版进行替换。
接下来,如果字体名称不同,则需要在Bootstrap CSS中指向新的字体。这取决于您使用的技术。
但是您必须搜索:
@font-face {
font-family: 'Glyphicons Halflings';
src: url('fonts/bootstrap/glyphicons-halflings-regular.eot');
src: url('fonts/bootstrap/glyphicons-halflings-regular.eot?#iefix') format("embedded-opentype"), url('fonts/bootstrap/glyphicons-halflings-regular.woff') format("woff"), url('fonts/bootstrap/glyphicons-halflings-regular.ttf') format("truetype"), url('fonts/bootstrap/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format("svg");
}
并替换字体文件的名称(或者如果您将它们放在另一个位置,则可能是位置)
glyphicon-trash
应该是glyphicons-bin
,glyphicon-stats
完全缺失,glyphicon-comment
应该是glyphicon-comments
。可能还有其他的。 - norekhov