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.github.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/CONTRIBUTORS.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/PATENTS.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 <link rel=
"import" href=
"../paper-styles/color.html">
13 <link rel=
"import" href=
"../paper-behaviors/paper-inky-focus-behavior.html">
14 <link rel=
"import" href=
"../iron-checked-element-behavior/iron-checked-element-behavior.html">
17 `paper-checkbox` is a button that can be either checked or unchecked. User
18 can tap the checkbox to check or uncheck it. Usually you use checkboxes
19 to allow user to select multiple options from a set. If you have a single
20 ON/OFF option, avoid using a single checkbox and use `paper-toggle-button`
25 <paper-checkbox>label</paper-checkbox>
27 <paper-checkbox checked> label</paper-checkbox>
31 The following custom properties and mixins are available for styling:
33 Custom property | Description | Default
34 ----------------|-------------|----------
35 `--paper-checkbox-unchecked-background-color` | Checkbox background color when the input is not checked | `transparent`
36 `--paper-checkbox-unchecked-color` | Checkbox border color when the input is not checked | `--primary-text-color`
37 `--paper-checkbox-unchecked-ink-color` | Selected/focus ripple color when the input is not checked | `--primary-text-color`
38 `--paper-checkbox-checked-color` | Checkbox color when the input is checked | `--default-primary-color`
39 `--paper-checkbox-checked-ink-color` | Selected/focus ripple color when the input is checked | `--default-primary-color`
40 `--paper-checkbox-checkmark-color` | Checkmark color | `white`
41 `--paper-checkbox-label-color` | Label color | `--primary-text-color`
42 `--paper-checkbox-error-color` | Checkbox color when invalid | `--google-red-500`
47 </head><body><dom-module id=
"paper-checkbox">
51 display: inline-block;
64 display: inline-block;
69 -webkit-transform: translateZ(
0);
70 transform: translateZ(
0);
71 vertical-align: middle;
72 background-color: var(--paper-checkbox-unchecked-background-color, transparent);
81 color: var(--paper-checkbox-unchecked-ink-color, --primary-text-color);
87 color: var(--paper-checkbox-checked-ink-color, --default-primary-color);
92 box-sizing: border-box;
95 border-color: var(--paper-checkbox-unchecked-color, --primary-text-color);
98 -webkit-transition: background-color
140ms, border-color
140ms;
99 transition: background-color
140ms, border-color
140ms;
102 /* checkbox checked animations */
103 #checkbox.checked #checkmark {
104 -webkit-animation: checkmark-expand
140ms ease-out forwards;
105 animation: checkmark-expand
140ms ease-out forwards;
108 @-webkit-keyframes checkmark-expand {
123 @keyframes checkmark-expand {
138 :host #checkbox.checked {
139 background-color: var(--paper-checkbox-checked-color, --default-primary-color);
140 border-color: var(--paper-checkbox-checked-color, --default-primary-color);
144 -webkit-transform: rotate(
45deg);
145 transform: rotate(
45deg);
154 border-right-width:
2px;
155 border-bottom-width:
2px;
156 border-color: var(--paper-checkbox-checkmark-color, white);
162 display: inline-block;
163 vertical-align: middle;
166 pointer-events: none;
167 color: var(--paper-checkbox-label-color, --primary-text-color);
170 #checkboxLabel[hidden] {
176 pointer-events: none;
179 :host([disabled]) #checkbox {
181 border-color: var(--paper-checkbox-unchecked-color, --primary-text-color);
184 :host([disabled][checked]) #checkbox {
185 background-color: var(--paper-checkbox-unchecked-color, --primary-text-color);
189 :host([disabled]) #checkboxLabel {
194 #checkbox.invalid:not(.checked) {
195 border-color: var(--paper-checkbox-error-color, --google-red-
500);
199 <div id=
"checkboxContainer">
200 <paper-ripple id=
"ink" class=
"circle" center=
"" checked$=
"[[checked]]"></paper-ripple>
201 <div id=
"checkbox" class$=
"[[_computeCheckboxClass(checked, invalid)]]">
202 <div id=
"checkmark" class$=
"[[_computeCheckmarkClass(checked)]]"></div>
206 <div id=
"checkboxLabel"><content></content></div>
210 <script src=
"paper-checkbox-extracted.js"></script></body></html>