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 */ | |
10 | |
11 :host { | |
12 display: inline-block; | |
13 } | |
14 | |
15 :host([disabled]) { | |
16 pointer-events: none; | |
17 } | |
18 | |
19 :host(:focus) { | |
20 outline:none; | |
21 } | |
22 | |
23 :host .toggle-bar { | |
24 background-color: var(--paper-toggle-button-unchecked-bar-color, #000000); | |
25 } | |
26 | |
27 :host .toggle-button { | |
28 background-color: var(--paper-toggle-button-unchecked-button-color, --paper-gr
ey-50); | |
29 } | |
30 | |
31 :host([checked]) .toggle-bar { | |
32 background-color: var(--paper-toggle-button-checked-bar-color, --google-green-
500); | |
33 } | |
34 | |
35 :host([checked]) .toggle-button { | |
36 background-color: var(--paper-toggle-button-checked-button-color, --google-gre
en-500); | |
37 } | |
38 | |
39 :host .toggle-ink { | |
40 color: var(--paper-toggle-button-unchecked-ink-color, --primary-text-color); | |
41 } | |
42 | |
43 :host([checked]) .toggle-ink { | |
44 color: var(--paper-toggle-button-checked-ink-color, --google-green-500); | |
45 } | |
46 | |
47 /* ID selectors should not be overriden by users. */ | |
48 | |
49 #toggleContainer { | |
50 position: relative; | |
51 width: 36px; | |
52 height: 14px; | |
53 } | |
54 | |
55 #toggleBar { | |
56 position: absolute; | |
57 height: 100%; | |
58 width: 100%; | |
59 border-radius: 8px; | |
60 pointer-events: none; | |
61 opacity: 0.4; | |
62 transition: background-color linear .08s; | |
63 } | |
64 | |
65 :host([checked]) #toggleBar { | |
66 opacity: 0.5; | |
67 } | |
68 | |
69 :host([disabled]) #toggleBar { | |
70 background-color: #000; | |
71 opacity: 0.12; | |
72 } | |
73 | |
74 #toggleButton { | |
75 position: absolute; | |
76 top: -3px; | |
77 height: 20px; | |
78 width: 20px; | |
79 border-radius: 50%; | |
80 box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.6); | |
81 transition: -webkit-transform linear .08s, background-color linear .08s; | |
82 transition: transform linear .08s, background-color linear .08s; | |
83 will-change: transform; | |
84 } | |
85 | |
86 #toggleButton.dragging { | |
87 -webkit-transition: none; | |
88 transition: none; | |
89 } | |
90 | |
91 :host([checked]) #toggleButton { | |
92 -webkit-transform: translate(16px, 0); | |
93 transform: translate(16px, 0); | |
94 } | |
95 | |
96 :host([disabled]) #toggleButton { | |
97 background-color: #bdbdbd; | |
98 opacity: 1; | |
99 } | |
100 | |
101 #ink { | |
102 position: absolute; | |
103 top: -14px; | |
104 left: -14px; | |
105 width: 48px; | |
106 height: 48px; | |
107 opacity: 0.5; | |
108 pointer-events: none; | |
109 } | |
OLD | NEW |