使用font-roboto-local

2016-11-14  本文已影响0人  butterandfly

font-roboto的问题

font-roboto是一个字体组件,引入后能使用google的roboto字体。因为被"paper-styles"使用,所以基本上会被大多数的Paper元素依赖。
但是,font-roboto使用了一个在线的(fonts.googleapis.com)字体文件。这样会导致:

所以,我一般会使用font-roboto-local来代替。

使用font-roboto-local

首先,删去已经在bower_components里存在的font-roboto。
然后,修改bower.json,在dependencies下添加:

    "font-roboto": "PolymerElements/font-roboto-local#1.0.0"

单这个还不够,还要修改resolutions:

  "resolutions": {
    "font-roboto": "1.0.0"
  }

重新执行bower install,就可以了。

上一篇下一篇

猜你喜欢

热点阅读