df266420768560d2ac073d3e1e3e4102be8bd433
[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: $wcfContentBackground;
9 border-radius: 3px;
10 box-shadow: 0 0 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
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(to top, $wcfContentBackground, transparentize($wcfContentBackground, 1));
74 bottom: 0;
75 content: "";
76 height: 30px;
77 left: 0;
78 pointer-events: none;
79 position: absolute;
80 right: 0;
81 /* The `top` value is important, because it prevents the last line from being affected
82 when the content isn't too long. */
83 top: 120px;
84 }
85 }
86
87 .contentItemImage {
88 background-position: center;
89 background-repeat: no-repeat;
90 background-size: cover;
91 padding: 10px;
92 position: relative;
93 }
94
95 .contentItemImageSmall {
96 min-height: 75px;
97
98 .contentItemImageElement {
99 height: 75px;
100 }
101 }
102
103 .contentItemImageLarge {
104 min-height: 150px;
105
106 .contentItemImageElement {
107 height: 150px;
108 }
109 }
110
111 .contentItemImageElement {
112 margin: -10px -10px 10px -10px;
113 object-fit: cover;
114 object-position: center;
115
116 // The `100% + 20px` are the result of the negative margins.
117 max-width: calc(100% + 20px);
118 }
119
120 .contentItemBadges,
121 .contentItemOptions {
122 align-items: flex-start;
123 display: flex;
124 flex-direction: column;
125 }
126
127 .contentItemImageElement + .contentItemBadges {
128 left: 10px;
129 position: absolute;
130 top: 10px;
131 z-index: 1;
132 }
133
134 .contentItemOptions {
135 position: absolute;
136 right: 10px;
137 top: 10px;
138 z-index: 1;
139 }
140
141 .contentItemBadge,
142 .contentItemOption {
143 flex: 0 auto;
144
145 &:not(:first-child) {
146 margin-top: 5px;
147 }
148 }
149
150 .contentItemBadge {
151 border: 1px solid currentColor;
152 }
153
154 .contentItemOption.button {
155 box-shadow: 0 0 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
156 }
157
158 .contentItemLabels {
159 margin-bottom: 5px;
160 }
161
162 .contentItemCategory {
163 color: $wcfContentDimmedText;
164
165 @include wcfFontSmall;
166 }
167
168 .contentItemTitle {
169 color: $wcfContentHeadlineLink;
170
171 @include wcfFontHeadline;
172 @include wcfFontBold;
173
174 &:hover {
175 color: $wcfContentHeadlineLinkActive;
176 }
177 }
178
179 .contentItemDescription {
180 color: $wcfContentDimmedText;
181 margin-top: 5px;
182
183 img {
184 height: auto !important;
185 max-width: 100%;
186 }
187 }
188
189 .contentItemContentLinks {
190 padding: 0 10px 10px 10px;
191 }
192
193 .contentItemMeta {
194 align-items: center;
195 border-top: 1px solid $wcfContentBorderInner;
196 color: $wcfContentDimmedText;
197 display: flex;
198 flex: 0 auto;
199 padding: 10px;
200
201 .icon {
202 color: inherit;
203 }
204 }
205
206 .contentItemMetaImage {
207 flex: 0 auto;
208 margin-right: 10px;
209 }
210
211 .contentItemMetaContent {
212 flex: 1 auto;
213 font-size: 12px;
214 }
215
216 .contentItemMetaAuthor {
217 color: $wcfContentText;
218
219 a,
220 a:hover {
221 color: inherit;
222 }
223 }
224
225 .contentItemMetaIcons {
226 align-items: center;
227 display: flex;
228 flex: 0 auto;
229 margin-left: 10px;
230
231 @include wcfFontSmall;
232 }
233
234 .contentItemMetaIcon {
235 flex: 0 auto;
236
237 &:not(:first-child) {
238 margin-left: 10px;
239 }
240
241 .topReactionShort {
242 align-items: center;
243 display: flex;
244 }
245
246 .reactionType {
247 margin-right: 3px;
248 }
249 }
250
251 .contentItemImagePreview {
252 border-radius: 3px;
253 box-shadow: 0 0 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
254 margin-bottom: 10px;
255 max-width: 100%;
256 }
257
258 .contentItemImagePreviewButtons {
259 display: flex;
260 flex-wrap: wrap;
261 margin-left: -10px;
262
263 > .button {
264 flex: 0 auto;
265 margin-left: 10px;
266 }
267
268 > .innerError {
269 flex: 0 0 100%;
270 margin-left: 10px;
271 }
272 }
273
274 @include screen-lg {
275 /* There are no sidebars, use a three column layout. */
276 .content:first-child:last-child,
277 .boxesTop,
278 .boxesBottom {
279 .contentItemMultiColumn {
280 /* The `flex` shorthand fails in IE11 if `calc()` is used. */
281 flex-grow: 0;
282 flex-shrink: 0;
283 flex-basis: calc(100% / 3 - 20px);
284 }
285 }
286 }
287
288 @include screen-md {
289 /* The sidebar, if any, is not adjacent to the content, use a three column layout. */
290 .contentItemMultiColumn {
291 /* The `flex` shorthand fails in IE11 if `calc()` is used. */
292 flex-grow: 0;
293 flex-shrink: 0;
294 flex-basis: calc(100% / 3 - 20px);
295 }
296 }
297
298 @include screen-xs {
299 /* There is not enough space to fit two columns. */
300 .contentItemList {
301 display: block;
302 }
303
304 .contentItemMultiColumn {
305 max-width: none;
306 }
307 }