css – Polymer 1.0 app-theme仅影响index.html,而不影响自定义元素

栏目: CSS · 发布时间: 5年前

内容简介:翻译自:https://stackoverflow.com/questions/30900593/polymer-1-0-app-theme-only-affecting-index-html-and-not-on-custom-elements
我正在使用Polymer Starter Kit,我想将脚手架移动到它自己的元素<main-scaffold>中. app-theme.html中有一些样式应用于它之前我将它从index.html移入它自己的元素,但现在没有任何样式适用.对于我放入自己的自定义元素的任何元素集都是这种情况.应用于<paper-material>的自定义样式来自app-theme.html的内容未在我的<

home-page>中应用元件.我希望某些元素在全局范围内应用主题. app-theme.html中唯一适用于其他任何地方的样式是CSS自定义属性,例如–dark-primary-color.

有什么办法可以创建适用于整个项目的主题吗?我已经尝试将app-theme.html专门导入到我的元素中,并没有什么区别.提前致谢.

polymerthemes.com

的主题应该适用于整个项目.

只需下载其中一个预制主题(或使用 Polymer Theme Builder 创建自己的主题)并在<head>中链接到它,如下所示:

<style is="custom-style">
    @import url("path/to/theme.css");
</style>

或者,看看如何在该网站上应用样式.

免责声明:我是polymerthemes.com的创始人之一.

翻译自:https://stackoverflow.com/questions/30900593/polymer-1-0-app-theme-only-affecting-index-html-and-not-on-custom-elements


以上所述就是小编给大家介绍的《css – Polymer 1.0 app-theme仅影响index.html,而不影响自定义元素》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Flow-Based Programming (2nd Edition)

Flow-Based Programming (2nd Edition)

CreateSpace / 2010-5-14 / $69.95

Written by a pioneer in the field, this is a thorough guide to the cost- and time-saving advantages of Flow-Based Programming. It explains the theoretical underpinnings and application of this program......一起来看看 《Flow-Based Programming (2nd Edition)》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

在线进制转换器
在线进制转换器

各进制数互转换器

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试