How to change Polymer(1.0) paper-toolbar background colour?
2015-08-19 12:23
549 查看
http://stackoverflow.com/questions/30556196/how-to-change-polymer1-0-paper-toolbar-background-colour
Q:
Yesterday I decided to try Polymer 1.0 and I'm already facing difficulties when trying to styling the paper-toolbar.
The documentation says that the background colour can be changed by using:--paper-toolbar-background
But how can I use it on CSS?
I tried the following:
Also this:
But neither worked. What is the correct way to do it?
Thanks.
A:
If you are styling it on your main page, then you have to apply styles using
Applying is relatively easy.
To use these properties is just the same as applying styles in your elements. As an example
Q:
Yesterday I decided to try Polymer 1.0 and I'm already facing difficulties when trying to styling the paper-toolbar.
The documentation says that the background colour can be changed by using:--paper-toolbar-background
But how can I use it on CSS?
I tried the following:
paper-toolbar { --paper-toolbar-background: #e5e5e5; }
Also this:
paper-toolbar { --paper-toolbar { background: #e5e5e5; } }
But neither worked. What is the correct way to do it?
Thanks.
A:
If you are styling it on your main page, then you have to apply styles using
<style is='custom-style'>. This is to make Custom CSS Properties work.
Applying is relatively easy.
paper-toolbarprovides 2 custom properties and one mixin.
--paper-toolbar-backgroundis a property that changes the background color of the toolbar while
--paper-toolbar-colorchanges its foreground color.
--paper-toolbaris a mixin applied to the toolbar.
To use these properties is just the same as applying styles in your elements. As an example
<style is="custom-style"> paper-toolbar { --paper-toolbar-background: #00f; /* changes the background to blue*/ --paper-toolbar-color: #0f0; /* changes the foreground color to green */ --paper-toolbar: { font-size: 40px; /* Change default font size */ }; /* Notice the semicolon here */ } </style>
相关文章推荐
- MySQL表达式计算
- Camera学习,调用系统摄像机上传图片。
- acm c++常用函数(stl)
- iOS开发系列之四 - UITextView 用法小结
- KMP算法的python实现
- 文档注释,建立解释文档
- IIS配置WCF服务
- Xcode-5.1.1更改文件盯作者
- datagrid: 排序没有效果
- HDU 2824 The Euler function(欧拉函数)
- spring 定时任务
- sizeof求结构体大小
- 使用C语言构建基本的二叉树数据结构
- 多线程编程学习总结
- Linux————TCP/IP协议
- iOS开发系列之三 - UITextField 用法小结
- 用Spring建立RESTful Web Service的Server和Client
- tomcat配置301重定向(urlRewrite URL重写)
- ubuntu 下安装ssh服务,并修改ssh端口
- centos下 安装 rvm