Polymer 2 css mixins未生效

时间:2017-09-05 15:35:38

标签: polymer-2.x

似乎我的css mixins未按此plunker中所示应用。我可以知道为什么color: green没有被应用吗?感谢。

1 个答案:

答案 0 :(得分:1)

如果您使用CSS mixins,则需要导入CSS mixins polyfill。

<!-- import CSS mixins polyfill -->
<link rel="import" href="/bower_components/shadycss/apply-shim.html">

来源:Click here

此外,您正在使用尚未导入的custom-style。导入所需的内容,因为您不在该文件中导入polymer.html

<link rel="import" href="/bower_components/polymer/lib/elements/custom-style.html">
  

custom-style未包含在Polymer.Element中,必须导入   分别。 custom-style已包含legacy polymer.html   导入。

Working plunker.