当前位置: 首页 > 文档资料 > Stylus 中文文档 >

自定义字体(@font-face)

优质
小牛编辑
136浏览
2023-12-01

@font-face跟其在CSS中作用表现一样,在后面简单地添加个块状属性即可,类似下面:

@font-face
  font-family Geo
  font-style normal
  src url(fonts/geo_sans_light/GensansLight.ttf)

.ingeo
  font-family Geo

生成为:

@font-face {
  font-family: Geo;
  font-style: normal;
  src: url("fonts/geo_sans_light/GensansLight.ttf");
}
.ingeo {
  font-family: Geo;
}