Icons
#
Icon fontIcons on the website use a custom icon set which are managed through IcoMoon. This tool makes changes to the icon set easy.
#
Modifying the icon set- Open the IcoMoon app
- Import the IcoMoon data file located in
src/Fonts/klemich-iconfont/selection.json
. - Makes changes as required
- Generator and download the font as a zip
- Unzip the required contents of the icon font into
src/Fonts/klemich-iconfont
- Update the icon variables located in
src/Css/Base/variables.scss
, using the generated CSS styles, - Before deployment, update the cache-busting random hash on the font file imports in
src/Css/Base/fonts.scss
. This will ensure users load new versions of the icon set rather than from cache
#
Usage#
In SassYou can target a pseudo-element, which can be populated with a font icon glyph.
- Include the
iconfont-icon
Sass mixin, which provides required font styles - Using the
content
property, reference an icon font glyph from the$icons
Sass map by using the predefined get functioniconfont()
For example:
#
In HTMLMuch like other icon libraries, you can output icons using only CSS classes on HTML elements.
- Add the base CSS class
.icon
to your element. This includes the same required font styles as theiconfont-icon
Sass mixin. - Add a BEM modifier class to match the name of the desired icon, e.g.
.icon--check
.
For example:
This will output the icon as a CSS pseudo element on the :before
selector. If you require to channel into the :after
selector, you can swap out the .icon
class for .icon-after
.
See the Sass @each
loop in src/Css/Base/fonts.scss
for a better understanding how this works.