liquid_feedback_frontend
diff style/mdl/switch/_switch.scss @ 1309:32cc544d5a5b
Cumulative patch for upcoming frontend version 4
author | bsw/jbe |
---|---|
date | Sun Jul 15 14:07:29 2018 +0200 (2018-07-15) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/style/mdl/switch/_switch.scss Sun Jul 15 14:07:29 2018 +0200 1.3 @@ -0,0 +1,203 @@ 1.4 +/** 1.5 + * Copyright 2015 Google Inc. All Rights Reserved. 1.6 + * 1.7 + * Licensed under the Apache License, Version 2.0 (the "License"); 1.8 + * you may not use this file except in compliance with the License. 1.9 + * You may obtain a copy of the License at 1.10 + * 1.11 + * http://www.apache.org/licenses/LICENSE-2.0 1.12 + * 1.13 + * Unless required by applicable law or agreed to in writing, software 1.14 + * distributed under the License is distributed on an "AS IS" BASIS, 1.15 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1.16 + * See the License for the specific language governing permissions and 1.17 + * limitations under the License. 1.18 + */ 1.19 + 1.20 + 1.21 +@import "../variables"; 1.22 +@import "../mixins"; 1.23 + 1.24 +.mdl-switch { 1.25 + position: relative; 1.26 + 1.27 + z-index: 1; 1.28 + 1.29 + vertical-align: middle; 1.30 + 1.31 + display: inline-block; 1.32 + 1.33 + box-sizing: border-box; 1.34 + width: 100%; 1.35 + height: $switch-label-height; 1.36 + margin: 0; 1.37 + padding: 0; 1.38 + 1.39 + overflow: visible; 1.40 + 1.41 + &.is-upgraded { 1.42 + padding-left: $switch-track-length - 8px; 1.43 + } 1.44 + 1.45 + // avoids blue box around switch 1.46 + -webkit-touch-callout: none; 1.47 + -webkit-user-select: none; 1.48 + -moz-user-select: none; 1.49 + -ms-user-select: none; 1.50 + user-select: none; 1.51 +} 1.52 + 1.53 +.mdl-switch__input { 1.54 + line-height: $switch-label-height; 1.55 + 1.56 + .mdl-switch.is-upgraded & { 1.57 + // Hide input element, while still making it respond to focus. 1.58 + position: absolute; 1.59 + width: 0; 1.60 + height: 0; 1.61 + margin: 0; 1.62 + padding: 0; 1.63 + opacity: 0; 1.64 + -ms-appearance: none; 1.65 + -moz-appearance: none; 1.66 + -webkit-appearance: none; 1.67 + appearance: none; 1.68 + border: none; 1.69 + } 1.70 +} 1.71 + 1.72 +.mdl-switch__track { 1.73 + background: $switch-off-track-color; 1.74 + position: absolute; 1.75 + left: 0; 1.76 + top: $switch-track-top; 1.77 + height: $switch-track-height; 1.78 + width: $switch-track-length; 1.79 + border-radius: $switch-track-height; 1.80 + 1.81 + cursor: pointer; 1.82 + 1.83 + .mdl-switch.is-checked & { 1.84 + background: $switch-track-color; 1.85 + } 1.86 + 1.87 + fieldset[disabled] .mdl-switch, 1.88 + .mdl-switch.is-disabled & { 1.89 + background: $switch-disabled-track-color; 1.90 + cursor: auto; 1.91 + } 1.92 +} 1.93 + 1.94 +.mdl-switch__thumb { 1.95 + background: $switch-off-thumb-color; 1.96 + position: absolute; 1.97 + left: 0; 1.98 + top: $switch-thumb-top; 1.99 + height: $switch-thumb-size; 1.100 + width: $switch-thumb-size; 1.101 + border-radius: 50%; 1.102 + 1.103 + cursor: pointer; 1.104 + 1.105 + @include shadow-2dp(); 1.106 + 1.107 + @include material-animation-default(0.28s); 1.108 + transition-property: left; 1.109 + 1.110 + .mdl-switch.is-checked & { 1.111 + background: $switch-thumb-color; 1.112 + left: $switch-track-length - $switch-thumb-size; 1.113 + 1.114 + @include shadow-3dp(); 1.115 + } 1.116 + 1.117 + fieldset[disabled] .mdl-switch, 1.118 + .mdl-switch.is-disabled & { 1.119 + background: $switch-disabled-thumb-color; 1.120 + cursor: auto; 1.121 + } 1.122 +} 1.123 + 1.124 +.mdl-switch__focus-helper { 1.125 + position: absolute; 1.126 + top: 50%; 1.127 + left: 50%; 1.128 + 1.129 + transform: translate(-$switch-helper-size / 2, -$switch-helper-size / 2); 1.130 + 1.131 + display: inline-block; 1.132 + 1.133 + box-sizing: border-box; 1.134 + width: $switch-helper-size; 1.135 + height: $switch-helper-size; 1.136 + border-radius: 50%; 1.137 + 1.138 + background-color: transparent; 1.139 + 1.140 + .mdl-switch.is-focused & { 1.141 + box-shadow: 0 0 0px (($switch-ripple-size - $switch-helper-size) / 2) 1.142 + rgba(0, 0, 0, 0.1); 1.143 + background-color: rgba(0, 0, 0, 0.1); 1.144 + } 1.145 + 1.146 + .mdl-switch.is-focused.is-checked & { 1.147 + box-shadow: 0 0 0px (($switch-ripple-size - $switch-helper-size) / 2) 1.148 + $switch-faded-color; 1.149 + background-color: $switch-faded-color; 1.150 + } 1.151 +} 1.152 + 1.153 +.mdl-switch__label { 1.154 + position: relative; 1.155 + cursor: pointer; 1.156 + font-size: $switch-label-font-size; 1.157 + line-height: $switch-label-height; 1.158 + margin: 0; 1.159 + left: 24px; 1.160 + 1.161 + fieldset[disabled] .mdl-switch, 1.162 + .mdl-switch.is-disabled & { 1.163 + color: $switch-disabled-thumb-color; 1.164 + cursor: auto; 1.165 + } 1.166 +} 1.167 + 1.168 +.mdl-switch__ripple-container { 1.169 + position: absolute; 1.170 + z-index: 2; 1.171 + top: -($switch-ripple-size - $switch-label-height) / 2; 1.172 + left: $switch-thumb-size / 2 - $switch-ripple-size / 2; 1.173 + 1.174 + box-sizing: border-box; 1.175 + width: $switch-ripple-size; 1.176 + height: $switch-ripple-size; 1.177 + border-radius: 50%; 1.178 + 1.179 + cursor: pointer; 1.180 + 1.181 + overflow: hidden; 1.182 + -webkit-mask-image: -webkit-radial-gradient(circle, white, black); 1.183 + 1.184 + transition-duration: 0.40s; 1.185 + transition-timing-function: step-end; 1.186 + transition-property: left; 1.187 + 1.188 + & .mdl-ripple { 1.189 + background: $switch-color; 1.190 + } 1.191 + 1.192 + fieldset[disabled] .mdl-switch, 1.193 + .mdl-switch.is-disabled & { 1.194 + cursor: auto; 1.195 + } 1.196 + 1.197 + fieldset[disabled] .mdl-switch & .mdl-ripple, 1.198 + .mdl-switch.is-disabled & .mdl-ripple { 1.199 + background: transparent; 1.200 + } 1.201 + 1.202 + .mdl-switch.is-checked & { 1.203 + left: $switch-track-length - $switch-ripple-size / 2 - 1.204 + $switch-thumb-size / 2; 1.205 + } 1.206 +}