Merge branch '5.5' into 6.0
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / style / ui / contentItem.scss
1 .contentItemList {
2 display: flex;
3 flex-wrap: wrap;
4 margin: 0 0 -20px -20px;
5 }
6
7 .contentItem {
8 background-color: var(--wcfContentBackground);
9 border-radius: var(--wcfBorderRadius);
10 box-shadow: var(--wcfBoxShadowCard);
11 display: flex;
12 flex-direction: column;
13 margin: 0 0 20px 20px;
14 position: relative;
15 overflow: hidden;
16 }
17
18 .contentItemSingleColumn {
19 /* The `flex` shorthand fails in IE11 if `calc()` is used. */
20 flex-grow: 0;
21 flex-shrink: 0;
22 flex-basis: calc(100% - 20px);
23 }
24
25 .contentItemMultiColumn {
26 /* The `flex` shorthand fails in IE11 if `calc()` is used. */
27 flex-grow: 0;
28 flex-shrink: 0;
29 flex-basis: calc(50% - 20px);
30 }
31
32 .contentItemLink {
33 flex: 1 auto;
34 }
35
36 .contentItemTitleLink {
37 color: inherit;
38
39 &::before {
40 bottom: 0;
41 content: "";
42 left: 0;
43 position: absolute;
44 right: 0;
45 top: 0;
46 }
47
48 &:hover,
49 &:focus {
50 color: inherit;
51 }
52 }
53
54 /* Deprecated: use contentItemTitleLink instead. */
55 .contentItemLinkShadow {
56 bottom: 0;
57 left: 0;
58 position: absolute;
59 right: 0;
60 top: 0;
61 }
62
63 .contentItemContent {
64 padding: 10px;
65 }
66
67 .contentItemContentTruncate {
68 max-height: 150px;
69 overflow: hidden;
70 position: relative;
71
72 &::after {
73 background-image: linear-gradient(
74 to top,
75 var(--wcfContentBackground),
76 rgba(var(--wcfContentBackground-rgb) / 0)
77 );
78 bottom: 0;
79 content: "";
80 height: 30px;
81 left: 0;
82 pointer-events: none;
83 position: absolute;
84 right: 0;
85 /* The `top` value is important, because it prevents the last line from being affected
86 when the content isn't too long. */
87 top: 120px;
88 }
89 }
90
91 .contentItemImage {
92 background-position: center;
93 background-repeat: no-repeat;
94 background-size: cover;
95 padding: 10px;
96 position: relative;
97 }
98
99 .contentItemImageSmall {
100 min-height: 75px;
101
102 .contentItemImageElement {
103 height: 75px;
104 }
105 }
106
107 .contentItemImageLarge {
108 min-height: 150px;
109
110 .contentItemImageElement {
111 height: 150px;
112 }
113 }
114
115 .contentItemImageElement {
116 margin: -10px -10px -10px -10px;
117 object-fit: cover;
118 object-position: center;
119
120 // The `100% + 20px` are the result of the negative margins.
121 max-width: calc(100% + 20px);
122 }
123
124 .contentItemBadges,
125 .contentItemOptions {
126 align-items: flex-start;
127 display: flex;
128 flex-direction: column;
129 }
130
131 .contentItemImageElement + .contentItemBadges {
132 left: 10px;
133 position: absolute;
134 top: 10px;
135 z-index: 1;
136 }
137
138 .contentItemOptions {
139 position: absolute;
140 right: 10px;
141 top: 10px;
142 z-index: 1;
143 }
144
145 .contentItemBadge,
146 .contentItemOption {
147 flex: 0 auto;
148
149 &:not(:first-child) {
150 margin-top: 5px;
151 }
152 }
153
154 .contentItemBadge {
155 border: 1px solid currentColor;
156 }
157
158 .contentItemOption.button {
159 box-shadow:
160 0 0 3px rgba(0, 0, 0, 0.12),
161 0 1px 2px rgba(0, 0, 0, 0.24);
162 }
163
164 .contentItemLabels {
165 margin-bottom: 5px;
166 }
167
168 .contentItemCategory {
169 color: var(--wcfContentDimmedText);
170
171 @include wcfFontSmall;
172 }
173
174 .contentItemTitle {
175 color: var(--wcfContentHeadlineLink);
176
177 @include wcfFontHeadline;
178 @include wcfFontBold;
179
180 &:hover {
181 color: var(--wcfContentHeadlineLinkActive);
182 }
183 }
184
185 .contentItemDescription {
186 color: var(--wcfContentDimmedText);
187 margin-top: 5px;
188
189 img {
190 height: auto !important;
191 max-width: 100%;
192 }
193 }
194
195 .contentItemContentLinks {
196 padding: 0 10px 10px 10px;
197 }
198
199 .contentItemMeta {
200 align-items: center;
201 border-top: 1px solid var(--wcfContentBorderInner);
202 color: var(--wcfContentDimmedText);
203 display: flex;
204 flex: 0 auto;
205 padding: 10px;
206 white-space: nowrap;
207
208 .icon {
209 color: inherit;
210 }
211 }
212
213 .contentItemMetaImage {
214 flex: 0 auto;
215 margin-right: 10px;
216 }
217
218 .contentItemMetaContent {
219 flex: 1 auto;
220 font-size: 12px;
221 }
222
223 .contentItemMetaAuthor {
224 color: var(--wcfContentText);
225
226 a,
227 a:hover {
228 color: inherit;
229 }
230 }
231
232 .contentItemMetaIcons {
233 align-items: center;
234 display: flex;
235 flex: 0 auto;
236 margin-left: 10px;
237
238 @include wcfFontSmall;
239 }
240
241 .contentItemMetaIcon {
242 flex: 0 auto;
243
244 &:not(:first-child) {
245 margin-left: 10px;
246 }
247
248 .topReactionShort {
249 align-items: center;
250 display: flex;
251 }
252
253 .reactionType {
254 margin-right: 3px;
255 }
256 }
257
258 .contentItemImagePreview {
259 border-radius: var(--wcfBorderRadius);
260 box-shadow:
261 0 0 3px rgba(0, 0, 0, 0.12),
262 0 1px 2px rgba(0, 0, 0, 0.24);
263 margin-bottom: 10px;
264 max-width: 100%;
265 }
266
267 .contentItemImagePreviewButtons {
268 display: flex;
269 flex-wrap: wrap;
270 margin-left: -10px;
271
272 > .button {
273 flex: 0 auto;
274 margin-left: 10px;
275 }
276
277 > .innerError {
278 flex: 0 0 100%;
279 margin-left: 10px;
280 }
281 }
282
283 @include screen-lg {
284 /* There are no sidebars, use a three column layout. */
285 .content:first-child:last-child,
286 .boxesTop,
287 .boxesBottom {
288 .contentItemMultiColumn {
289 /* The `flex` shorthand fails in IE11 if `calc()` is used. */
290 flex-grow: 0;
291 flex-shrink: 0;
292 flex-basis: calc(100% / 3 - 20px);
293 }
294 }
295 }
296
297 @include screen-md {
298 /* The sidebar, if any, is not adjacent to the content, use a three column layout. */
299 .contentItemMultiColumn {
300 /* The `flex` shorthand fails in IE11 if `calc()` is used. */
301 flex-grow: 0;
302 flex-shrink: 0;
303 flex-basis: calc(100% / 3 - 20px);
304 }
305 }
306
307 @include screen-xs {
308 /* There is not enough space to fit two columns. */
309 .contentItemList {
310 display: block;
311 }
312
313 .contentItemMultiColumn {
314 max-width: none;
315 }
316 }