Skip to content

Instantly share code, notes, and snippets.

@kriskowal
Last active March 16, 2016 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kriskowal/ea345d04b8d3224a19a5 to your computer and use it in GitHub Desktop.
Save kriskowal/ea345d04b8d3224a19a5 to your computer and use it in GitHub Desktop.
/* using css syntax highlighting for giggles */
#todos {
value <- #this.value;
}
#todos:iteration {
#done.value <- value.done;
#label.value <- value.label;
#item.classList.has('active') <- value.active;
#item.classList.has('selected') <- value.active;
}
#allDone {
value <-> #todos.every{done};
}
#noneDone {
value <-> #todos.every{!done};
}
<!doctype html>
<html>
<head>
<meta charset="utf8">
<link rel="bindings" href="./todo.css">
<link rel="tag" href="gutentag/repeat.html">
<link rel="tag" href="gutentag/text.html">
<link rel="tag" href="checker.html" as="checkbox">
<link rel="demovalue" href="./todo-demo.json">
<meta exports="todos:iteration" as="todo">
<meta accepts="[body]" as="item">
</head>
<body>
<label for="allDone"><checkbox id="allDone"> All Done</label>
<label for="noneDone"><checkbox id="noneDone"> None Done</label>
<ul><repeat id="todos"><li id="item">
<checkbox id="done">
<text id="label">—</text>
<item></item>
</li></repeat></ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment