-
Notifications
You must be signed in to change notification settings - Fork 5
/
Box.js
46 lines (39 loc) · 1.03 KB
/
Box.js
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
import CustomElement from '../core/CustomElement.js';
import FlexableMixin from '../mixins/FlexableMixin.js';
import ThemableMixin from '../mixins/ThemableMixin.js';
/**
* Boxes are stateless elements that may have a color and ink.
* They should have simple geometry for rendering and layout.
*/
export default CustomElement
.extend()
.mixin(ThemableMixin)
.mixin(FlexableMixin)
.html`<slot id=slot></slot>`
.css`
:host(:where([color])) {
background-color: rgb(var(--mdw-bg));
color: rgb(var(--mdw-ink));
}
:host(:is([color="none"],[color="transparent"])) {
background-color: transparent;
color: inherit;
}
:host([ink]) {
color: rgb(var(--mdw-ink));
}
:host([type-style]) {
font: var(--mdw-type__font);
letter-spacing: var(--mdw-type__letter-spacing);
}
#slot::slotted([flex-0]) {
flex: 0;
}
#slot::slotted([flex-1]) {
flex: 1;
}
#slot::slotted([flex-none]) {
flex: none;
}
`
.autoRegister('mdw-box');