-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstack.html
97 lines (84 loc) · 2.71 KB
/
stack.html
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="en">
<!-- https://stackoverflow.com/questions/76596285/how-do-i-style-custom-element-children -->
<head>
<title>Stack</title>
<script type="module" src="./layouts.js"></script>
<style>
stack-layout {
border: 4px solid red;
}
p,
h3,
div {
border: 4px solid green;
}
</style>
</head>
<body>
<h2> Two Stacks, one default space, the other set larger</h2>
<stack-layout>
<h3>Hello World</h3>
<p>I'm a paragraph</p>
<div>And I'm a div with text</div>
</stack-layout>
<stack-layout space="3rem">
<h3>Hi Again</h3>
<p>I'm still a paragraph</p>
<div>And I'm still a div with text</div>
</stack-layout>
<h2> Only child</h2>
<stack-layout>
<h3>Only child</h3>
</stack-layout>
<!-- <h2>Recursion</h2>
<stack-layout recursive>
<p> first level child </p>
<p> first level sibling </p>
<div>
<p> second level child </p>
<p> second level sibling </p>
</div>
</stack-layout> -->
<h2>Nesting</h2>
<stack-layout space="1rem">
<p> first level child </p>
<p> first level sibling </p>
<stack-layout>
<p> second level child </p>
<p> second level sibling </p>
</stack-layout>
</stack-layout>
<h2> Two stacks inside another, different space size </h2>
<stack-layout space="3rem">
<stack-layout space="1.5rem">
<p>Paragraph </p>
<p>Paragraph </p>
</stack-layout>
<stack-layout space="1.5rem">
<p>Paragraph </p>
<p>Paragraph </p>
</stack-layout>
</stack-layout>
<h2> Two nested Stacks, first default space, second different space</h2>
<stack-layout>
<h3>Hello World</h3>
<p>I'm a paragraph</p>
<div>And I'm a div with text</div>
<stack-layout space="3rem">
<h3>Hello nested</h3>
<p>I'm a nested paragraph</p>
<div>And I'm a nested div with text</div>
</stack-layout>
</stack-layout>
<h2> Split after 3 </h2>
<stack-layout space="2rem" splitAfter="3" style="height:40rem">
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. </p>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. </p>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. </p>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. </p>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. </p>
<p> Lorem ipsum dolor sit, amet consectetur adipisicing elit. </p>
</stack-layout>
</html>
</body>