commonroutesApp/www/lib/angular-material/modules/scss/angular-material.layout-attributes.scss
www/lib/angular-material/modules/scss/angular-material.layout-attributes.scssRaw
1$font-family: Roboto, 'Helvetica Neue', sans-serif !default;
2$font-size: 10px !default;
3$display-4-font-size-base: rem(11.20) !default;
4$display-3-font-size-base: rem(5.600) !default;
5$display-2-font-size-base: rem(4.500) !default;
6$display-1-font-size-base: rem(3.400) !default;
7$headline-font-size-base: rem(2.400) !default;
8$title-font-size-base: rem(2.000) !default;
9$subhead-font-size-base: rem(1.600) !default;
10$body-font-size-base: rem(1.400) !default;
11$caption-font-size-base: rem(1.200) !default;
12$baseline-grid: 8px !default;
13$layout-gutter-width: ($baseline-grid * 2) !default;
14$layout-breakpoint-xs: 600px !default;
15$layout-breakpoint-sm: 960px !default;
16$layout-breakpoint-md: 1280px !default;
17$layout-breakpoint-lg: 1920px !default;
18$button-left-right-padding: rem(0.600) !default;
19$icon-size: rem(2.400) !default;
20$app-bar-height: 64px !default;
21$toast-height: $baseline-grid * 3 !default;
22$toast-margin: $baseline-grid * 1 !default;
23$shadow-key-umbra-opacity: 0.2 !default;
24$shadow-key-penumbra-opacity: 0.14 !default;
25$shadow-ambient-shadow-opacity: 0.12 !default;
26$whiteframe-shadow-1dp: 0px 1px 3px 0px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 1px 1px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 2px 1px -1px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
27$whiteframe-shadow-2dp: 0px 1px 5px 0px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 2px 2px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 3px 1px -2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
28$whiteframe-shadow-3dp: 0px 1px 8px 0px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 3px 4px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 3px 3px -2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
29$whiteframe-shadow-4dp: 0px 2px 4px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 4px 5px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 1px 10px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
30$whiteframe-shadow-5dp: 0px 3px 5px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 5px 8px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 1px 14px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
31$whiteframe-shadow-6dp: 0px 3px 5px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 6px 10px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 1px 18px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
32$whiteframe-shadow-7dp: 0px 4px 5px -2px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 7px 10px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 2px 16px 1px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
33$whiteframe-shadow-8dp: 0px 5px 5px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 8px 10px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 3px 14px 2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
34$whiteframe-shadow-9dp: 0px 5px 6px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 9px 12px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 3px 16px 2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
35$whiteframe-shadow-10dp: 0px 6px 6px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 10px 14px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 4px 18px 3px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
36$whiteframe-shadow-11dp: 0px 6px 7px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 11px 15px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 4px 20px 3px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
37$whiteframe-shadow-12dp: 0px 7px 8px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 12px 17px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 5px 22px 4px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
38$whiteframe-shadow-13dp: 0px 7px 8px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 13px 19px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 5px 24px 4px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
39$whiteframe-shadow-14dp: 0px 7px 9px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 14px 21px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 5px 26px 4px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
40$whiteframe-shadow-15dp: 0px 8px 9px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 15px 22px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 6px 28px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
41$whiteframe-shadow-16dp: 0px 8px 10px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 16px 24px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 6px 30px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
42$whiteframe-shadow-17dp: 0px 8px 11px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 17px 26px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 6px 32px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
43$whiteframe-shadow-18dp: 0px 9px 11px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 18px 28px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 7px 34px 6px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
44$whiteframe-shadow-19dp: 0px 9px 12px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 19px 29px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 7px 36px 6px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
45$whiteframe-shadow-20dp: 0px 10px 13px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 20px 31px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 8px 38px 7px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
46$whiteframe-shadow-21dp: 0px 10px 13px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 21px 33px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 8px 40px 7px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
47$whiteframe-shadow-22dp: 0px 10px 14px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 22px 35px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 8px 42px 7px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
48$whiteframe-shadow-23dp: 0px 11px 14px -7px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 23px 36px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 9px 44px 8px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
49$whiteframe-shadow-24dp: 0px 11px 15px -7px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 24px 38px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 9px 46px 8px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
50$z-index-toast: 105 !default;
51$z-index-tooltip: 100 !default;
52$z-index-menu: 100 !default;
53$z-index-calendar-pane: 100 !default;
54$z-index-select: 90 !default;
55$z-index-dialog: 80 !default;
56$z-index-bottom-sheet: 70 !default;
57$z-index-scroll-mask: 50 !default;
58$z-index-scroll-mask-bar: 65 !default;
59$z-index-sidenav: 60 !default;
60$z-index-backdrop: 50 !default;
61$z-index-fab: 20 !default;
62$z-index-progress-circular: 2 !default; // Used to fix animation bug in Chrome
63$swift-ease-out-duration: 0.4s !default;
64$swift-ease-out-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
65$swift-ease-out: all $swift-ease-out-duration $swift-ease-out-timing-function !default;
66$swift-ease-in-duration: 0.3s !default;
67$swift-ease-in-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2) !default;
68$swift-ease-in: all $swift-ease-in-duration $swift-ease-in-timing-function !default;
69$swift-ease-in-out-duration: 0.5s !default;
70$swift-ease-in-out-timing-function: cubic-bezier(0.35, 0, 0.25, 1) !default;
71$swift-ease-in-out: all $swift-ease-in-out-duration $swift-ease-in-out-timing-function !default;
72$swift-linear-duration: 0.08s !default;
73$swift-linear-timing-function: linear !default;
74$swift-linear: all $swift-linear-duration $swift-linear-timing-function !default;
75$material-enter-duration: 0.3s;
76$material-enter-timing-function: cubic-bezier(0.0, 0.0, 0.2, 1);
77$material-enter: all $material-enter-duration $material-enter-timing-function;
78$material-leave-duration: 0.3s;
79$material-leave-timing-function: cubic-bezier(0.4, 0.0, 1, 1);
80$material-leave: all $material-leave-duration $material-leave-timing-function;
81$button-fab-width: rem(5.600) !default;
82$button-fab-height: rem(5.600) !default;
83$button-fab-padding: rem(1.60) !default;
84$checkbox-width: 20px !default;
85$checkbox-height: $checkbox-width !default;
86$checkbox-border-radius: 2px !default;
87$checkbox-border-width: 2px !default;
88$baseline-grid: 8px !default;
89$layout-gutter-width: ($baseline-grid * 2) !default;
90$layout-breakpoint-xs: 600px !default;
91$layout-breakpoint-sm: 960px !default;
92$layout-breakpoint-md: 1280px !default;
93$layout-breakpoint-lg: 1920px !default;
94// Function
95//-- Must be defined before variables
96@function rem($multiplier) {
97 $font-size: 10px;
98 @return $multiplier * $font-size;
99}
100
101// Typography
102// ------------------------------
103
104
105
106// Layout
107// ------------------------------
108
109
110
111// Button
112
113// Icon
114
115// App bar variables
116
117
118// Whiteframes
119
120
121// NOTE(shyndman): gulp-sass seems to be failing if I split the shadow defs across
122// multiple lines. Ugly. Sorry.
123
124// Z-indexes
125//--------------------------------------------
126
127
128// Easing Curves
129//--------------------------------------------
130
131
132
133
134
135
136
137// Fab Buttons (shared between buttons.scss and fab*.scss)
138// -------------------------------------------
139
140
141// Shared Checkbox variables
142
143@mixin margin-selectors($before:1em, $after:1em, $start:0px, $end:0px) {
144 -webkit-margin-before: $before;
145 -webkit-margin-after: $after;
146 -webkit-margin-start: $start;
147 -webkit-margin-end: $end;
148}
149
150@mixin not-selectable($value:none) {
151 -webkit-touch-callout: $value;
152 -webkit-user-select: $value;
153 -khtml-user-select: $value;
154 -moz-user-select: $value;
155 -ms-user-select: $value;
156 user-select: $value;
157}
158
159@mixin input-placeholder-color($color) {
160 $pseudos: '::-webkit-input-placeholder', ':-moz-placeholder', '::-moz-placeholder',
161 ':-ms-input-placeholder', '::-webkit-input-placeholder';
162
163 // It is important to export every pseudo within its own block, because otherwise the placeholder
164 // won't be set on the most browsers.
165 @each $pseudo in $pseudos {
166 &#{$pseudo} {
167 color: unquote($color);
168 }
169 }
170}
171
172@mixin pie-clearfix {
173 &:after {
174 content: '';
175 display: table;
176 clear: both;
177 }
178}
179
180@mixin md-shadow-bottom-z-1() {
181 box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
182}
183
184@mixin md-shadow-bottom-z-2() {
185 box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4);
186}
187
188// Mixin for a "flat" input that can be used for components that contain an input
189// (datepicker, autocomplete).
190@mixin md-flat-input() {
191 font-size: 14px;
192
193 box-sizing: border-box;
194 border: none;
195 box-shadow: none;
196 outline: none;
197 background: transparent;
198
199 // The "clear X" that IE adds to input[type="search"]
200 &::-ms-clear {
201 display: none;
202 }
203}
204
205// Typography mixins
206
207@mixin md-title() {
208 font-size: $title-font-size-base;
209 font-weight: 500;
210 letter-spacing: 0.005em;
211}
212
213@mixin md-body-1() {
214 font-size: $body-font-size-base;
215 font-weight: 400;
216 letter-spacing: 0.010em;
217 line-height: rem(2);
218}
219
220@mixin md-body-2() {
221 font-size: $body-font-size-base;
222 font-weight: 500;
223 letter-spacing: 0.010em;
224 line-height: rem(2.4);
225}
226
227@mixin md-subhead() {
228 font-size: $subhead-font-size-base;
229 font-weight: 400;
230 letter-spacing: 0.010em;
231 line-height: rem(2.4);
232}
233
234@function map-to-string($map) {
235 $map-str: '{';
236 $keys: map-keys($map);
237 $len: length($keys);
238 @for $i from 1 through $len {
239 $key: nth($keys, $i);
240 $value: map-get($map, $key);
241 $map-str: $map-str + '_' + $key + '_: _' + map-get($map, $key) + '_';
242 @if $i != $len {
243 $map-str: $map-str + ',';
244 }
245 }
246 @return $map-str + '}';
247}
248
249// This is a mixin, which fixes IE11's vertical alignment issue, when using `min-height`.
250// See https://connect.microsoft.com/IE/feedback/details/816293/
251@mixin ie11-min-height-flexbug($min-height) {
252 &::before {
253 content: '';
254 min-height: $min-height;
255 visibility: hidden;
256 display: inline-block;
257 }
258}
259
260// mixin definition ; sets LTR and RTL within the same style call
261// @see https://css-tricks.com/almanac/properties/d/direction/
262
263@mixin rtl($prop, $ltr-value, $rtl-value) {
264 #{$prop}: $ltr-value;
265 [dir=rtl] & {
266 #{$prop}: $rtl-value;
267 }
268}
269
270@mixin rtl-prop($ltr-prop, $rtl-prop, $value, $reset-value) {
271 #{$ltr-prop}: $value;
272 [dir=rtl] & {
273 #{$ltr-prop}: $reset-value;
274 #{$rtl-prop}: $value;
275 }
276}
277
278// To reverse padding (top left bottom right) -> (top right bottom left)
279@function rtl-value($list) {
280 @if length($list) == 4 {
281 @return nth($list, 1) nth($list, 4) nth($list, 3) nth($list, 2)
282 }
283 @if length($list) == 5 {
284 @return nth($list, 1) nth($list, 4) nth($list, 3) nth($list, 2) nth($list, 5)
285 }
286 @return $list;
287}
288
289// Position a FAB button.
290@mixin fab-position($spot, $top: auto, $right: auto, $bottom: auto, $left: auto) {
291 &.md-fab-#{$spot} {
292 top: $top;
293 right: $right;
294 bottom: $bottom;
295 left: $left;
296 position: absolute;
297 }
298}
299
300@mixin fab-all-positions() {
301 @include fab-position(bottom-right, auto, ($button-fab-width - $button-fab-padding)/2, ($button-fab-height - $button-fab-padding)/2, auto);
302 @include fab-position(bottom-left, auto, auto, ($button-fab-height - $button-fab-padding)/2, ($button-fab-width - $button-fab-padding)/2);
303 @include fab-position(top-right, ($button-fab-height - $button-fab-padding)/2, ($button-fab-width - $button-fab-padding)/2, auto, auto);
304 @include fab-position(top-left, ($button-fab-height - $button-fab-padding)/2, auto, auto, ($button-fab-width - $button-fab-padding)/2);
305}
306
307// This mixin allows a user to use the md-checkbox css outside of the
308// md-checkbox directive.
309// See src/components/select/select.scss for an example.
310@mixin checkbox-container(
311 $checkedSelector: '.md-checked',
312 $width: $checkbox-width,
313 $height: $checkbox-height,
314 $border-width: $checkbox-border-width,
315 $border-radius: $checkbox-border-radius) {
316 .md-container {
317 position: absolute;
318 top: 50%;
319 transform: translateY(-50%);
320
321 box-sizing: border-box;
322 display: inline-block;
323
324 width: $width;
325 height: $height;
326 @include rtl(left, 0, auto);
327 @include rtl(right, auto, 0);
328
329 &:before {
330 box-sizing: border-box;
331 background-color: transparent;
332 border-radius: 50%;
333 content: '';
334 position: absolute;
335 display: block;
336 height: auto;
337 left: 0;
338 top: 0;
339 right: 0;
340 bottom: 0;
341 transition: all 0.5s;
342 width: auto;
343 }
344
345 &:after {
346 box-sizing: border-box;
347 content: '';
348 position: absolute;
349 top: -10px;
350 right: -10px;
351 bottom: -10px;
352 left: -10px;
353 }
354
355 .md-ripple-container {
356 position: absolute;
357 display: block;
358 width: auto;
359 height: auto;
360 left: -15px;
361 top: -15px;
362 right: -15px;
363 bottom: -15px;
364 }
365 }
366
367 // unchecked
368 .md-icon {
369 box-sizing: border-box;
370 transition: 240ms;
371 position: absolute;
372 top: 0;
373 left: 0;
374 width: $width;
375 height: $height;
376 border-width: $border-width;
377 border-style: solid;
378 border-radius: $border-radius;
379 }
380
381 &#{$checkedSelector} .md-icon {
382 border-color: transparent;
383
384 &:after {
385 box-sizing: border-box;
386 transform: rotate(45deg);
387 position: absolute;
388 left: $width / 3 - $border-width;
389 top: $width / 9 - $border-width;
390 display: table;
391 width: $width / 3;
392 height: $width * 2 / 3;
393 border-width: $border-width;
394 border-style: solid;
395 border-top: 0;
396 border-left: 0;
397 content: '';
398 }
399 }
400
401 // disabled
402 &[disabled] {
403 cursor: default;
404 }
405
406 &.md-indeterminate .md-icon {
407 &:after {
408 box-sizing: border-box;
409 position: absolute;
410 top: 50%;
411 left: 50%;
412 transform: translate(-50%, -50%);
413 display: table;
414 width: $width * 0.6;
415 height: $border-width;
416 border-width: $border-width;
417 border-style: solid;
418 border-top: 0;
419 border-left: 0;
420 content: '';
421 }
422 }
423}
424
425// Mixin to create a primary checkbox.
426// Used by the checkbox and select component.
427@mixin checkbox-primary($checkedSelector: '.md-checked') {
428 .md-ripple {
429 color: '{{primary-600}}';
430 }
431
432 &#{$checkedSelector} .md-ripple {
433 color: '{{background-600}}';
434 }
435
436 .md-ink-ripple {
437 color: '{{foreground-2}}';
438 }
439
440 &#{$checkedSelector} .md-ink-ripple {
441 color: '{{primary-color-0.87}}';
442 }
443
444 &:not(.md-checked) .md-icon {
445 border-color: '{{foreground-2}}';
446 }
447
448 &#{$checkedSelector} .md-icon {
449 background-color: '{{primary-color-0.87}}';
450 }
451
452 &#{$checkedSelector}.md-focused .md-container:before {
453 background-color: '{{primary-color-0.26}}';
454 }
455
456 &#{$checkedSelector} .md-icon:after {
457 border-color: '{{primary-contrast-0.87}}';
458 }
459
460 & .md-indeterminate[disabled] {
461 .md-container {
462 color: '{{foreground-3}}';
463 }
464 }
465}
466
467/*
468*
469* Responsive attributes
470*
471* References:
472* 1) https://scotch.io/tutorials/a-visual-guide-to-css3-flexbox-properties#flex
473* 2) https://css-tricks.com/almanac/properties/f/flex/
474* 3) https://css-tricks.com/snippets/css/a-guide-to-flexbox/
475* 4) https://github.com/philipwalton/flexbugs#3-min-height-on-a-flex-container-wont-apply-to-its-flex-items
476* 5) http://godban.com.ua/projects/flexgrid
477*
478*/
479
480// Layout
481// ------------------------------
482
483
484
485@-moz-document url-prefix() {
486 [layout-fill] {
487 margin: 0;
488 width: 100%;
489 min-height: 100%;
490 height: 100%;
491 }
492}
493
494
495@mixin flex-order-for-name($sizes:null) {
496 @if $sizes == null {
497 $sizes : '';
498
499 [flex-order] {
500 order : 0;
501 }
502 }
503
504 @for $i from -20 through 20 {
505 $order : '';
506 $suffix : '';
507
508 @each $s in $sizes {
509 @if $s != '' { $suffix : '-#{$s}="#{$i}"'; }
510 @else { $suffix : '="#{$i}"'; }
511
512 $order : '[flex-order#{$suffix}]';
513 }
514
515 #{$order} {
516 order: #{$i};
517 }
518 }
519}
520@mixin offset-for-name($sizes:null) {
521 @if $sizes == null { $sizes : ''; }
522
523 @for $i from 0 through 19 {
524 $offsets : '';
525 $suffix : '';
526
527 @each $s in $sizes {
528 @if $s != '' { $suffix : '-#{$s}="#{$i * 5}"'; }
529 @else { $suffix : '="#{$i * 5}"'; }
530
531 $offsets : $offsets + '[flex-offset#{$suffix}], ';
532 }
533
534 #{$offsets} {
535 margin-left: #{$i * 5 + '%'};
536 }
537 }
538
539 @each $i in 33 {
540 $offsets : '';
541 $suffix : '';
542
543 @each $s in $sizes {
544 @if $s != '' { $suffix : '-#{$s}="#{$i}"'; }
545 @else { $suffix : '="#{$i}"'; }
546
547 $offsets : '[flex-offset#{$suffix}], ';
548 }
549
550 #{$offsets} {
551 margin-left: calc(100% / 3);
552 }
553 }
554
555 @each $i in 66 {
556 $offsets : '';
557 $suffix : '';
558
559 @each $s in $sizes {
560 @if $s != '' { $suffix : '-#{$s}="#{$i}"'; }
561 @else { $suffix : '="#{$i}"'; }
562
563 $offsets : '[flex-offset#{$suffix}]';
564 }
565
566 #{$offsets} {
567 margin-left: calc(200% / 3);
568 }
569 }
570}
571
572@mixin layout-for-name($name: null) {
573 @if $name == null { $name : ''; }
574 @if $name != '' { $name : '-#{$name}'; }
575
576 [layout#{$name}], [layout#{$name}="column"], [layout#{$name}="row"] {
577 box-sizing: border-box;
578 display: -webkit-box;
579 display: -webkit-flex;
580 display: -moz-box;
581 display: -ms-flexbox;
582 display: flex;
583 }
584 [layout#{$name}="column"] { flex-direction: column; }
585 [layout#{$name}="row"] { flex-direction: row; }
586}
587
588@mixin flex-properties-for-name($name: null) {
589 $flexName: 'flex';
590 @if $name != null {
591 $flexName: 'flex-#{$name}';
592 $name : '-#{$name}';
593 } @else {
594 $name : '';
595 }
596
597 [#{$flexName}] { flex: 1; box-sizing: border-box; } // === flex: 1 1 0%;
598
599 [#{$flexName}-grow] { flex: 1 1 100%; box-sizing: border-box; }
600 [#{$flexName}-initial] { flex: 0 1 auto; box-sizing: border-box; }
601 [#{$flexName}-auto] { flex: 1 1 auto; box-sizing: border-box; }
602 [#{$flexName}-none] { flex: 0 0 auto; box-sizing: border-box; }
603
604 // (1-20) * 5 = 0-100%
605 @for $i from 0 through 20 {
606 $value : #{$i * 5 + '%'};
607
608 [#{$flexName}="#{$i * 5}"] {
609 flex: 1 1 #{$value};
610 max-width: #{$value};
611 max-height: 100%;
612 box-sizing: border-box;
613 }
614
615 [layout="row"] > [#{$flexName}="#{$i * 5}"] {
616 flex: 1 1 #{$value};
617 max-width: #{$value};
618 max-height: 100%;
619 box-sizing: border-box;
620 }
621
622 [layout="column"] > [#{$flexName}="#{$i * 5}"] {
623 flex: 1 1 #{$value};
624 max-width: 100%;
625 max-height: #{$value};
626 box-sizing: border-box;
627 }
628
629 [layout="row"] {
630 > [#{$flexName}="33"] , > [#{$flexName}="33"] { flex: 1 1 33.33%; max-width: 33.33%; max-height: 100%; box-sizing: border-box; }
631 > [#{$flexName}="66"] , > [#{$flexName}="66"] { flex: 1 1 66.66%; max-width: 66.66%; max-height: 100%; box-sizing: border-box; }
632 }
633
634 [layout="column"] {
635 > [#{$flexName}="33"] , > [#{$flexName}="33"] { flex: 1 1 33.33%; max-width: 100%; max-height: 33.33%; box-sizing: border-box; }
636 > [#{$flexName}="66"] , > [#{$flexName}="66"] { flex: 1 1 66.66%; max-width: 100%; max-height: 66.66%; box-sizing: border-box; }
637 }
638
639 [layout#{$name}="row"] > [#{$flexName}="#{$i * 5}"] {
640 flex: 1 1 #{$value};
641 max-width: #{$value};
642 max-height: 100%;
643 box-sizing: border-box;
644 }
645
646 [layout#{$name}="column"] > [#{$flexName}="#{$i * 5}"] {
647 flex: 1 1 #{$value};
648 max-width: 100%;
649 max-height: #{$value};
650 box-sizing: border-box;
651 }
652 }
653
654 [layout#{$name}="row"] {
655 > [#{$flexName}="33"] , > [#{$flexName}="33"] { flex: 1 1 33.33%; max-width: 33.33%; max-height: 100%; box-sizing: border-box; }
656 > [#{$flexName}="66"] , > [#{$flexName}="66"] { flex: 1 1 66.66%; max-width: 66.66%; max-height: 100%; box-sizing: border-box; }
657 }
658
659 [layout#{$name}="column"] {
660 > [#{$flexName}="33"] , > [#{$flexName}="33"] { flex: 1 1 33.33%; max-width: 100%; max-height: 33.33%; box-sizing: border-box; }
661 > [#{$flexName}="66"] , > [#{$flexName}="66"] { flex: 1 1 66.66%; max-width: 100%; max-height: 66.66%; box-sizing: border-box; }
662 }
663
664}
665@mixin layout-align-for-name($suffix: null) {
666
667 // Alignment attributes for layout containers' children
668 // Arrange on the Main Axis
669 // center, start, end, space-between, space-around
670 // flex-start is the default for justify-content
671 // ------------------------------
672
673 $name: 'layout-align';
674 @if $suffix != null {
675 $name: 'layout-align-#{$suffix}';
676 }
677
678 [#{$name}],
679 [#{$name}="start stretch"] // defaults
680 {
681 justify-content :flex-start;
682 align-content : stretch;
683 align-items: stretch;
684 }
685 // Main Axis Center
686 [#{$name}="start"],
687 [#{$name}="start start"],
688 [#{$name}="start center"],
689 [#{$name}="start end"],
690 [#{$name}="start stretch"]
691 {
692 justify-content: flex-start;
693 }
694
695 // Main Axis Center
696 [#{$name}="center"],
697 [#{$name}="center start"],
698 [#{$name}="center center"],
699 [#{$name}="center end"],
700 [#{$name}="center stretch"]
701 {
702 justify-content: center;
703 }
704
705 // Main Axis End
706 [#{$name}="end"], //stretch
707 [#{$name}="end center"],
708 [#{$name}="end start"],
709 [#{$name}="end end"],
710 [#{$name}="end stretch"]
711 {
712 justify-content: flex-end;
713 }
714
715 // Main Axis Space Around
716 [#{$name}="space-around"], //stretch
717 [#{$name}="space-around center"],
718 [#{$name}="space-around start"],
719 [#{$name}="space-around end"],
720 [#{$name}="space-around stretch"]
721 {
722 justify-content: space-around;
723 }
724
725 // Main Axis Space Between
726 [#{$name}="space-between"], //stretch
727 [#{$name}="space-between center"],
728 [#{$name}="space-between start"],
729 [#{$name}="space-between end"],
730 [#{$name}="space-between stretch"]
731 {
732 justify-content: space-between;
733 }
734
735
736 // Arrange on the Cross Axis
737 // center, start, end
738 // stretch is the default for align-items
739 // ------------------------------
740
741 // Cross Axis Start
742 [#{$name}="start start"],
743 [#{$name}="center start"],
744 [#{$name}="end start"],
745 [#{$name}="space-between start"],
746 [#{$name}="space-around start"]
747 {
748 align-items: flex-start;
749 align-content: flex-start;
750 }
751
752 // Cross Axis Center
753 [#{$name}="start center"],
754 [#{$name}="center center"],
755 [#{$name}="end center"],
756 [#{$name}="space-between center"],
757 [#{$name}="space-around center"]
758 {
759 align-items: center;
760 align-content: center;
761 max-width: 100%;
762 }
763
764 // Cross Axis Center IE overflow fix
765 [#{$name}="start center"] > *,
766 [#{$name}="center center"] > *,
767 [#{$name}="end center"] > *,
768 [#{$name}="space-between center"] > *,
769 [#{$name}="space-around center"] > *
770 {
771 max-width: 100%;
772 box-sizing: border-box;
773 }
774
775 // Cross Axis End
776 [#{$name}="start end"],
777 [#{$name}="center end"],
778 [#{$name}="end end"],
779 [#{$name}="space-between end"],
780 [#{$name}="space-around end"]
781 {
782 align-items: flex-end;
783 align-content: flex-end;
784 }
785
786 // Cross Axis stretch
787 [#{$name}="start stretch"],
788 [#{$name}="center stretch"],
789 [#{$name}="end stretch"],
790 [#{$name}="space-between stretch"],
791 [#{$name}="space-around stretch"]
792 {
793 align-items: stretch;
794 align-content: stretch;
795 }
796}
797@mixin layout-padding-margin() {
798
799 [layout-padding] > [flex-sm], [layout-padding] > [flex-lt-md] {
800 padding: $layout-gutter-width / 4;
801 }
802 [layout-padding],
803 [layout-padding] > [flex],
804 [layout-padding] > [flex-gt-sm],
805 [layout-padding] > [flex-md],
806 [layout-padding] > [flex-lt-lg]
807 {
808 padding: $layout-gutter-width / 2;
809 }
810 [layout-padding] > [flex-gt-md],
811 [layout-padding] > [flex-lg]
812 {
813 padding: $layout-gutter-width / 1;
814 }
815
816 [layout-margin] > [flex-sm],
817 [layout-margin] > [flex-lt-md]
818 {
819 margin: $layout-gutter-width / 4;
820 }
821
822 [layout-margin],
823 [layout-margin] > [flex],
824 [layout-margin] > [flex-gt-sm],
825 [layout-margin] > [flex-md],
826 [layout-margin] > [flex-lt-lg]
827 {
828 margin: $layout-gutter-width / 2;
829 }
830
831 [layout-margin] > [flex-gt-md],
832 [layout-margin] > [flex-lg]
833 {
834 margin: $layout-gutter-width / 1;
835 }
836
837 [layout-wrap] {
838 flex-wrap: wrap;
839 }
840
841 [layout-nowrap] {
842 flex-wrap: nowrap;
843 }
844
845 [layout-fill] {
846 margin: 0;
847 width: 100%;
848 min-height: 100%;
849 height: 100%;
850 }
851}
852
853@mixin layouts_for_breakpoint($name:null) {
854 @include flex-order-for-name($name);
855 @include offset-for-name($name);
856 @include layout-align-for-name($name);
857
858 @include flex-properties-for-name($name);
859 @include layout-for-name($name);
860}
861
862/*
863 * Apply Mixins to create Layout/Flexbox styles
864 *
865 */
866
867
868@include layouts_for_breakpoint();
869@include layout-padding-margin();
870
871
872/**
873 * `hide-gt-sm show-gt-lg` should hide from 600px to 1200px
874 * `show-md hide-gt-sm` should show from 0px to 960px and hide at >960px
875 * `hide-gt-md show-gt-sm` should show everywhere (show overrides hide)`
876 *
877 * hide means hide everywhere
878 * Sizes:
879 * $layout-breakpoint-xs: 600px !default;
880 * $layout-breakpoint-sm: 960px !default;
881 * $layout-breakpoint-md: 1280px !default;
882 * $layout-breakpoint-lg: 1920px !default;
883 */
884
885
886@media (max-width: $layout-breakpoint-xs - 1) {
887 // Xtra-SMALL SCREEN
888 [hide-xs], [hide] {
889 &:not([show-xs]):not([show]) {
890 display: none;
891 }
892 }
893 @include layouts_for_breakpoint(xs);
894}
895
896@media (min-width: $layout-breakpoint-xs) {
897 // BIGGER THAN Xtra-SMALL SCREEN
898 @include layouts_for_breakpoint(gt-xs);
899
900}
901
902@media (min-width: $layout-breakpoint-xs) and (max-width: $layout-breakpoint-sm - 1) {
903 // SMALL SCREEN
904 [hide], [hide-gt-xs] {
905 &:not([show-gt-xs]):not([show-sm]):not([show]) {
906 display: none;
907 }
908 }
909 [hide-sm]:not([show-gt-xs]):not([show-sm]):not([show]) {
910 display: none;
911 }
912 @include layouts_for_breakpoint(sm);
913}
914
915@media (min-width: $layout-breakpoint-sm) {
916 // BIGGER THAN SMALL SCREEN
917 @include layouts_for_breakpoint(gt-sm);
918
919}
920
921@media (min-width: $layout-breakpoint-sm) and (max-width: $layout-breakpoint-md - 1) {
922 // MEDIUM SCREEN
923 [hide], [hide-gt-xs], [hide-gt-sm] {
924 &:not([show-gt-xs]):not([show-gt-sm]):not([show-md]):not([show]) {
925 display: none;
926 }
927 }
928 [hide-md]:not([show-md]):not([show]) {
929 display: none;
930 }
931 @include layouts_for_breakpoint(md);
932}
933
934@media (min-width: $layout-breakpoint-md) {
935 // BIGGER THAN MEDIUM SCREEN
936 @include layouts_for_breakpoint(gt-md);
937}
938
939@media (min-width: $layout-breakpoint-md) and (max-width: $layout-breakpoint-lg - 1) {
940 // LARGE SCREEN
941 [hide],[hide-gt-xs], [hide-gt-sm], [hide-gt-md] {
942 &:not([show-gt-xs]):not([show-gt-sm]):not([show-gt-md]):not([show-lg]):not([show]) {
943 display: none;
944 }
945 }
946 [hide-lg]:not([show-lg]):not([show]) {
947 display: none;
948 }
949
950 @include layouts_for_breakpoint(lg);
951}
952
953@media (min-width: $layout-breakpoint-lg) {
954 // BIGGER THAN LARGE SCREEN
955 @include layouts_for_breakpoint(gt-lg);
956 @include layouts_for_breakpoint(xl);
957
958 // BIGGER THAN LARGE SCREEN
959 [hide], [hide-gt-xs], [hide-gt-sm], [hide-gt-md], [hide-gt-lg] {
960 &:not([show-gt-xs]):not([show-gt-sm]):not([show-gt-md]):not([show-gt-lg]):not([show-xl]):not([show]) {
961 display: none;
962 }
963 }
964 [hide-xl]:not([show-xl]):not([show-gt-lg]):not([show]) {
965 display: none;
966 }
967}
968
969@media print {
970 // PRINT
971 @include layouts_for_breakpoint(print);
972
973 [hide-print]:not([show-print]):not([show]) {
974 display: none;
975 }
976}
977
978