mirror of
https://github.com/material-components/material-web.git
synced 2024-10-27 06:04:44 +03:00
Icon in TypeScript
This commit is contained in:
parent
dc9860921a
commit
d9bb6ea480
@ -14,7 +14,7 @@
|
||||
"lint": "npm-run-all --parallel lint:*",
|
||||
"test": "karma start --single-run",
|
||||
"bootstrap": "npm install && ./scripts/bootstrap.sh",
|
||||
"build": "npm run build-styling && tsc -b packages/base packages/switch packages/ripple packages/button packages/fab",
|
||||
"build": "npm run build-styling && tsc -b packages/base packages/switch packages/ripple packages/button packages/fab packages/icon",
|
||||
"build-styling": "./scripts/build-styling.sh",
|
||||
"update-gh-pages": "npm run bootstrap && ./scripts/publish-demos.sh"
|
||||
},
|
||||
|
@ -1,19 +0,0 @@
|
||||
/**
|
||||
@license
|
||||
Copyright 2018 Google Inc. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
import {html} from '@polymer/lit-element/lit-element.js';
|
||||
|
||||
export const style = html`<style></style>`;
|
@ -1,20 +0,0 @@
|
||||
/**
|
||||
@license
|
||||
Copyright 2018 Google Inc. All Rights Reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
import {html} from '@polymer/lit-element/lit-element.js';
|
||||
|
||||
export const style = html`<style>:host{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:'liga';-webkit-font-smoothing:antialiased}
|
||||
</style>`;
|
@ -14,17 +14,25 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
import {LitElement, html} from '@polymer/lit-element/lit-element.js';
|
||||
import {style} from './mwc-icon-host-css.js';
|
||||
import {LitElement, html, customElement} from '@polymer/lit-element/lit-element.js';
|
||||
import {style} from './mwc-icon-host-css';
|
||||
import './mwc-icon-font.js';
|
||||
|
||||
@customElement('mwc-icon' as any)
|
||||
export class Icon extends LitElement {
|
||||
|
||||
renderStyle() {
|
||||
return style;
|
||||
}
|
||||
|
||||
render() {
|
||||
return html`${this.renderStyle()}<slot></slot>`;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
customElements.define('mwc-icon', Icon);
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'mwc-icon': Icon;
|
||||
}
|
||||
}
|
10
packages/icon/tsconfig.json
Normal file
10
packages/icon/tsconfig.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "."
|
||||
},
|
||||
"include": [
|
||||
"src/*.ts"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user