Font-Awesome 字体应该使用哪种通用字体族?

13

我正在一个项目中使用FontAwesome 4.7,并且我们有SonarQube集成。在我的自定义CSS文件中的一些地方,我必须手动提供字体族名称,例如:

.calendar-wrapper:after {
  font-family: 'FontAwesome';
  content: '\f073';
  position: absolute;
  right: 9px;
  top: 9px;
}

然而在这一行,SonarQube向我展示了一个缺陷:意外缺失通用字体族(规则在此)。

FontAwesome应该使用哪种通用字体族?我在互联网上搜索了很久,但仍未找到答案。


5
没有通用字体适用于此。如果你想通过测试,可以随便选择一种像衬线字体的字体。或者如果可能的话,禁用此项测试。 - ariel
2个回答

18

'FontAwesome'是一种自定义字体,因此Sonarqube要求添加通用字体以备用。 添加类似于“sans-serif”的通用字体即可。

.calendar-wrapper:after {
  font-family: 'FontAwesome', sans-serif;
  content: '\f073';
  position: absolute;
  right: 9px;
  top: 9px;
}

1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接