【发布时间】:2015-03-04 18:18:38
【问题描述】:
我有一个自定义的 Polymer 元素,我想以某种方式对其进行样式设置,并作为插件提供给许多不同的网站。我希望能够以某种方式封装我的自定义组件的样式,使它们在嵌入它们的所有网站上看起来都一样。以下是来自父网页的字体指令如何干扰我的组件样式的示例:
<style>
* {
font-size: 18px;
}
</style>
<script src="http://www.polymer-project.org/webcomponents.js"></script>
<link rel="import" href="http://www.polymer-project.org/components/polymer/polymer.html">
<polymer-element name="polymer-css-test">
<template>
<style>
:host {
font-size: 12px;
}
</style>
<div>
Please tell me how to make this 12pt.
</div>
</template>
<script>
Polymer('polymer-css-test', {
ready: function () {
}
});
</script>
</polymer-element>
<polymer-css-test></polymer-css-test>
提前感谢您的帮助。
【问题讨论】:
标签: css polymer web-component