Skip to content

Commit e1a3500

Browse files
committed
Only grab the example.html changes from the branch.
1 parent 2db82b3 commit e1a3500

File tree

1 file changed

+68
-44
lines changed

1 file changed

+68
-44
lines changed

example.html

Lines changed: 68 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,69 @@
1-
<!doctype html>
2-
<div>
3-
<textarea id='css'>foo { bar: baz; }</textarea>
4-
<button onclick='parseStuff()'>Parse</button>
5-
<textarea id='tokens'></textarea>
6-
</div>
7-
<textarea id='tree'></textarea>
8-
<style>
9-
html,body { height: 100%; margin: 0; padding: 0; }
10-
body > div {
11-
height: 50%;
12-
display: -webkit-flex;
13-
-webkit-align-items: center;
14-
}
15-
#css, #tokens {
16-
-webkit-flex: 1;
17-
-webkit-align-self: stretch;
18-
height: 100%;
19-
}
20-
#tree {
21-
width: 99%;
22-
height: 45%;
23-
}
24-
25-
</style>
26-
<script>
27-
var debug;
28-
function parseStuff() {
29-
AtRule.registry.foo = 'decl';
30-
31-
var css = document.querySelector('#css').value;
32-
var tokenlist = tokenize(css);
33-
var sheet = parse(tokenlist);
34-
console.log(tokenlist);
35-
console.log(sheet);
36-
debug = sheet;
37-
var txt = document.querySelector('#tokens');
38-
txt.value = tokenlist.join(' ');
39-
var tree = document.querySelector('#tree');
40-
tree.value = sheet.toString(' ');
41-
42-
}
43-
</script>
44-
<script src="tokenizer.js"></script>
1+
<!doctype html>
2+
<div><!--
3+
--><textarea id='css'>foo { bar: baz; }</textarea><!--
4+
--><button id="parse" onclick='parseStuff()'>Parse</button><!--
5+
--><textarea id='tokens' readonly placeholder="RESULT OF CSS TOKENIZATION GOES HERE"></textarea><!--
6+
--></div>
7+
<textarea id='tree' readonly placeholder="RESULT OF THE CSS PARSING GOES HERE"></textarea>
8+
<style>
9+
10+
/* reset style */
11+
html,body { height: 100%; margin: 0px; padding: 0px; overflow: hidden; }
12+
* {
13+
-o-box-sizing: border-box;
14+
-ms-box-sizing: border-box;
15+
-moz-box-sizing: border-box;
16+
-webkit-box-sizing: border-box;
17+
box-sizing: border-box;
18+
}
19+
20+
/* UI controls */
21+
textarea, button {
22+
vertical-align: middle;
23+
overflow: auto;
24+
border: none;
25+
}
26+
27+
button {
28+
background: orange;
29+
color: white;
30+
}
31+
32+
/* layout */
33+
body > div {
34+
height: 50%;
35+
}
36+
#css, #tokens {
37+
width: 45%;
38+
height: 100%;
39+
}
40+
#parse {
41+
width: 10%;
42+
height: 100%;
43+
}
44+
#tree {
45+
width: 100%;
46+
height: 50%;
47+
background: #fafaf0;
48+
}
49+
</style>
50+
<script>
51+
var debug;
52+
function parseStuff() {
53+
AtRule.registry.foo = 'decl';
54+
55+
var css = document.querySelector('#css').value;
56+
var tokenlist = tokenize(css);
57+
var sheet = parse(tokenlist);
58+
console.log(tokenlist);
59+
console.log(sheet);
60+
debug = sheet;
61+
var txt = document.querySelector('#tokens');
62+
txt.value = tokenlist.join(' ');
63+
var tree = document.querySelector('#tree');
64+
tree.value = sheet.toString(' ');
65+
66+
}
67+
</script>
68+
<script src="tokenizer.js"></script>
4569
<script src="parser.js"></script>

0 commit comments

Comments
 (0)