forked from inuitcss/trumps.widths-responsive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_trumps.widths-responsive.scss
234 lines (192 loc) · 11.6 KB
/
_trumps.widths-responsive.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
/*------------------------------------*\
#WIDTHS-RESPONSIVE
\*------------------------------------*/
/**
* Responsive width classes based on your responsive settings.
*/
@if $inuit-use-fractions == true {
@each $breakpoint in $breakpoints {
$alias: nth($breakpoint, 1);
$condition: nth($breakpoint, 2);
// This isn’t ideal, but we definitely don’t want to generate widths
// for retina devices. Exclude retina media-qeuries manually.
@if ($alias != "retina") {
@include media-query($alias) {
/**
* Whole.
*/
[class~="#{$inuit-widths-namespace}#{$alias}-1/1"] { width: 100% !important; }
/**
* Halves.
*/
[class~="#{$inuit-widths-namespace}#{$alias}-1/2"],
[class~="#{$inuit-widths-namespace}#{$alias}-2/4"],
[class~="#{$inuit-widths-namespace}#{$alias}-3/6"],
[class~="#{$inuit-widths-namespace}#{$alias}-4/8"],
[class~="#{$inuit-widths-namespace}#{$alias}-5/10"],
[class~="#{$inuit-widths-namespace}#{$alias}-6/12"] { width: 50% !important; }
/**
* Thirds.
*/
[class~="#{$inuit-widths-namespace}#{$alias}-1/3"],
[class~="#{$inuit-widths-namespace}#{$alias}-2/6"],
[class~="#{$inuit-widths-namespace}#{$alias}-3/9"],
[class~="#{$inuit-widths-namespace}#{$alias}-4/12"] { width: 33.3333333% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-2/3"],
[class~="#{$inuit-widths-namespace}#{$alias}-4/6"],
[class~="#{$inuit-widths-namespace}#{$alias}-6/9"],
[class~="#{$inuit-widths-namespace}#{$alias}-8/12"] { width: 66.6666666% !important; }
/**
* Quarters.
*/
[class~="#{$inuit-widths-namespace}#{$alias}-1/4"],
[class~="#{$inuit-widths-namespace}#{$alias}-2/8"],
[class~="#{$inuit-widths-namespace}#{$alias}-3/12"] { width: 25% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-3/4"],
[class~="#{$inuit-widths-namespace}#{$alias}-6/8"],
[class~="#{$inuit-widths-namespace}#{$alias}-9/12"] { width: 75% !important; }
/**
* Fifths.
*/
[class~="#{$inuit-widths-namespace}#{$alias}-1/5"],
[class~="#{$inuit-widths-namespace}#{$alias}-2/10"] { width: 20% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-2/5"],
[class~="#{$inuit-widths-namespace}#{$alias}-4/10"] { width: 40% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-3/5"],
[class~="#{$inuit-widths-namespace}#{$alias}-6/10"] { width: 60% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-4/5"],
[class~="#{$inuit-widths-namespace}#{$alias}-8/10"] { width: 80% !important; }
/**
* Sixths.
*/
[class~="#{$inuit-widths-namespace}#{$alias}-1/6"],
[class~="#{$inuit-widths-namespace}#{$alias}-2/12"] { width: 16.6666666% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-5/6"],
[class~="#{$inuit-widths-namespace}#{$alias}-10/12"] { width: 83.3333333% !important; }
/**
* Eighths.
*/
[class~="#{$inuit-widths-namespace}#{$alias}-1/8"] { width: 12.5% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-3/8"] { width: 37.5% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-5/8"] { width: 62.5% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-7/8"] { width: 87.5% !important; }
/**
* Ninths.
*/
[class~="#{$inuit-widths-namespace}#{$alias}-1/9"] { width: 11.1111111% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-2/9"] { width: 22.2222222% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-4/9"] { width: 44.4444444% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-5/9"] { width: 55.5555555% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-7/9"] { width: 77.7777777% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-8/9"] { width: 88.8888888% !important; }
/**
* Tenths.
*/
[class~="#{$inuit-widths-namespace}#{$alias}-1/10"] { width: 10% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-3/10"] { width: 30% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-7/10"] { width: 70% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-9/10"] { width: 90% !important; }
/**
* Twelfths.
*/
[class~="#{$inuit-widths-namespace}#{$alias}-1/12"] { width: 8.3333333% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-5/12"] { width: 41.6666666% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-7/12"] { width: 58.3333333% !important; }
[class~="#{$inuit-widths-namespace}#{$alias}-11/12"] { width: 91.6666666% !important; }
} // Close media query.
} // Close retina check.
} // Close breakpoints loop.
} // Close fractions @if.
@else {
@each $breakpoint in $breakpoints {
$alias: nth($breakpoint, 1);
$condition: nth($breakpoint, 2);
// This isn’t ideal, but we definitely don’t want to generate widths
// for retina devices. Exclude retina media-qeuries manually.
@if ($alias != retina) {
@include media-query($alias) {
/**
* Whole.
*/
.#{$inuit-widths-namespace}#{$alias}-one-whole { width: 100% !important; }
/**
* Halves.
*/
.#{$inuit-widths-namespace}#{$alias}-one-half,
.#{$inuit-widths-namespace}#{$alias}-two-quarters,
.#{$inuit-widths-namespace}#{$alias}-three-sixths,
.#{$inuit-widths-namespace}#{$alias}-four-eighths,
.#{$inuit-widths-namespace}#{$alias}-five-tenths,
.#{$inuit-widths-namespace}#{$alias}-six-twelfths { width: 50% !important; }
/**
* Thirds.
*/
.#{$inuit-widths-namespace}#{$alias}-one-third,
.#{$inuit-widths-namespace}#{$alias}-two-sixths,
.#{$inuit-widths-namespace}#{$alias}-three-ninths,
.#{$inuit-widths-namespace}#{$alias}-four-twelfths { width: 33.3333333% !important; }
.#{$inuit-widths-namespace}#{$alias}-two-thirds,
.#{$inuit-widths-namespace}#{$alias}-four-sixths,
.#{$inuit-widths-namespace}#{$alias}-six-ninths,
.#{$inuit-widths-namespace}#{$alias}-eight-twelfths { width: 66.6666666% !important; }
/**
* Quarters.
*/
.#{$inuit-widths-namespace}#{$alias}-one-quarter,
.#{$inuit-widths-namespace}#{$alias}-two-eighths,
.#{$inuit-widths-namespace}#{$alias}-three-twelfths { width: 25% !important; }
.#{$inuit-widths-namespace}#{$alias}-three-quarters,
.#{$inuit-widths-namespace}#{$alias}-six-eighths,
.#{$inuit-widths-namespace}#{$alias}-nine-twelfths { width: 75% !important; }
/**
* Fifths.
*/
.#{$inuit-widths-namespace}#{$alias}-one-fifth,
.#{$inuit-widths-namespace}#{$alias}-two-tenths { width: 20% !important; }
.#{$inuit-widths-namespace}#{$alias}-two-fifths,
.#{$inuit-widths-namespace}#{$alias}-four-tenths { width: 40% !important; }
.#{$inuit-widths-namespace}#{$alias}-three-fifths,
.#{$inuit-widths-namespace}#{$alias}-six-tenths { width: 60% !important; }
.#{$inuit-widths-namespace}#{$alias}-four-fifths,
.#{$inuit-widths-namespace}#{$alias}-eight-tenths { width: 80% !important; }
/**
* Sixths.
*/
.#{$inuit-widths-namespace}#{$alias}-one-sixth,
.#{$inuit-widths-namespace}#{$alias}-two-twelfths { width: 16.6666666% !important; }
.#{$inuit-widths-namespace}#{$alias}-five-sixths,
.#{$inuit-widths-namespace}#{$alias}-ten-twelfths { width: 83.3333333% !important; }
/**
* Eighths.
*/
.#{$inuit-widths-namespace}#{$alias}-one-eighth { width: 12.5% !important; }
.#{$inuit-widths-namespace}#{$alias}-three-eighths { width: 37.5% !important; }
.#{$inuit-widths-namespace}#{$alias}-five-eighths { width: 62.5% !important; }
.#{$inuit-widths-namespace}#{$alias}-seven-eighths { width: 87.5% !important; }
/**
* Ninths.
*/
.#{$inuit-widths-namespace}#{$alias}-one-ninth { width: 11.1111111% !important; }
.#{$inuit-widths-namespace}#{$alias}-two-ninths { width: 22.2222222% !important; }
.#{$inuit-widths-namespace}#{$alias}-four-ninths { width: 44.4444444% !important; }
.#{$inuit-widths-namespace}#{$alias}-five-ninths { width: 55.5555555% !important; }
.#{$inuit-widths-namespace}#{$alias}-seven-ninths { width: 77.7777777% !important; }
.#{$inuit-widths-namespace}#{$alias}-eight-ninths { width: 88.8888888% !important; }
/**
* Tenths.
*/
.#{$inuit-widths-namespace}#{$alias}-one-tenth { width: 10% !important; }
.#{$inuit-widths-namespace}#{$alias}-three-tenths { width: 30% !important; }
.#{$inuit-widths-namespace}#{$alias}-seven-tenths { width: 70% !important; }
.#{$inuit-widths-namespace}#{$alias}-nine-tenths { width: 90% !important; }
/**
* Twelfths.
*/
.#{$inuit-widths-namespace}#{$alias}-one-twelfth { width: 8.3333333% !important; }
.#{$inuit-widths-namespace}#{$alias}-five-twelfths { width: 41.6666666% !important; }
.#{$inuit-widths-namespace}#{$alias}-seven-twelfths { width: 58.3333333% !important; }
.#{$inuit-widths-namespace}#{$alias}-eleven-twelfths { width: 91.6666666% !important; }
} // Close media query.
} // Close retina check.
} // Close breakpoints loop.
} // Close fractions @if.