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 |
| 10 <!-- |
| 11 `paper-checkbox` is a button that can be either checked or unchecked. User |
| 12 can tap the checkbox to check or uncheck it. Usually you use checkboxes |
| 13 to allow user to select multiple options from a set. If you have a single |
| 14 ON/OFF option, avoid using a single checkbox and use `paper-toggle-button` |
| 15 instead. |
| 16 |
| 17 Example: |
| 18 |
| 19 <paper-checkbox></paper-checkbox> |
| 20 |
| 21 <paper-checkbox checked></paper-checkbox> |
| 22 |
| 23 Styling checkbox: |
| 24 |
| 25 To change the ink color for checked state: |
| 26 |
| 27 paper-checkbox::shadow #ink[checked] { |
| 28 color: #4285f4; |
| 29 } |
| 30 |
| 31 To change the checkbox checked color: |
| 32 |
| 33 paper-checkbox::shadow #checkbox.checked { |
| 34 border-color: #4285f4; |
| 35 } |
| 36 |
| 37 To change the ink color for unchecked state: |
| 38 |
| 39 paper-checkbox::shadow #ink { |
| 40 color: #b5b5b5; |
| 41 } |
| 42 |
| 43 To change the checbox unchecked color: |
| 44 |
| 45 paper-checkbox::shadow #checkbox { |
| 46 border-color: #b5b5b5; |
| 47 } |
| 48 |
| 49 @group Paper Elements |
| 50 @element paper-checkbox |
| 51 @extends paper-radio-button |
| 52 @homepage github.io |
| 53 --> |
| 54 |
| 55 <link rel="import" href="../paper-radio-button/paper-radio-button.html"> |
| 56 |
| 57 <polymer-element name="paper-checkbox" extends="paper-radio-button" role="checkb
ox" assetpath=""> |
| 58 <template> |
| 59 |
| 60 <link rel="stylesheet" href="paper-checkbox.css"> |
| 61 |
| 62 <div id="checkboxContainer" class="{{ {labeled: label} | tokenList }}"> |
| 63 |
| 64 <paper-ripple id="ink" class="circle recenteringTouch" checked?="{{!checked}
}"></paper-ripple> |
| 65 |
| 66 <div id="checkbox" on-animationend="{{checkboxAnimationEnd}}" on-webkitanima
tionend="{{checkboxAnimationEnd}}"></div> |
| 67 |
| 68 </div> |
| 69 |
| 70 <div id="checkboxLabel" hidden?="{{!label}}">{{label}}<content></content></div
> |
| 71 |
| 72 </template> |
| 73 |
| 74 </polymer-element> |
| 75 <script src="paper-checkbox-extracted.js"></script> |
OLD | NEW |