| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | |
| 3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | |
| 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
| 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | |
| 6 Code distributed by Google as part of the polymer project is also | |
| 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | |
| 8 --><!-- | |
| 9 `paper-checkbox` is a button that can be either checked or unchecked. User | |
| 10 can tap the checkbox to check or uncheck it. Usually you use checkboxes | |
| 11 to allow user to select multiple options from a set. If you have a single | |
| 12 ON/OFF option, avoid using a single checkbox and use `paper-toggle-button` | |
| 13 instead. | |
| 14 | |
| 15 Example: | |
| 16 | |
| 17 <paper-checkbox></paper-checkbox> | |
| 18 | |
| 19 <paper-checkbox checked></paper-checkbox> | |
| 20 | |
| 21 Styling checkbox: | |
| 22 | |
| 23 To change the ink color for checked state: | |
| 24 | |
| 25 paper-checkbox::shadow #ink[checked] { | |
| 26 color: #4285f4; | |
| 27 } | |
| 28 | |
| 29 To change the checkbox checked color: | |
| 30 | |
| 31 paper-checkbox::shadow #checkbox.checked { | |
| 32 background-color: #4285f4; | |
| 33 border-color: #4285f4; | |
| 34 } | |
| 35 | |
| 36 To change the ink color for unchecked state: | |
| 37 | |
| 38 paper-checkbox::shadow #ink { | |
| 39 color: #b5b5b5; | |
| 40 } | |
| 41 | |
| 42 To change the checbox unchecked color: | |
| 43 | |
| 44 paper-checkbox::shadow #checkbox { | |
| 45 border-color: #b5b5b5; | |
| 46 } | |
| 47 | |
| 48 @group Paper Elements | |
| 49 @element paper-checkbox | |
| 50 @extends paper-radio-button | |
| 51 @homepage github.io | |
| 52 --><html><head><link rel="import" href="../paper-radio-button/paper-radio-button
.html"> | |
| 53 | |
| 54 </head><body><polymer-element name="paper-checkbox" extends="paper-radio-button"
role="checkbox" assetpath=""> | |
| 55 <template> | |
| 56 | |
| 57 <link rel="stylesheet" href="paper-checkbox.css"> | |
| 58 | |
| 59 <div id="checkboxContainer" class="{{ {labeled: label} | tokenList }}"> | |
| 60 | |
| 61 <paper-ripple id="ink" class="circle recenteringTouch" checked?="{{!checked}
}"></paper-ripple> | |
| 62 | |
| 63 <div id="checkbox"> | |
| 64 <div id="checkmark" on-animationend="{{checkboxAnimationEnd}}" on-webkitan
imationend="{{checkboxAnimationEnd}}"></div> | |
| 65 </div> | |
| 66 | |
| 67 </div> | |
| 68 | |
| 69 <div id="checkboxLabel" hidden?="{{!label}}">{{label}}<content></content></div
> | |
| 70 | |
| 71 </template> | |
| 72 | |
| 73 </polymer-element> | |
| 74 <script charset="utf-8" src="paper-checkbox-extracted.js"></script></body></html
> | |
| OLD | NEW |