Back

Rails3/4中使用 bootstrap3 的图标(display bootstrap3 plyphicons in Rails3/4)

发布时间: 2014-01-31 01:20:00

refer to: http://www.erikminkel.com/2013/09/01/twitter-bootstrap-3-in-a-rails-4-application/

bootstrap3 中的图标独立出去了,而且不再是png,而是 fonts. 所以,我们要特殊处理一下。 (the plyphicon is extacted from bootstrap3 as kinda of FONT, so we have to modify the bootstrap css file )

1. copy fonts folder from bootstrap3 to your rails app.
2. modify the bootstrap.css:  (notice, url is: /assets, but not /assets/fonts ) 
@font-face {
  font-family: 'Glyphicons Halflings';
  src: url('/assets/glyphicons-halflings-regular.eot');
  src: url('/assets/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('/assets/glyphicons-halflings-regular.woff') format('woff'), url('/assets/glyphicons-halflings-regular.ttf') format('truetype'), url('/assets/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); 
}

Back