-
Notifications
You must be signed in to change notification settings - Fork 0
/
2.html
34 lines (28 loc) · 951 Bytes
/
2.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
<!DOCTYPE html>
<link rel="stylesheet" href="styles.css" />
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">
<style>
layout { display: layout(sizing); }
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<div id="controls">
<label>A : --auto-block-size <input type="number" data-unit="" value="20" step="10" /></label>
</div>
<pre><code class="js">
registerLayout('sizing', class {
static get inputProperties() { return ['--auto-block-size'] }
*intrinsicSizes() { /* not yet implemented */ }
*layout(_, __, ___, styleMap) {
const autoBlockSize = parseInt(
styleMap.get('--auto-block-size'));
console.log(autoBlockSize);
return {autoBlockSize};
}
});
</code></pre>
<pre><code class="html"></code></pre>
<div id="wrapper">
<layout id="A"></layout>
</div>
<script src="script.js"></script>