| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 2 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 3 // Use of this source code is governed by a BSD-style license that can be | |
| 4 // found in the LICENSE file. | |
| 5 --> | |
| 6 <import src="sky-element.sky" /> | |
| 7 <import src="shadow.sky" as="shadow" /> | |
| 8 | |
| 9 <sky-element attributes="primary:boolean, level:number"> | |
| 10 <template> | |
| 11 <style> | |
| 12 :host { | |
| 13 display: inline-flex; | |
| 14 -webkit-user-select: none; | |
| 15 justify-content: center; | |
| 16 align-items: center; | |
| 17 height: 36px; | |
| 18 min-width: 64px; | |
| 19 padding: 0 8px; | |
| 20 margin: 4px; | |
| 21 border-radius: 2px; | |
| 22 } | |
| 23 :host([primary]) { | |
| 24 color: white; | |
| 25 background-color: #0098f4; | |
| 26 } | |
| 27 </style> | |
| 28 <content /> | |
| 29 </template> | |
| 30 <script> | |
| 31 import "dart:sky"; | |
| 32 | |
| 33 @Tagname('sky-button') | |
| 34 class SkyButton extends SkyElement { | |
| 35 SkyButton() { | |
| 36 tabIndex = 0; // Make focusable. | |
| 37 } | |
| 38 | |
| 39 void shadowRootReady() { | |
| 40 shadow.applyTo(shadowRoot); | |
| 41 } | |
| 42 } | |
| 43 | |
| 44 _init(script) => register(script, SkyButton); | |
| 45 </script> | |
| 46 </sky-element> | |
| OLD | NEW |