Skip to content

Commit

Permalink
feat: ✨ add fallback font
Browse files Browse the repository at this point in the history
  • Loading branch information
DerZade committed May 2, 2024
1 parent b478f66 commit cc9c878
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ This package also includes a SCSS file which allows some configuration and can b
$base-path: '@arma-events/icon-font/dist',
// set $class to '' to disable a generation of the css class selector
$class: 'arma-eventicons',
$font-family: 'arma.events Icon Font'
$font-family: 'arma.events Icon Font',
$font-family-fallback: 'arma.events Icon Font Fallback' !default
);

// use the styles-mixin to include the relevant
Expand Down
12 changes: 12 additions & 0 deletions index.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
$base-path: '@arma-events/icon-font/dist' !default;
$class: 'arma-eventicons' !default;
$font-family: 'arma.events Icon Font' !default;
$font-family-fallback: 'arma.events Icon Font Fallback' !default;

// this fallback font is to make sure icons are invisible (size = 0%)
// while the webfont is still loading, to make sure the text is not visible
@font-face {
font-family: $font-family-fallback;
src: local('Arial');
size-adjust: 0%;
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: $font-family;
src: url('#{$base-path}/icon-font.woff2') format('woff2'), url('#{$base-path}/icon-font.woff') format('woff');
font-weight: normal;
font-style: normal;
font-display: swap;
}

@mixin styles() {
Expand Down

0 comments on commit cc9c878

Please sign in to comment.