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