Added some more mobile optimizations
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / style / layout / box.scss
CommitLineData
bb6ef47e
MW
1/* default styling for all boxes */
2.box {
3 box-sizing: border-box;
4}
5
6.boxImage {
7 img {
8 max-width: 100%;
9 }
10}
11
12.boxTitle {
13 @extend .wcfFontHeadline;
14
15 & + .boxContent {
95961bdf
MW
16 margin-top: 20px;
17 }
18
19 .badge {
20 top: -2px;
bb6ef47e
MW
21 }
22}
23
24.boxContent {
25 & + .boxContent,
26 & + .boxTitle {
27 margin-top: 20px;
28 }
29}
30
31/* styling for boxes in <hero> position */
32.boxesHero {
33 .box {
34 padding: 40px;
35 text-align: center;
36 }
37
38 .boxTitle {
39 @extend .wcfFontTitle;
bb6ef47e
MW
40 }
41
42 .boxWithImage {
43 display: flex;
44 flex-wrap: wrap;
45
46 .boxImage,
47 .boxTitle,
48 .boxContent {
49 flex: 0 0 100%;
50 }
51
52 .boxImage {
53 order: 3;
54 margin-top: 40px;
55 }
56 }
57}
58
59/* styling for boxes in <headerBoxes> position */
60.boxesHeaderBoxes {
61 background-color: rgb(247, 248, 250); // @todo
62
c734a302 63 .boxContainer {
bb6ef47e
MW
64 display: flex;
65 flex-wrap: wrap;
c734a302
MW
66 margin-left: -10px;
67 margin-right: -10px;
bb6ef47e
MW
68 padding: 40px 0;
69 }
70
71 .box {
72 flex: 0 0 25%;
95961bdf 73 overflow: hidden;
bb6ef47e 74 padding-left: 10px;
c734a302 75 padding-right: 10px;
95961bdf 76
bb6ef47e
MW
77 &:nth-child(4n+1):not(:first-child) {
78 margin-top: 20px;
79 }
80
81 /* one item */
82 &:first-child:nth-last-child(1) {
83 flex-basis: 100%;
84 }
85
86 /* two items */
87 &:first-child:nth-last-child(2),
88 &:first-child:nth-last-child(2) ~ .box {
89 flex-basis: 50%;
90 }
91
92 /* three items */
93 &:first-child:nth-last-child(3),
94 &:first-child:nth-last-child(3) ~ .box {
95 flex-basis: 33.3333%;
96 }
937f57cf
AE
97
98 a:hover {
99 text-decoration: underline;
100 }
bb6ef47e
MW
101 }
102
103 .boxImage {
104 margin-bottom: 10px;
105 text-align: center;
106 }
107}
108
109/* styling for boxes in <top>/<bottom> position */
110.boxesTop,
111.boxesBottom {
bb6ef47e 112 .box {
41ec911a
MW
113 margin-bottom: 40px;
114 margin-top: 40px;
bb6ef47e
MW
115 }
116
10ff3d63
MW
117 .boxTitle {
118 color: $wcfContentHeadlineText;
119
120 @extend .wcfFontSection;
121
122 a {
123 color: $wcfContentHeadlineLink;
124
125 &:hover {
126 color: $wcfContentHeadlineLinkActive;
127 }
128 }
129 }
130
bb6ef47e
MW
131 .boxWithImage {
132 @extend .clearfix;
133
134 .boxTitle,
135 .boxContent {
136 margin-left: calc(20% + 30px);
137 }
138 }
139
140 .boxImage {
141 float: left;
142 width: 20%;
143 }
144}
145
146.boxesTop {
147 border-bottom: 1px solid $wcfContentBorderInner;
148}
149
150.boxesBottom {
151 border-top: 1px solid $wcfContentBorderInner;
152}
153
154/* styling for boxes in <sidebarLeft>/<sidebarRight> position */
155.boxesSidebarLeft,
156.boxesSidebarRight {
157 color: $wcfSidebarText;
158
159 a {
160 color: $wcfSidebarLink;
161
162 > .icon {
163 color: $wcfSidebarLink;
164 }
165
166 &:hover {
167 color: $wcfSidebarLinkActive;
168
169 > .icon {
170 color: $wcfSidebarLinkActive;
171 }
172 }
173 }
174
175 small,
176 .dimmed {
177 color: $wcfSidebarDimmedText;
178
179 a {
180 color: $wcfSidebarDimmedLink;
181
182 &:hover {
183 color: $wcfSidebarDimmedLinkActive;
184 }
185 }
186 }
187
e9f3957f
MW
188 .boxTitle {
189 color: $wcfSidebarHeadlineLink;
190
191 &:hover {
192 color: $wcfSidebarHeadlineLinkActive;
193 }
194 }
195
bb6ef47e 196 .box {
0e8421c9
MW
197 &:not(.boxBorderless) {
198 background-color: $wcfSidebarBackground;
199 padding: 20px;
200
201 .boxMenu {
202 margin-left: -20px;
203 margin-right: -20px;
204 }
205 }
bb6ef47e
MW
206
207 &:not(:first-child) {
95961bdf 208 margin-top: 30px;
bb6ef47e 209 }
487db634
MW
210
211 &.boxAlternative {
212 background-color: transparent;
213 border: 1px solid $wcfContentBorderInner;
214 }
215
216 &.boxError {
217 background-color: $wcfStatusErrorBackground;
218 color: $wcfStatusErrorText;
219 }
220
221 &.boxInfo {
222 background-color: $wcfStatusInfoBackground;
223 color: $wcfStatusInfoText;
224 }
225
226 &.boxSuccess {
227 background-color: $wcfStatusSuccessBackground;
228 color: $wcfStatusSuccessText;
229 }
230
231 &.boxWarning {
232 background-color: $wcfStatusWarningBackground;
233 color: $wcfStatusWarningText;
234 }
0e8421c9
MW
235
236 .boxMenu {
237 .boxMenuLink {
238 display: block;
239 padding: 5px 20px;
240
241 .badge {
242 float: right;
243 }
244 }
245
246 li.active > .boxMenuLink {
247 background-color: $wcfContentBackground;
248 }
249
250 .boxMenuDepth1 .boxMenuLink {
251 padding-left: 40px;
252 }
253
254 .boxMenuDepth2 .boxMenuLink {
255 padding-left: 60px;
256 }
257 }
bb6ef47e
MW
258 }
259
260 .boxWithImage {
261 @extend .clearfix;
262
263 .boxTitle,
264 .boxContent {
265 margin-left: calc(20% + 10px);
266 }
267 }
268
269 .boxImage {
270 float: left;
271 width: 20%;
272 }
273}
274
275/* styling for boxes in <contentTop>/<contentBottom> position */
276.boxesContentTop,
277.boxesContentBottom {
bb6ef47e
MW
278 .box {
279 &:not(:first-child) {
10ff3d63 280 margin-top: 40px;
bb6ef47e
MW
281 }
282 }
283
284 .boxWithImage {
285 @extend .clearfix;
286
287 .boxTitle,
288 .boxContent {
289 margin-left: calc(20% + 20px);
290 }
291 }
292
72a7f9cd
MW
293 .boxTitle {
294 color: $wcfContentHeadlineText;
295
10ff3d63
MW
296 @extend .wcfFontSection;
297
72a7f9cd
MW
298 a {
299 color: $wcfContentHeadlineLink;
300
301 &:hover {
302 color: $wcfContentHeadlineLinkActive;
303 }
304 }
305 }
306
bb6ef47e
MW
307 .boxImage {
308 float: left;
309 width: 20%;
310 }
311}
312
313.boxesContentTop {
10ff3d63 314 margin-bottom: 40px;
bb6ef47e
MW
315}
316
317.boxesContentBottom {
10ff3d63 318 margin-top: 40px;
bb6ef47e
MW
319}
320
321/* styling for boxes in <footerBoxes> position */
322.boxesFooterBoxes {
323 background-color: $wcfFooterBoxBackground;
324 color: $wcfFooterBoxText;
325 flex: 0 0 auto;
326 z-index: 40;
327
328 a {
329 color: $wcfFooterBoxLink;
330
331 .icon {
332 color: $wcfFooterBoxLink;
333 }
334
335 &:hover {
336 color: $wcfFooterBoxLinkActive;
b4f2a6be 337 text-decoration: underline;
bb6ef47e
MW
338
339 .icon {
340 color: $wcfFooterBoxLinkActive;
341 }
342 }
343 }
344
345 .icon {
346 color: $wcfFooterBoxText;
347 }
348
c734a302 349 .boxContainer {
bb6ef47e
MW
350 display: flex;
351 flex-wrap: wrap;
95961bdf 352 margin-bottom: -40px;
c734a302
MW
353 margin-left: -10px;
354 margin-right: -10px;
bb6ef47e
MW
355 padding: 40px 0;
356 }
357
358 .box {
359 flex: 0 0 50%;
95961bdf 360 overflow: hidden;
c734a302
MW
361 padding-left: 10px;
362 padding-right: 10px;
95961bdf 363 margin-bottom: 40px;
bb6ef47e 364
51ed9738 365 &.boxFullWidth {
95961bdf 366 flex-basis: 100%;
bb6ef47e 367 }
bb6ef47e
MW
368 }
369
72a7f9cd
MW
370 .boxTitle {
371 color: $wcfFooterBoxHeadlineText;
372
373 a {
374 color: $wcfFooterBoxHeadlineLink;
375
376 &:hover {
377 color: $wcfFooterBoxHeadlineLinkActive;
378 }
379 }
380 }
381
bb6ef47e
MW
382 .boxImage {
383 margin-bottom: 10px;
384 text-align: center;
385 }
386}
387
388/* styling for boxes in <footer> position */
389.boxesFooter {
bb6ef47e
MW
390 .box {
391 &:not(:first-child) {
95961bdf 392 margin-top: 20px;
bb6ef47e
MW
393 }
394 }
395
396 .boxWithImage {
397 @extend .clearfix;
398
399 .boxTitle,
400 .boxContent {
401 margin-left: calc(20% + 30px);
402 }
403 }
404
405 .boxImage {
406 float: left;
407 width: 20%;
408 }
948d7051
MW
409
410 .boxMenu {
411 display: flex;
412 flex-wrap: wrap;
413 margin-bottom: -20px;
414 margin-left: -10px;
415 margin-right: -10px;
416
417 .boxMenuLink {
418 display: inline-block;
419 }
420
421 > li {
422 flex: 0 0 25%;
423 margin-bottom: 20px;
424 padding-left: 10px;
425 padding-right: 10px;
426
427 &.boxMenuHasChildren {
428 > .boxMenuLink {
429 @extend .wcfFontHeadline;
430
431 margin-bottom: 10px;
432 }
433
434 > ol {
435 a {
436 // use text color instead
437 color: $wcfFooterText;
438 }
439 }
440 }
441 }
442 }
bb6ef47e 443}