I have a custom icon font exported from Icomoon, and I'm trying to figure out how to incorporate it into my Jekyll site (I'm a bit new to Jekyll!) I've added the directory exported from Icomoon in my assets folder, and I've included the line:
@include embed-font ("Icomoon", "../assets/fonts/font/icomoon.ttf");
in my CSS, and added in my config file:
assets:
sources:
-_assets/fonts
but I get an error message saying: "undefined mixin 'embed-font' on line 2 of my CSS.
Does anyone know the steps I can take to integrate this correctly? Or have any resources/tutorials for this?? I feel really lost.
To change the default font definition you need to reset the value of $base-font-family variable, e.g.: $base-font-family: "PT Serif", serif; You will also need to remove the ! default; suffix at the end of this setting.
Importing it into my Rails app was pretty easy. First, you create a folder called 'fonts' in your 'assets' folder. After that, you go shopping for fonts! After downloading one that catches your eye, simply drag it to your fonts folder.
Change all the url paths by prepending ../font
before the font/icomoon.*
The - * represents all extension names here.
../
fonts/icomoon.eot?fscaxe');Add the relative @import 'custom-icons'; to the main .scss file(s) to include the icons.
Instead of using @include, try @font-face instead like this:
@font-face {
font-family: "Icomoon";
src: url("../assets/fonts/font/icomoon.tff");
}
Reference: https://developer.mozilla.org/en-US/docs/Learn/CSS/Styling_text/Web_fonts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With