Ionic 3无法放置字体字体

时间:2018-12-04 14:16:24

标签: ionic3

我已经从fontastic导入了字体并将其导入到项目中

-assets / fontatic /

在主题文件夹中,我粘贴了fontastic.scss文件。其内容如下:

  @charset "UTF-8";

  @font-face {
  font-family: "fontastic-font";
  src:url("../assets/fontastic/fontastic-font.eot");
  src:url("../assets/fontastic/fontastic-font.eot?#iefix") format("embedded-opentype"),
  url("../assets/fontastic/fontastic-font.woff") format("woff"),
  url("../assets/fontastic/fontastic-font.ttf") format("truetype"),
  url("../assets/fontastic/fontastic-font.svg#fontastic-font") format("svg");
  font-weight: normal;
  font-style: normal;

}

[data-icon]:before {
font-family: "fontastic-font" !important;
content: attr(data-icon);
font-style: normal !important;
font-weight: normal !important;
font-variant: normal !important;
text-transform: none !important;
speak: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

[class^="icon-"]:before,
[class*=" icon-"]:before {
font-family: "fontastic-font" !important;
font-style: normal !important;
font-weight: normal !important;
font-variant: normal !important;
text-transform: none !important;
speak: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
 }

@mixin makeIcon($arg, $val) {
.ft-#{$arg}:before ,
.ion-ios-ft-#{$arg}:before ,
.ion-ios-ft-#{$arg}-outline:before ,
.ion-md-ft-#{$arg}:before ,
.ion-md-ft-#{$arg}-outline:before {
content: $val;
font-size: 26px;
}
}

@include makeIcon(pair-diamond, '\61');
@include makeIcon(revised-list, '\62');
@include makeIcon(new-arrival, '\63');

但是,一旦我在app.scss文件中添加其引用,离子图标就会中断。同样在variable.scss中,我从@import重命名为“ ionic.ionicons”; @import“ ionicons”;

仍然无法正常工作。

0 个答案:

没有答案