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

Unified Diff: sky/examples/example-element/example-element.sky

Issue 950493003: Add a basic sky-element custom element (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
Index: sky/examples/example-element/example-element.sky
diff --git a/sky/examples/example-element/example-element.sky b/sky/examples/example-element/example-element.sky
new file mode 100644
index 0000000000000000000000000000000000000000..5382c55b0b808a65ff010a9eea3f1f559519d5d3
--- /dev/null
+++ b/sky/examples/example-element/example-element.sky
@@ -0,0 +1,25 @@
+<!--
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+-->
+<import src="/sky/framework/sky-element.sky" />
+<sky-element>
+<template>
+ <style>
+ div {
+ height: 50px;
+ width: 50px;
+ background-color: green;
+ }
+ </style>
+ <div>Hi</div>
+</template>
+<script>
+@tagname('example')
+class ExampleElement extends SkyElement {
ojan 2015/02/21 00:19:16 Not directly related to this patch, but how hard w
abarth-chromium 2015/02/21 00:25:57 Very easy. In fact, it would be less code than we
+}
+
+_init(script) => register(script, ExampleElement);
+</script>
+</sky-element>

Powered by Google App Engine
This is Rietveld 408576698