1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | @mixin show-for($size) {
|
8 | $size: map-get($breakpoints, $size);
|
9 | $size: -zf-bp-to-em($size) - (1 / 16);
|
10 |
|
11 | @include breakpoint($size down) {
|
12 | display: none !important;
|
13 | }
|
14 | }
|
15 |
|
16 |
|
17 |
|
18 | @mixin show-for-only($size) {
|
19 | $lower-bound-size: map-get($breakpoints, $size);
|
20 | $upper-bound-size: -zf-map-next($breakpoints, $size);
|
21 |
|
22 |
|
23 | $lower-bound: -zf-bp-to-em($lower-bound-size) - (1 / 16);
|
24 |
|
25 | @if strip-unit($lower-bound-size) == 0 {
|
26 | $lower-bound: -zf-bp-to-em($lower-bound-size);
|
27 | }
|
28 |
|
29 | @if $upper-bound-size == null {
|
30 | @media screen and (max-width: $lower-bound) {
|
31 | display: none !important;
|
32 | }
|
33 | }
|
34 | @else {
|
35 | $upper-bound: -zf-bp-to-em($upper-bound-size);
|
36 |
|
37 | @media screen and (max-width: $lower-bound), screen and (min-width: $upper-bound) {
|
38 | display: none !important;
|
39 | }
|
40 | }
|
41 | }
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | @mixin hide-for($size) {
|
47 | @include breakpoint($size) {
|
48 | display: none !important;
|
49 | }
|
50 | }
|
51 |
|
52 |
|
53 |
|
54 | @mixin hide-for-only($size) {
|
55 | @include breakpoint($size only) {
|
56 | display: none !important;
|
57 | }
|
58 | }
|
59 |
|
60 | @mixin foundation-visibility-classes {
|
61 |
|
62 | .hide {
|
63 | display: none !important;
|
64 | }
|
65 |
|
66 | .invisible {
|
67 | visibility: hidden;
|
68 | }
|
69 |
|
70 |
|
71 | @each $size in $breakpoint-classes {
|
72 | @if $size != $-zf-zero-breakpoint {
|
73 | .hide-for-#{$size} {
|
74 | @include hide-for($size);
|
75 | }
|
76 |
|
77 | .show-for-#{$size} {
|
78 | @include show-for($size);
|
79 | }
|
80 | }
|
81 |
|
82 | .hide-for-#{$size}-only {
|
83 | @include hide-for-only($size);
|
84 | }
|
85 |
|
86 | .show-for-#{$size}-only {
|
87 | @include show-for-only($size);
|
88 | }
|
89 | }
|
90 |
|
91 |
|
92 |
|
93 | .show-for-sr,
|
94 | .show-on-focus {
|
95 | @include element-invisible;
|
96 | }
|
97 |
|
98 |
|
99 | .show-on-focus {
|
100 | &:active,
|
101 | &:focus {
|
102 | @include element-invisible-off;
|
103 | }
|
104 | }
|
105 |
|
106 |
|
107 | .show-for-landscape,
|
108 | .hide-for-portrait {
|
109 | display: block !important;
|
110 |
|
111 | @include breakpoint(landscape) {
|
112 | display: block !important;
|
113 | }
|
114 |
|
115 | @include breakpoint(portrait) {
|
116 | display: none !important;
|
117 | }
|
118 | }
|
119 |
|
120 | .hide-for-landscape,
|
121 | .show-for-portrait {
|
122 | display: none !important;
|
123 |
|
124 | @include breakpoint(landscape) {
|
125 | display: none !important;
|
126 | }
|
127 |
|
128 | @include breakpoint(portrait) {
|
129 | display: block !important;
|
130 | }
|
131 | }
|
132 | }
|