Delete chrome.mediaGalleriesPrivate because the functionality unique to it has since...
[chromium-blink-merge.git] / third_party / polymer / components / paper-checkbox / paper-checkbox.html
blobe3217106a9270fa1df20bb04710d29db15195fc0
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.github.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/CONTRIBUTORS.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/PATENTS.txt
8 -->
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.
17 Example:
19 <paper-checkbox></paper-checkbox>
21 <paper-checkbox checked></paper-checkbox>
23 Styling checkbox:
25 To change the ink color for checked state:
27 paper-checkbox::shadow #ink[checked] {
28 color: #4285f4;
31 To change the checkbox checked color:
33 paper-checkbox::shadow #checkbox.checked {
34 border-color: #4285f4;
37 To change the ink color for unchecked state:
39 paper-checkbox::shadow #ink {
40 color: #b5b5b5;
43 To change the checbox unchecked color:
45 paper-checkbox::shadow #checkbox {
46 border-color: #b5b5b5;
49 @group Paper Elements
50 @element paper-checkbox
51 @extends paper-radio-button
52 @homepage github.io
53 -->
55 <link rel="import" href="../paper-radio-button/paper-radio-button.html">
57 <polymer-element name="paper-checkbox" extends="paper-radio-button" role="checkbox">
58 <template>
60 <link rel="stylesheet" href="paper-checkbox.css">
62 <div id="checkboxContainer" class="{{ {labeled: label} | tokenList }}" >
64 <paper-ripple id="ink" class="circle recenteringTouch" checked?="{{!checked}}"></paper-ripple>
66 <div id="checkbox" on-animationend="{{checkboxAnimationEnd}}" on-webkitAnimationEnd="{{checkboxAnimationEnd}}"></div>
68 </div>
70 <div id="checkboxLabel" hidden?="{{!label}}">{{label}}<content></content></div>
72 </template>
73 <script>
75 Polymer('paper-checkbox', {
77 /**
78 * Fired when the checked state changes due to user interaction.
80 * @event change
83 /**
84 * Fired when the checked state changes.
86 * @event core-change
89 toggles: true,
91 checkedChanged: function() {
92 var cl = this.$.checkbox.classList;
93 cl.toggle('checked', this.checked);
94 cl.toggle('unchecked', !this.checked);
95 cl.toggle('checkmark', !this.checked);
96 cl.toggle('box', this.checked);
97 this.setAttribute('aria-checked', this.checked ? 'true': 'false');
98 this.fire('core-change');
101 checkboxAnimationEnd: function() {
102 var cl = this.$.checkbox.classList;
103 cl.toggle('checkmark', this.checked && !cl.contains('checkmark'));
104 cl.toggle('box', !this.checked && !cl.contains('box'));
109 </script>
110 </polymer-element>