-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathtest.html
80 lines (65 loc) · 1.54 KB
/
test.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
---
layout: none
---
<html lang="en">
<head>
<meta charset="utf-8">
<title>Raster test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="res/base.css">
<style>
body > grid {
grid-column-gap: var(--spacingv);
grid-row-gap: var(--spacingv);
margin-bottom: calc(var(--spacingv) * 4);
}
c {
padding: 1rem;
}
</style>
</head>
<body>
<grid columns="8" class="debug">
<c span="1">1</c>
<c span="1">2</c>
<c span="1">3</c>
<c span="1">4</c>
<c>5</c>
<c>6</c>
<c>7</c>
<c>8</c>
<c span="1">1</c>
<c span="3">3</c>
<c span="1">1</c>
<c span="3">3</c>
<c span="2+2">2+2</c>
<c span="5-8">5-8</c>
<c span="2" span-s="row">2</c>
<c span="1..">1..</c>
<c span="2..">2..</c>
<c span="4..">4..</c>
<c span="4-20">4-20</c>
<c span="4+3">4+3</c>
<c span="row">row</c>
<c span="8">8</c>
<c span="invalid">invalid</c>
<c span="9-3">9-3 (invalid)</c>
</grid>
<pre id="css-output"></pre>
<script src="res/generate-grid.js"></script>
<script>
let css = Raster.generateCSS({
minColumns: 1,
maxColumns: 8,
defaultColumns: 4,
})
let style = document.createElement('style')
document.head.appendChild(style)
style.appendChild(document.createTextNode(css))
let outel = document.querySelector('#css-output')
outel.appendChild(document.createTextNode(css))
</script>
</body>
</html>