我正在做一个使用 Polymer 的元素.我不清楚的一个组成部分是如何使用 style mixins .例如,我有这样的东西:
<html>
<head>
<script src="bower/webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="bower/polymer/polymer.html">
<link rel="import" href="bower/paper-styles/paper-styles.html">
</head>
<body unresolved class="fullbleed">
<template is="dom-bind" id="app">
<paper-material>
<paper-item>
<span class="paper-font-title">Welcome</span>
<span class="flex"></span>
<div class="secondary">
Today Is: <span>[[ date ]]</span>
</div>
</paper-item>
</paper-material>
</template>
</body>
</html>
基本上,我正在尝试使用 paper-font-title 和辅助 typography styles .但出于某种原因,它就像没有加载样式一样。我查看了控制台,但没有收到任何 404。出于这个原因,我假设正在加载纸张样式。为什么我不能使用它们?
最佳答案
要使用样式混入,请添加 <style is="custom-style"></style>
到你的 body 。
作为样式标签的内容添加CSS规则,如
some-selector {
@apply(--some-mixin-name);
}
关于css - 在 Polymer 中使用 CSS Mixins,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34255250/