Dav*_*ith 13 css polymer polymer-1.0
Polymer 1.0元素包含自定义CSS变量,允许您使用内联样式对它们进行样式设置:
<style is="custom-style">
paper-toolbar {
--paper-toolbar-color: blue;
}
</style>
Run Code Online (Sandbox Code Playgroud)
这很有效,也很棒.我怎样才能做到这一点,但使用外部样式表?添加is="custom-style"
到链接标记似乎没有任何影响,因为以下不起作用:
<link rel="stylesheet" media="all" href="app.css" is="custom-style">
Run Code Online (Sandbox Code Playgroud)
Ben*_*mas 12
您可以custom-style
使用聚合物元素加载包含您喜欢的HTML文件:
<link rel="import" href="my-custom-style.html">
Run Code Online (Sandbox Code Playgroud)
你的my-custom-style.html
文件将包含:
<style is="custom-style">
paper-toolbar {
--paper-toolbar-color: blue;
}
</style>
Run Code Online (Sandbox Code Playgroud)
从Polymer 1.1开始,此功能现已弃用.请参阅此处获取更新答案
归档时间: |
|
查看次数: |
8091 次 |
最近记录: |