如何更改Polymer(1.0)纸工具栏背景颜色?

编程入门 行业动态 更新时间:2024-10-27 04:34:27
本文介绍了如何更改Polymer(1.0)纸工具栏背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

昨天我决定尝试使用Polymer 1.0,当尝试设置样式工具栏时,我已经遇到了困难。

Yesterday I decided to try Polymer 1.0 and I'm already facing difficulties when trying to styling the paper-toolbar.

文档说明背景颜色可以是通过使用: --paper-toolbar-background

The documentation says that the background colour can be changed by using: --paper-toolbar-background

但是如何在CSS上使用它?

But how can I use it on CSS?

我尝试了以下操作:

paper-toolbar { --paper-toolbar-background: #e5e5e5; }

此外:

paper-toolbar { --paper-toolbar { background: #e5e5e5; } }

正确的方法是什么?

感谢。

推荐答案

如果您在主页上对其进行样式设置,则必须使用< style is ='custom-style'> 应用样式。这是为了使自定义CSS属性工作。

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.

应用相对容易。 纸工具栏提供了2个自定义属性和一个mixin。 - paper-toolbar-background 是更改工具栏背景颜色的属性, - paper-toolbar-color 更改其前景色。 - 纸工具栏是应用于工具栏的混合。

Applying is relatively easy. paper-toolbar provides 2 custom properties and one mixin. --paper-toolbar-background is a property that changes the background color of the toolbar while --paper-toolbar-color changes its foreground color. --paper-toolbar is 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>

更多推荐

如何更改Polymer(1.0)纸工具栏背景颜色?

本文发布于:2023-08-02 15:22:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1278864.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:工具栏   如何更改   颜色   背景   Polymer

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!