UNPKG

1.98 kBSCSSView Raw
1// Foundation for Sites by ZURB
2// foundation.zurb.com
3// Licensed under MIT Open Source
4
5////
6/// @group prototype-overflow
7////
8
9/// Responsive breakpoints for overflow helper classes
10/// @type Boolean
11$prototype-overflow-breakpoints: $global-prototype-breakpoints !default;
12
13/// Map containing all the `overflow` classes
14/// @type Map
15$prototype-overflow: (
16 visible,
17 hidden,
18 scroll
19) !default;
20
21/// Overflow classes, by default coming through a map `$prototype-overflow`
22/// @param {String} $overflow [] Overflow classes
23@mixin overflow($overflow) {
24 overflow: $overflow !important;
25}
26
27/// Overflow classes on horizontal axis, by default coming through a map `$prototype-overflow`
28/// @param {String} $overflow [] Overflow classes (horizontal axis)
29@mixin overflow-x($overflow) {
30 overflow-x: $overflow !important;
31}
32
33/// Overflow classes on vertical axis, by default coming through a map `$prototype-overflow`
34/// @param {String} $overflow [] Overflow classes (vertical axis)
35@mixin overflow-y($overflow) {
36 overflow-y: $overflow !important;
37}
38
39@mixin foundation-prototype-overflow {
40 @each $overflow in $prototype-overflow {
41 .overflow-#{$overflow} {
42 @include overflow($overflow);
43 }
44 .overflow-x-#{$overflow} {
45 @include overflow-x($overflow);
46 }
47 .overflow-y-#{$overflow} {
48 @include overflow-y($overflow);
49 }
50 }
51
52 @if ($prototype-overflow-breakpoints) {
53 // Loop through Responsive Breakpoints
54 @each $size in $breakpoint-classes {
55 @include breakpoint($size) {
56 @each $overflow in $prototype-overflow {
57 @if $size != $-zf-zero-breakpoint {
58 .#{$size}-overflow-#{$overflow} {
59 @include overflow($overflow);
60 }
61 .#{$size}-overflow-x-#{$overflow} {
62 @include overflow-x($overflow);
63 }
64 .#{$size}-overflow-y-#{$overflow} {
65 @include overflow-y($overflow);
66 }
67 }
68 }
69 }
70 }
71 }
72}