liquid_feedback_frontend
diff style/mdl/grid/_grid.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/grid/_grid.scss Sun Jul 15 14:07:29 2018 +0200 1.3 @@ -0,0 +1,231 @@ 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 +* NOTE: Some rules here are applied using duplicate selectors. 1.22 +* This is on purpose to increase their specificity when applied. 1.23 +* For example: `.mdl-cell--1-col-phone.mdl-cell--1-col-phone` 1.24 +*/ 1.25 + 1.26 +@import "../variables"; 1.27 + 1.28 +.mdl-grid { 1.29 + display: flex; 1.30 + flex-flow: row wrap; 1.31 + margin: 0 auto 0 auto; 1.32 + align-items: stretch; 1.33 + 1.34 + &.mdl-grid--no-spacing { 1.35 + padding: 0; 1.36 + } 1.37 +} 1.38 + 1.39 +.mdl-cell { 1.40 + box-sizing: border-box; 1.41 +} 1.42 + 1.43 + 1.44 +.mdl-cell--top { 1.45 + align-self: flex-start; 1.46 +} 1.47 + 1.48 +.mdl-cell--middle { 1.49 + align-self: center; 1.50 +} 1.51 + 1.52 +.mdl-cell--bottom { 1.53 + align-self: flex-end; 1.54 +} 1.55 + 1.56 +.mdl-cell--stretch { 1.57 + align-self: stretch; 1.58 +} 1.59 + 1.60 +.mdl-grid.mdl-grid--no-spacing > .mdl-cell { 1.61 + margin: 0; 1.62 +} 1.63 + 1.64 +// Define order override classes. 1.65 +@for $i from 1 through $grid-max-columns { 1.66 + .mdl-cell--order-#{$i} { 1.67 + order: $i; 1.68 + } 1.69 +} 1.70 + 1.71 + 1.72 +// Mixins for width calculation. 1.73 +@mixin partial-size($size, $columns, $gutter) { 1.74 + width: calc(#{(($size / $columns) * 100)+"%"} - #{$gutter}); 1.75 + 1.76 + .mdl-grid--no-spacing > & { 1.77 + width: #{(($size / $columns) * 100)+"%"}; 1.78 + } 1.79 +} 1.80 + 1.81 +@mixin full-size($gutter) { 1.82 + @include partial-size(1, 1, $gutter); 1.83 +} 1.84 + 1.85 +@mixin offset-size($size, $columns, $gutter) { 1.86 + margin-left: calc(#{(($size / $columns) * 100)+"%"} + #{$gutter / 2}); 1.87 + 1.88 + .mdl-grid.mdl-grid--no-spacing > & { 1.89 + margin-left: #{(($size / $columns) * 100)+"%"}; 1.90 + } 1.91 +} 1.92 + 1.93 + 1.94 + 1.95 +////////// Phone ////////// 1.96 + 1.97 +@media (max-width: $grid-tablet-breakpoint - 1) { 1.98 + .mdl-grid { 1.99 + padding: $grid-phone-margin - ($grid-phone-gutter / 2); 1.100 + } 1.101 + 1.102 + .mdl-cell { 1.103 + margin: $grid-phone-gutter / 2; 1.104 + @include partial-size($grid-cell-default-columns, $grid-phone-columns, 1.105 + $grid-phone-gutter); 1.106 + } 1.107 + 1.108 + .mdl-cell--hide-phone { 1.109 + display: none !important; 1.110 + } 1.111 + 1.112 + // Define order override classes. 1.113 + @for $i from 1 through $grid-max-columns { 1.114 + .mdl-cell--order-#{$i}-phone.mdl-cell--order-#{$i}-phone { 1.115 + order: $i; 1.116 + } 1.117 + } 1.118 + 1.119 + // Define partial sizes for columnNumber < totalColumns. 1.120 + @for $i from 1 through ($grid-phone-columns - 1) { 1.121 + .mdl-cell--#{$i}-col, 1.122 + .mdl-cell--#{$i}-col-phone.mdl-cell--#{$i}-col-phone { 1.123 + @include partial-size($i, $grid-phone-columns, $grid-phone-gutter); 1.124 + } 1.125 + } 1.126 + 1.127 + // Define 100% for everything else. 1.128 + @for $i from $grid-phone-columns through $grid-desktop-columns { 1.129 + .mdl-cell--#{$i}-col, 1.130 + .mdl-cell--#{$i}-col-phone.mdl-cell--#{$i}-col-phone { 1.131 + @include full-size($grid-phone-gutter); 1.132 + } 1.133 + } 1.134 + 1.135 + // Define valid phone offsets. 1.136 + @for $i from 1 through ($grid-phone-columns - 1) { 1.137 + .mdl-cell--#{$i}-offset, 1.138 + .mdl-cell--#{$i}-offset-phone.mdl-cell--#{$i}-offset-phone { 1.139 + @include offset-size($i, $grid-phone-columns, $grid-phone-gutter); 1.140 + } 1.141 + } 1.142 +} 1.143 + 1.144 + 1.145 +////////// Tablet ////////// 1.146 + 1.147 +@media (min-width: $grid-tablet-breakpoint) and (max-width: $grid-desktop-breakpoint - 1) { 1.148 + .mdl-grid { 1.149 + padding: $grid-tablet-margin - ($grid-tablet-gutter / 2); 1.150 + } 1.151 + 1.152 + .mdl-cell { 1.153 + margin: $grid-tablet-gutter / 2; 1.154 + @include partial-size($grid-cell-default-columns, $grid-tablet-columns, 1.155 + $grid-tablet-gutter); 1.156 + } 1.157 + 1.158 + .mdl-cell--hide-tablet { 1.159 + display: none !important; 1.160 + } 1.161 + 1.162 + // Define order override classes. 1.163 + @for $i from 1 through $grid-max-columns { 1.164 + .mdl-cell--order-#{$i}-tablet.mdl-cell--order-#{$i}-tablet { 1.165 + order: $i; 1.166 + } 1.167 + } 1.168 + 1.169 + // Define partial sizes for columnNumber < totalColumns. 1.170 + @for $i from 1 through ($grid-tablet-columns - 1) { 1.171 + .mdl-cell--#{$i}-col, 1.172 + .mdl-cell--#{$i}-col-tablet.mdl-cell--#{$i}-col-tablet { 1.173 + @include partial-size($i, $grid-tablet-columns, $grid-tablet-gutter); 1.174 + } 1.175 + } 1.176 + 1.177 + // Define 100% for everything else. 1.178 + @for $i from $grid-tablet-columns through $grid-desktop-columns { 1.179 + .mdl-cell--#{$i}-col, 1.180 + .mdl-cell--#{$i}-col-tablet.mdl-cell--#{$i}-col-tablet { 1.181 + @include full-size($grid-tablet-gutter); 1.182 + } 1.183 + } 1.184 + 1.185 + // Define valid tablet offsets. 1.186 + @for $i from 1 through ($grid-tablet-columns - 1) { 1.187 + .mdl-cell--#{$i}-offset, 1.188 + .mdl-cell--#{$i}-offset-tablet.mdl-cell--#{$i}-offset-tablet { 1.189 + @include offset-size($i, $grid-tablet-columns, $grid-tablet-gutter); 1.190 + } 1.191 + } 1.192 +} 1.193 + 1.194 + 1.195 +////////// Desktop ////////// 1.196 + 1.197 +@media (min-width: $grid-desktop-breakpoint) { 1.198 + .mdl-grid { 1.199 + padding: $grid-desktop-margin - ($grid-desktop-gutter / 2); 1.200 + } 1.201 + 1.202 + .mdl-cell { 1.203 + margin: $grid-desktop-gutter / 2; 1.204 + @include partial-size($grid-cell-default-columns, $grid-desktop-columns, 1.205 + $grid-desktop-gutter); 1.206 + } 1.207 + 1.208 + .mdl-cell--hide-desktop { 1.209 + display: none !important; 1.210 + } 1.211 + 1.212 + // Define order override classes. 1.213 + @for $i from 1 through $grid-max-columns { 1.214 + .mdl-cell--order-#{$i}-desktop.mdl-cell--order-#{$i}-desktop { 1.215 + order: $i; 1.216 + } 1.217 + } 1.218 + 1.219 + // Define partial sizes for all numbers of columns. 1.220 + @for $i from 1 through $grid-desktop-columns { 1.221 + .mdl-cell--#{$i}-col, 1.222 + .mdl-cell--#{$i}-col-desktop.mdl-cell--#{$i}-col-desktop { 1.223 + @include partial-size($i, $grid-desktop-columns, $grid-desktop-gutter); 1.224 + } 1.225 + } 1.226 + 1.227 + // Define valid desktop offsets. 1.228 + @for $i from 1 through ($grid-desktop-columns - 1) { 1.229 + .mdl-cell--#{$i}-offset, 1.230 + .mdl-cell--#{$i}-offset-desktop.mdl-cell--#{$i}-offset-desktop { 1.231 + @include offset-size($i, $grid-desktop-columns, $grid-desktop-gutter); 1.232 + } 1.233 + } 1.234 +}