1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | $prototype-spacing-breakpoints: $global-prototype-breakpoints !default;
|
12 |
|
13 |
|
14 |
|
15 | $prototype-spacers-count: 3 !default;
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | @mixin margin(
|
23 | $top: null,
|
24 | $right: null,
|
25 | $bottom: null,
|
26 | $left: null
|
27 | ) {
|
28 | @if $top != null {
|
29 | margin-top: $top * $global-margin !important;
|
30 | }
|
31 | @if $right != null {
|
32 | margin-right: $right * $global-margin !important;
|
33 | }
|
34 | @if $bottom != null {
|
35 | margin-bottom: $bottom * $global-margin !important;
|
36 | }
|
37 | @if $left != null {
|
38 | margin-left: $left * $global-margin !important;
|
39 | }
|
40 | }
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 | @mixin padding(
|
48 | $top: null,
|
49 | $right: null,
|
50 | $bottom: null,
|
51 | $left: null
|
52 | ) {
|
53 | @if $top != null {
|
54 | padding-top: $top * $global-padding !important;
|
55 | }
|
56 | @if $right != null {
|
57 | padding-right: $right * $global-padding !important;
|
58 | }
|
59 | @if $bottom != null {
|
60 | padding-bottom: $bottom * $global-padding !important;
|
61 | }
|
62 | @if $left != null {
|
63 | padding-left: $left * $global-padding !important;
|
64 | }
|
65 | }
|
66 |
|
67 | @mixin foundation-prototype-spacing {
|
68 | @for $spacer from 0 through $prototype-spacers-count {
|
69 |
|
70 | .margin-#{$spacer} {
|
71 | @include margin($spacer, $spacer, $spacer, $spacer);
|
72 | }
|
73 |
|
74 | .padding-#{$spacer} {
|
75 | @include padding($spacer, $spacer, $spacer, $spacer);
|
76 | }
|
77 |
|
78 |
|
79 | .margin-top-#{$spacer} {
|
80 | @include margin($spacer, null, null, null);
|
81 | }
|
82 |
|
83 | .padding-top-#{$spacer} {
|
84 | @include padding($spacer, null, null, null);
|
85 | }
|
86 |
|
87 |
|
88 | .margin-right-#{$spacer} {
|
89 | @include margin(null, $spacer, null, null);
|
90 | }
|
91 |
|
92 | .padding-right-#{$spacer} {
|
93 | @include padding(null, $spacer, null, null);
|
94 | }
|
95 |
|
96 |
|
97 | .margin-bottom-#{$spacer} {
|
98 | @include margin(null, null, $spacer, null);
|
99 | }
|
100 |
|
101 | .padding-bottom-#{$spacer} {
|
102 | @include padding(null, null, $spacer, null);
|
103 | }
|
104 |
|
105 |
|
106 | .margin-left-#{$spacer} {
|
107 | @include margin(null, null, null, $spacer);
|
108 | }
|
109 |
|
110 | .padding-left-#{$spacer} {
|
111 | @include padding(null, null, null, $spacer);
|
112 | }
|
113 |
|
114 |
|
115 | .margin-horizontal-#{$spacer} {
|
116 | @include margin(null, $spacer, null, $spacer);
|
117 | }
|
118 |
|
119 | .padding-horizontal-#{$spacer} {
|
120 | @include padding(null, $spacer, null, $spacer);
|
121 | }
|
122 |
|
123 |
|
124 | .margin-vertical-#{$spacer} {
|
125 | @include margin($spacer, null, $spacer, null)
|
126 | }
|
127 |
|
128 | .padding-vertical-#{$spacer} {
|
129 | @include padding($spacer, null, $spacer, null)
|
130 | }
|
131 |
|
132 | @if ($prototype-spacing-breakpoints) {
|
133 |
|
134 | @each $size in $breakpoint-classes {
|
135 | @include breakpoint($size) {
|
136 | @if $size != $-zf-zero-breakpoint {
|
137 |
|
138 | .#{$size}-margin-#{$spacer} {
|
139 | @include margin($spacer, $spacer, $spacer, $spacer);
|
140 | }
|
141 |
|
142 | .#{$size}-padding-#{$spacer} {
|
143 | @include padding($spacer, $spacer, $spacer, $spacer);
|
144 | }
|
145 |
|
146 |
|
147 | .#{$size}-margin-top-#{$spacer} {
|
148 | @include margin($spacer, null, null, null);
|
149 | }
|
150 |
|
151 | .#{$size}-padding-top-#{$spacer} {
|
152 | @include padding($spacer, null, null, null);
|
153 | }
|
154 |
|
155 |
|
156 | .#{$size}-margin-right-#{$spacer} {
|
157 | @include margin(null, $spacer, null, null);
|
158 | }
|
159 |
|
160 | .#{$size}-padding-right-#{$spacer} {
|
161 | @include padding(null, $spacer, null, null);
|
162 | }
|
163 |
|
164 |
|
165 | .#{$size}-margin-bottom-#{$spacer} {
|
166 | @include margin(null, null, $spacer, null);
|
167 | }
|
168 |
|
169 | .#{$size}-padding-bottom-#{$spacer} {
|
170 | @include padding(null, null, $spacer, null);
|
171 | }
|
172 |
|
173 |
|
174 | .#{$size}-margin-left-#{$spacer} {
|
175 | @include margin(null, null, null, $spacer);
|
176 | }
|
177 |
|
178 | .#{$size}-padding-left-#{$spacer} {
|
179 | @include padding(null, null, null, $spacer);
|
180 | }
|
181 |
|
182 |
|
183 | .#{$size}-margin-horizontal-#{$spacer} {
|
184 | @include margin(null, $spacer, null, $spacer);
|
185 | }
|
186 |
|
187 | .#{$size}-padding-horizontal-#{$spacer} {
|
188 | @include padding(null, $spacer, null, $spacer);
|
189 | }
|
190 |
|
191 |
|
192 | .#{$size}-margin-vertical-#{$spacer} {
|
193 | @include margin($spacer, null, $spacer, null)
|
194 | }
|
195 |
|
196 | .#{$size}-padding-vertical-#{$spacer} {
|
197 | @include padding($spacer, null, $spacer, null)
|
198 | }
|
199 | }
|
200 | }
|
201 | }
|
202 | }
|
203 | }
|
204 | }
|