liquid_feedback_frontend
diff style/mdl/button/_button.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/button/_button.scss Sun Jul 15 14:07:29 2018 +0200 1.3 @@ -0,0 +1,305 @@ 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 +@import "../variables"; 1.21 +@import "../mixins"; 1.22 + 1.23 +// The button component. Defaults to a flat button. 1.24 +.mdl-button { 1.25 + background: transparent; 1.26 + border: none; 1.27 + border-radius: $button-border-radius; 1.28 + color: $button-secondary-color; 1.29 + position: relative; 1.30 + height: $button-height; 1.31 + margin: 0; 1.32 + min-width: $button-min-width; 1.33 + padding: 0 $button-padding; 1.34 + display: inline-block; 1.35 + @include typo-button(); 1.36 + overflow: hidden; 1.37 + will-change: box-shadow; 1.38 + transition: box-shadow 0.2s $animation-curve-fast-out-linear-in, 1.39 + background-color 0.2s $animation-curve-default, 1.40 + color 0.2s $animation-curve-default; 1.41 + outline: none; 1.42 + cursor: pointer; 1.43 + text-decoration: none; 1.44 + text-align: center; 1.45 + line-height: $button-height; 1.46 + vertical-align: middle; 1.47 + 1.48 + &::-moz-focus-inner { 1.49 + border: 0; 1.50 + } 1.51 + 1.52 + &:hover { 1.53 + background-color: $button-hover-color; 1.54 + } 1.55 + 1.56 + &:focus:not(:active) { 1.57 + background-color: $button-focus-color; 1.58 + } 1.59 + 1.60 + &:active { 1.61 + background-color: $button-active-color; 1.62 + } 1.63 + 1.64 + &.mdl-button--colored { 1.65 + color: $button-primary-color-alt; 1.66 + 1.67 + &:focus:not(:active) { 1.68 + background-color: $button-focus-color-alt; 1.69 + } 1.70 + } 1.71 +} 1.72 + 1.73 +input.mdl-button[type="submit"] { 1.74 + -webkit-appearance:none; 1.75 +} 1.76 + 1.77 + // Raised buttons 1.78 + .mdl-button--raised { 1.79 + background: $button-primary-color; 1.80 + @include shadow-2dp(); 1.81 + 1.82 + &:active { 1.83 + @include shadow-4dp(); 1.84 + background-color: $button-active-color; 1.85 + } 1.86 + 1.87 + &:focus:not(:active) { 1.88 + @include focus-shadow(); 1.89 + background-color: $button-active-color; 1.90 + } 1.91 + 1.92 + &.mdl-button--colored { 1.93 + background: $button-primary-color-alt; 1.94 + color: $button-secondary-color-alt; 1.95 + 1.96 + &:hover { 1.97 + background-color: $button-hover-color-alt; 1.98 + } 1.99 + 1.100 + &:active { 1.101 + background-color: $button-active-color-alt; 1.102 + } 1.103 + 1.104 + &:focus:not(:active) { 1.105 + background-color: $button-active-color-alt; 1.106 + } 1.107 + 1.108 + & .mdl-ripple { 1.109 + background: $button-ripple-color-alt; 1.110 + } 1.111 + } 1.112 + } 1.113 + 1.114 + 1.115 + // FABs 1.116 + .mdl-button--fab { 1.117 + border-radius: 50%; 1.118 + font-size: $button-fab-font-size; 1.119 + height: $button-fab-size; 1.120 + margin: auto; 1.121 + min-width: $button-fab-size; 1.122 + width: $button-fab-size; 1.123 + padding: 0; 1.124 + overflow: hidden; 1.125 + background: $button-primary-color; 1.126 + box-shadow: 0 1px 1.5px 0 rgba(0,0,0,0.12), 0 1px 1px 0 rgba(0,0,0,0.24); 1.127 + position: relative; 1.128 + line-height: normal; 1.129 + 1.130 + & .material-icons { 1.131 + position: absolute; 1.132 + top: 50%; 1.133 + left: 50%; 1.134 + transform: translate(- $button-fab-font-size / 2, - $button-fab-font-size / 2); 1.135 + line-height: $button-fab-font-size; 1.136 + width: $button-fab-font-size; 1.137 + } 1.138 + 1.139 + &.mdl-button--mini-fab { 1.140 + height: $button-fab-size-mini; 1.141 + min-width: $button-fab-size-mini; 1.142 + width: $button-fab-size-mini; 1.143 + } 1.144 + 1.145 + & .mdl-button__ripple-container { 1.146 + border-radius: 50%; 1.147 + // Fixes clipping bug in Safari. 1.148 + -webkit-mask-image: -webkit-radial-gradient(circle, white, black); 1.149 + } 1.150 + 1.151 + &:active { 1.152 + @include shadow-4dp(); 1.153 + background-color: $button-active-color; 1.154 + } 1.155 + 1.156 + &:focus:not(:active) { 1.157 + @include focus-shadow(); 1.158 + background-color: $button-active-color; 1.159 + } 1.160 + 1.161 + &.mdl-button--colored { 1.162 + background: $button-fab-color-alt; 1.163 + color: $button-fab-text-color-alt; 1.164 + 1.165 + &:hover { 1.166 + background-color: $button-fab-hover-color-alt; 1.167 + } 1.168 + 1.169 + &:focus:not(:active) { 1.170 + background-color: $button-fab-active-color-alt; 1.171 + } 1.172 + 1.173 + &:active { 1.174 + background-color: $button-fab-active-color-alt; 1.175 + } 1.176 + 1.177 + & .mdl-ripple { 1.178 + background: $button-fab-ripple-color-alt; 1.179 + } 1.180 + } 1.181 + } 1.182 + 1.183 + 1.184 + // Icon buttons 1.185 + .mdl-button--icon { 1.186 + border-radius: 50%; 1.187 + font-size: $button-fab-font-size; 1.188 + height: $button-icon-size; 1.189 + margin-left: 0; 1.190 + margin-right: 0; 1.191 + min-width: $button-icon-size; 1.192 + width: $button-icon-size; 1.193 + padding: 0; 1.194 + overflow: hidden; 1.195 + color: inherit; 1.196 + line-height: normal; 1.197 + 1.198 + & .material-icons { 1.199 + position: absolute; 1.200 + top: 50%; 1.201 + left: 50%; 1.202 + transform: translate(- $button-fab-font-size / 2, - $button-fab-font-size / 2); 1.203 + line-height: $button-fab-font-size; 1.204 + width: $button-fab-font-size; 1.205 + } 1.206 + 1.207 + &.mdl-button--mini-icon { 1.208 + height: $button-icon-size-mini; 1.209 + min-width: $button-icon-size-mini; 1.210 + width: $button-icon-size-mini; 1.211 + 1.212 + & .material-icons { 1.213 + top: ($button-icon-size-mini - $button-fab-font-size) / 2; 1.214 + left: ($button-icon-size-mini - $button-fab-font-size) / 2; 1.215 + } 1.216 + } 1.217 + 1.218 + & .mdl-button__ripple-container { 1.219 + border-radius: 50%; 1.220 + // Fixes clipping bug in Safari. 1.221 + -webkit-mask-image: -webkit-radial-gradient(circle, white, black); 1.222 + } 1.223 + } 1.224 + 1.225 + 1.226 + // Ripples 1.227 + .mdl-button__ripple-container { 1.228 + display: block; 1.229 + height: 100%; 1.230 + left: 0px; 1.231 + position: absolute; 1.232 + top: 0px; 1.233 + width: 100%; 1.234 + z-index: 0; 1.235 + overflow: hidden; 1.236 + 1.237 + .mdl-button[disabled] & .mdl-ripple, 1.238 + .mdl-button.mdl-button--disabled & .mdl-ripple { 1.239 + background-color: transparent; 1.240 + } 1.241 + } 1.242 + 1.243 +// Colorized buttons 1.244 + 1.245 +.mdl-button--primary.mdl-button--primary { 1.246 + color: $button-primary-color-alt; 1.247 + & .mdl-ripple { 1.248 + background: $button-secondary-color-alt; 1.249 + } 1.250 + &.mdl-button--raised, &.mdl-button--fab { 1.251 + color: $button-secondary-color-alt; 1.252 + background-color: $button-primary-color-alt; 1.253 + } 1.254 +} 1.255 + 1.256 +.mdl-button--accent.mdl-button--accent { 1.257 + color: $button-fab-color-alt; 1.258 + & .mdl-ripple { 1.259 + background: $button-fab-text-color-alt; 1.260 + } 1.261 + &.mdl-button--raised, &.mdl-button--fab { 1.262 + color: $button-fab-text-color-alt; 1.263 + background-color: $button-fab-color-alt; 1.264 + } 1.265 +} 1.266 + 1.267 +// Disabled buttons 1.268 + 1.269 +.mdl-button { 1.270 + // Bump up specificity by using [disabled] twice. 1.271 + &[disabled][disabled], 1.272 + &.mdl-button--disabled.mdl-button--disabled { 1.273 + color: $button-secondary-color-disabled; 1.274 + cursor: default; 1.275 + background-color: transparent; 1.276 + } 1.277 + 1.278 + &--fab { 1.279 + // Bump up specificity by using [disabled] twice. 1.280 + &[disabled][disabled], 1.281 + &.mdl-button--disabled.mdl-button--disabled { 1.282 + background-color: $button-primary-color-disabled; 1.283 + color: $button-secondary-color-disabled; 1.284 + } 1.285 + } 1.286 + 1.287 + &--raised { 1.288 + // Bump up specificity by using [disabled] twice. 1.289 + &[disabled][disabled], 1.290 + &.mdl-button--disabled.mdl-button--disabled { 1.291 + background-color: $button-primary-color-disabled; 1.292 + color: $button-secondary-color-disabled; 1.293 + box-shadow: none; 1.294 + } 1.295 + } 1.296 + &--colored { 1.297 + // Bump up specificity by using [disabled] twice. 1.298 + &[disabled][disabled], 1.299 + &.mdl-button--disabled.mdl-button--disabled { 1.300 + color: $button-secondary-color-disabled; 1.301 + } 1.302 + } 1.303 +} 1.304 + 1.305 +// Align icons inside buttons with text 1.306 +.mdl-button .material-icons { 1.307 + vertical-align: middle; 1.308 +}