【发布时间】:2017-11-21 21:35:08
【问题描述】:
如何将自定义字体导入 Polymer 应用或元素?
Polymer Slack Channel 上的每个 @tweightman:
<link rel="import" href="/bower_components/polymer/polymer-element.html">
<link rel="import" href="/bower_components/my-typography/my-typography.html">
<dom-module id="my-page-styles">
<template>
<style include="my-typography">
:host {
@apply --my-custom-font-mixin;
}
</style>
</template>
</dom-module>
偶然发现了一个可能的解决方案:我似乎不得不在 my-typography.html 样式模块中使用
@font-face规则,而不是使用<link rel="stylesheet" href="my-font-face.css">。
【问题讨论】:
-
我正在尝试找到正确的实现来将新字体添加到聚合物应用程序并用作默认字体。你能详细说明一下你可能的解决方案吗? my-typography.html 里面有什么?
-
@d.mares:我还没有解决方案。 But here is a public version of a relative of the referenced file。如果您想出答案,请添加答案。即使它至少不起作用,它也可能有助于产生一些想法。 github.com/PolymerElements/paper-styles/blob/master/…
标签: css polymer polymer-2.x