Starting a new project, it was decided to use bootstrap 4 alfa. The code that was used by bootstrap 3 was dragged into the project, and all gliphicon were no longer displayed. How to solve the problem so that the bootstrap 4 displays icons from bootstrap3?
1 answer
- Download bootstrap 3 from the official repository.
- Go to the
distfolder and copy thefontsfolder to your project root or wherever you want. - Go to the
lessfolder and locate theglyphicons.lessfileglyphicons.less - Since I use
sassI created the_fonts.scssfile and wrote into it
The following code:
@font-face { font-family: 'Glyphicons Halflings'; src: url('../fonts/glyphicons-halflings-regular.eot'); src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); } after that, I inserted the contents of the glyphicons.less file, removing the font connection from it — this is the piece of code:
@font-face { font-family: 'Glyphicons Halflings'; src: url('@{icon-font-path}@{icon-font-name}.eot'); src: url('@{icon-font-path}@{icon-font-name}.eot?#iefix') format('embedded-opentype'), url('@{icon-font-path}@{icon-font-name}.woff2') format('woff2'), url('@{icon-font-path}@{icon-font-name}.woff') format('woff'), url('@{icon-font-path}@{icon-font-name}.ttf') format('truetype'), url('@{icon-font-path}@{icon-font-name}.svg#@{icon-font-svg-id}') format('svg'); } left everything else as it was.
- I connected the resulting
fonts.scssfile to the assembly file, started the compilation in my case, didcompass
|
glyphiconsviay. glyphicons.com - Gleb Kemarsky