forked from andreasbm/weightless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
card.ts
56 lines (49 loc) · 1.46 KB
/
card.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { html, LitElement, property, TemplateResult } from "lit-element";
import { customElement } from "lit-element";
import { sharedStyles } from "../style/shared";
import { cssResult } from "../util/css";
import styles from "./card.scss";
/**
* Properties of the card.
*/
export interface ICardProperties {
hoverable: boolean
}
/**
* Group related content and action.
* @slot - Default content.
* @cssprop --card-transition - Transition
* @cssprop --card-border-radius - Border radius
* @cssprop --card-padding - Padding
* @cssprop --card-elevation - Default box shadow
* @cssprop --card-elevation-hover - Box shadow when :hover
* @cssprop --card-color - Color
* @cssprop --card-bg - Background
* @cssprop --card-transition - Transition
* @cssprop --card-border-radius - Border radius
* @cssprop --card-padding - Padding
* @cssprop --card-elevation - Default box shadow
* @cssprop --card-elevation-hover - Box shadow when :hover
* @cssprop --card-color - Color
* @cssprop --card-bg - Background
*/
@customElement("wl-card")
export class Card extends LitElement implements ICardProperties {
static styles = [sharedStyles, cssResult(styles)];
/**
* Makes the card hoverable.
* @attr
*/
@property({reflect: true, type: Boolean}) hoverable: boolean = false;
/**
* Returns the template of the element.
*/
protected render (): TemplateResult {
return html`<slot></slot>`;
}
}
declare global {
interface HTMLElementTagNameMap {
"wl-card": Card;
}
}