在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):PolymerElements/paper-styles开源软件地址(OpenSource Url):https://github.com/PolymerElements/paper-styles开源编程语言(OpenSource Language):JavaScript 97.9%开源软件介绍(OpenSource Introduction):<paper-styles>
We recommend importing each of these individual files, and using the style mixins
available in each ones, rather than the aggregated See: Documentation, Demo. UsageInstallation
In an html file<html>
<head>
<script type="module">
import '@polymer/paper-styles/typography.js';
import {html} from '@polymer/polymer/lib/utils/html-tag.js';
const template = html`
<custom-style>
<style is="custom-style" include="paper-material-styles">
.paper-font-headline {
@apply --paper-font-headline;
}
</style>
</custom-style>`;
document.body.appendChild(template.content);
</script>
</head>
<body>
<div class="paper-font-headline">Headline</div>
<div class="paper-material" elevation="3">This is a lifted paper</div>
</body>
</html> In a Polymer 3 elementimport {PolymerElement, html} from '@polymer/polymer';
import '@polymer/paper-styles/typography.js';
import {html} from '@polymer/polymer/lib/utils/html-tag.js';
class SampleElement extends PolymerElement {
static get template() {
return html`
<style is="custom-style" include="paper-material-styles">
.paper-font-headline {
@apply --paper-font-headline;
}
</style>
<div class="paper-font-headline">Headline</div>
<div class="paper-material" elevation="3">This is a lifted paper</div>
`;
}
}
customElements.define('sample-element', SampleElement); ContributingIf you want to send a PR to this element, here are the instructions for running the tests and demo locally: Installationgit clone https://github.com/PolymerElements/paper-styles
cd paper-styles
npm install
npm install -g polymer-cli Running the demo locallypolymer serve --npm
open http://127.0.0.1:<port>/demo/ Running the testspolymer test --npm |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论