小编Val*_*hez的帖子

在聚合物3中导入外部样式表

有没有办法导入只影响影子DOM的外部css文件?我正在使用sass并自动创建css文件,因此任何使用javascript导入的技巧都无法完成.

现在,我所拥有的是:

static get template() {
return html`
  <style>
  :host {
    display: block;
  }
  </style>
  ....
}
Run Code Online (Sandbox Code Playgroud)

在Polymer 2中,可以执行以下操作:

 <dom-module id="my-app">
   <link rel="stylesheet" href="style.css">
   <template></template>
 </dom-module>
Run Code Online (Sandbox Code Playgroud)

聚合物3是否有同样的方法?

polymer polymer-3.x

9
推荐指数
1
解决办法
1485
查看次数

标签 统计

polymer ×1

polymer-3.x ×1