Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(650)

Unified Diff: sky/framework/README.md

Issue 695963003: add README.md (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: ws Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/README.md
diff --git a/sky/framework/README.md b/sky/framework/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..3154f566c93e8672a48cb9b1ba88d17f45bf308c
--- /dev/null
+++ b/sky/framework/README.md
@@ -0,0 +1,52 @@
+SkyElement
+===
+
+SkyElement is the framework for creating...yup...Sky Elements. It take heavy
+inspriation from [Polymer](www.polymer-project.org) and isn't very fully
+featured...yet
+
+Declaring an element
+--------
+```HTML
+<link rel="import" href="../path/to/sky-element.sky" as="SkyElement" />
+<template>
+ <my-other-element>Hello, {{ place }}</my-other-element>
+</template>
+<script>
+// SkyElement takes a single object as it's only parameter
+SkyElement({
+ name: 'my-element', // required. The element's tag-name
+ attached: function() {
+ this.place = 'World';
+ }, // optional
+ detached: function() {}, // optional
+ attributeChanged: function(attrName, newValue, oldValue) {} // optional
+});
+</script>
+```
+
+Note that an element's declared ShadowDOM is the previous <template>
+element to the <script> element which defines the element.
+
+Databinding
+--------
+SkyElement's databinding support is derived from Polymer's. At the moment,
+there are some key differences:
+
+There is not yet support for
+ * Declarative event handlers
+ * Inline expressions
+ * Self-observation (e.g. fooChanged() gets invoked when this.foo is changed)
+ * Computed properties (e.g. the computed block)
+ * Conditional attributes (e.g. `<my-foo checked?="{{ val }}" `)
+
+ Also, because there are so few built-in elements in Sky, the default behavior
+ of HTMLElement with bindings is to assign to the property. e.g.
+
+ ```HTML
+ <my-foo bar="{{ bas }}">
+ ```
+
+ Will not setAttribute on the my-foo, instead it will assign to the `bar`
+ property of `my-foo`. There are two exceptions to this: `class` & `style` --
+ those still`setAttribute`.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698