-
Notifications
You must be signed in to change notification settings - Fork 4
/
Divider.js
54 lines (41 loc) · 1015 Bytes
/
Divider.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
47
48
49
50
51
52
53
54
/* https://m3.material.io/components/dividers/specs */
import CustomElement from '../core/CustomElement.js';
import ThemableMixin from '../mixins/ThemableMixin.js';
export default CustomElement
.extend()
.mixin(ThemableMixin)
.observe({
vertical: 'boolean',
})
.css`
:host {
--mdw-ink: var(--mdw-color__outline-variant);
position: relative;
display: block;
overflow: visible;
box-sizing: border-box;
block-size: 0;
inline-size: 100%;
color: rgb(var(--mdw-ink));
}
:host::before {
content: '';
display: block;
box-sizing: border-box;
block-size: 1px;
inline-size: auto;
background-color: currentcolor;
}
:host([vertical]) {
display: inline-flex;
vertical-align: top;
block-size: auto;
min-block-size: 100%;
inline-size: 0;
}
:host([vertical])::before {
block-size: auto;
min-inline-size: 1px;
}
`
.autoRegister('mdw-divider');