OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 @license |
| 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 7 Code distributed by Google as part of the polymer project is also |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 --><html><head><link rel="import" href="../polymer/polymer.html"> |
| 10 <link rel="import" href="../paper-ripple/paper-ripple.html"> |
| 11 <link rel="import" href="../paper-styles/default-theme.html"> |
| 12 |
| 13 <!-- |
| 14 `paper-checkbox` is a button that can be either checked or unchecked. User |
| 15 can tap the checkbox to check or uncheck it. Usually you use checkboxes |
| 16 to allow user to select multiple options from a set. If you have a single |
| 17 ON/OFF option, avoid using a single checkbox and use `paper-toggle-button` |
| 18 instead. |
| 19 |
| 20 Example: |
| 21 |
| 22 <paper-checkbox>label</paper-checkbox> |
| 23 |
| 24 <paper-checkbox checked> label</paper-checkbox> |
| 25 |
| 26 Styling a checkbox: |
| 27 |
| 28 <style is="x-style"> |
| 29 * { |
| 30 /* Unhecked state colors. */ |
| 31 --paper-checkbox-unchecked-color: #5a5a5a; |
| 32 --paper-checkbox-unchecked-ink-color: #5a5a5a; |
| 33 |
| 34 /* Checked state colors. */ |
| 35 --paper-checkbox-checked-color: #009688; |
| 36 --paper-checkbox-checked-ink-color: #009688; |
| 37 } |
| 38 </style> |
| 39 |
| 40 @group Paper Elements |
| 41 @class paper-checkbox |
| 42 --> |
| 43 |
| 44 </head><body>/* TODO: This needs to use core-focusable when it's ready. */ |
| 45 <dom-module id="paper-checkbox"> |
| 46 <style is="x-style"> |
| 47 * { |
| 48 --paper-checkbox-unchecked-color: var(--primary-text-color); |
| 49 --paper-checkbox-unchecked-ink-color: var(--primary-text-color); |
| 50 |
| 51 --paper-checkbox-checked-color: var(--default-primary-color); |
| 52 --paper-checkbox-checked-ink-color: var(--default-primary-color); |
| 53 } |
| 54 </style> |
| 55 |
| 56 <link rel="import" type="css" href="paper-checkbox.css"> |
| 57 |
| 58 <template> |
| 59 |
| 60 <div id="checkboxContainer"> |
| 61 <paper-ripple id="ink" class="circle" recenters="" checked$="[[checked]]">
</paper-ripple> |
| 62 <div id="checkbox" class$="[[_computeCheckboxClass(checked)]]"> |
| 63 <div id="checkmark" class$="[[_computeCheckmarkClass(checked)]]"></div> |
| 64 </div> |
| 65 </div> |
| 66 |
| 67 <div id="checkboxLabel" aria-hidden="true"><content></content></div> |
| 68 |
| 69 </template> |
| 70 </dom-module> |
| 71 |
| 72 <script src="paper-checkbox-extracted.js"></script></body></html> |
OLD | NEW |