Skip to content

Commit 1dcbd25

Browse files
committed
Mobile version / minor improvements
1 parent 1b7c954 commit 1dcbd25

File tree

2 files changed

+123
-33
lines changed

2 files changed

+123
-33
lines changed

files/style/conversation.scss

Lines changed: 118 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,33 @@
2828
.conversationList {
2929
display: flex;
3030
flex-direction: column;
31-
gap: 20px;
3231
}
3332

3433
.conversationList__item {
35-
background-color: var(--wcfContentBackground);
36-
border-radius: var(--wcfBorderRadius);
37-
box-shadow: var(--wcfBoxShadowCard);
3834
display: flex;
3935
flex-direction: column;
4036
gap: 10px;
41-
padding: 20px;
4237
position: relative;
4338
}
4439

40+
.conversationList__item:not(:last-child) {
41+
border-bottom: 1px solid var(--wcfContentBorderInner);
42+
}
43+
44+
@include screen-sm-down {
45+
.conversationList__item:not(:last-child) {
46+
padding-bottom: 15px;
47+
margin-bottom: 15px;
48+
}
49+
}
50+
51+
@include screen-md-up {
52+
.conversationList__item:not(:last-child) {
53+
padding-bottom: 20px;
54+
margin-bottom: 20px;
55+
}
56+
}
57+
4558
html[data-color-scheme="dark"] {
4659
.conversationList__item {
4760
border: 1px solid var(--wcfContentBorderInner);
@@ -56,6 +69,7 @@ html[data-color-scheme="dark"] {
5669
}
5770

5871
.conversationList__item__meta {
72+
align-items: center;
5973
display: flex;
6074
gap: 10px;
6175

@@ -70,28 +84,46 @@ html[data-color-scheme="dark"] {
7084

7185
.conversationList__item__meta__content {
7286
display: flex;
73-
flex-direction: column;
7487
}
7588

76-
.conversationList__item:not(:hover) .conversationList__item__toolbar {
77-
grid-template-columns: min-content fit-content(0);
78-
column-gap: 0;
89+
@include screen-xs {
90+
.conversationList__item__meta {
91+
gap: 5px;
92+
}
93+
94+
.conversationList__item__meta__avatar img {
95+
height: 24px;
96+
width: 24px;
97+
}
98+
99+
.conversationList__item__meta__content {
100+
align-items: center;
101+
}
102+
103+
.conversationList__item__meta__time {
104+
display: flex;
105+
}
106+
107+
.conversationList__item__meta__time::before {
108+
content: "";
109+
margin: 0 3px;
110+
}
111+
}
112+
113+
@include screen-sm-up {
114+
.conversationList__item__meta__content {
115+
flex-direction: column;
116+
}
79117
}
80118

81119
.conversationList__item__toolbar {
82120
align-items: center;
83121
display: grid;
84-
column-gap: 5px;
122+
column-gap: 10px;
85123
grid-template-areas: "status interactions";
86124
grid-template-columns: auto fit-content(200px);
87-
transition:
88-
grid-template-columns 0.24s ease-in-out 0.12s,
89-
column-gap 0.24s ease-in-out 0.12s;
90-
z-index: 1;
91-
}
92125

93-
.conversationList__item:not(:hover) .conversationList__item__interactions {
94-
opacity: 0;
126+
z-index: 1;
95127
}
96128

97129
.conversationList__item__status {
@@ -102,15 +134,34 @@ html[data-color-scheme="dark"] {
102134

103135
.conversationList__item__interactions {
104136
display: flex;
105-
gap: 5px;
106137
grid-area: interactions;
107138
opacity: 1;
108-
transition: opacity 0.24s ease-in-out 0.12s;
109139
}
110140

111-
/* todo: handle touch */
112-
.conversationList__item:hover .conversationList__item__interactions {
113-
display: flex;
141+
@media (hover: hover) {
142+
.conversationList__item:not(:hover) .conversationList__item__toolbar {
143+
grid-template-columns: min-content fit-content(0);
144+
column-gap: 0;
145+
}
146+
147+
.conversationList__item__toolbar {
148+
transition:
149+
grid-template-columns 0.24s ease-in-out 0.12s,
150+
column-gap 0.24s ease-in-out 0.12s;
151+
}
152+
153+
.conversationList__item:not(:hover) .conversationList__item__interactions {
154+
opacity: 0;
155+
}
156+
157+
.conversationList__item__interactions {
158+
transition: opacity 0.24s ease-in-out 0.12s;
159+
}
160+
}
161+
162+
.conversationList__item__interactions .button:not(:hover) {
163+
background-color: transparent;
164+
color: inherit;
114165
}
115166

116167
.conversationList__item__interactions .dropdown {
@@ -121,11 +172,10 @@ html[data-color-scheme="dark"] {
121172
display: grid;
122173
grid-template-areas:
123174
"markAsRead title image"
124-
"labels labels image"
125-
"teaser teaser image";
175+
"teaser teaser image"
176+
"labels labels image";
126177
grid-template-columns: min-content 1fr min-content;
127178
grid-template-rows: min-content min-content 1fr;
128-
row-gap: 5px;
129179
}
130180

131181
.conversationList__item__markAsRead {
@@ -150,34 +200,50 @@ html[data-color-scheme="dark"] {
150200
}
151201

152202
.conversationList__item__title {
153-
color: var(--wcfContentHeadlineLink);
154203
grid-area: title;
155204

156205
@include wcfFontHeadline;
157206
@include wcfFontBold;
207+
}
158208

159-
&:hover {
160-
color: var(--wcfContentHeadlineLinkActive);
209+
@include screen-xs {
210+
.conversationList__item__title {
211+
font-size: 14px;
161212
}
162213
}
163214

164215
.conversationList__item__labels {
165216
grid-area: labels;
217+
margin-top: 5px;
166218
}
167219

168220
.conversationList__item__teaser {
169221
display: -webkit-box;
170222
grid-area: teaser;
171223
overflow: hidden;
224+
margin-top: 5px;
172225
-webkit-line-clamp: 2;
173226
-webkit-box-orient: vertical;
174227
}
175228

229+
@include screen-xs {
230+
.conversationList__item__teaser {
231+
font-size: 12px;
232+
}
233+
}
234+
176235
.conversationList__item__image {
177236
grid-area: image;
178237
width: 160px;
179238
overflow: hidden;
180239
border-radius: var(--wcfBorderRadius);
240+
margin-left: 10px;
241+
}
242+
243+
@include screen-xs {
244+
.conversationList__item__image {
245+
display: none;
246+
}
181247
}
182248

183249
.conversationList__item__image img {
@@ -199,6 +265,12 @@ html[data-color-scheme="dark"] {
199265
&:hover,
200266
&:focus {
201267
color: inherit;
268+
}
269+
}
270+
271+
@media (hover: hover) {
272+
.conversationList__item__link:hover,
273+
.conversationList__item__link:focus {
202274
text-decoration: underline;
203275
text-underline-offset: 0.2em;
204276
}
@@ -237,6 +309,12 @@ html[data-color-scheme="dark"] {
237309
&:hover,
238310
&:focus {
239311
color: inherit;
312+
}
313+
}
314+
315+
@media (hover: hover) {
316+
.conversationList__item__lastPost__link:hover,
317+
.conversationList__item__lastPost__link:focus {
240318
text-decoration: underline;
241319
text-underline-offset: 0.2em;
242320
}
@@ -250,6 +328,12 @@ html[data-color-scheme="dark"] {
250328
align-items: center;
251329
}
252330

331+
@include screen-xs {
332+
.conversationList__item__participants {
333+
display: none;
334+
}
335+
}
336+
253337
.conversationList__item__participant {
254338
transform: translateX(10px);
255339
width: 16px;
@@ -266,3 +350,9 @@ html[data-color-scheme="dark"] {
266350
display: flex;
267351
gap: 3px;
268352
}
353+
354+
@include screen-xs {
355+
.conversationList__item__lastPost__author {
356+
display: none;
357+
}
358+
}

templates/conversationListItems.tpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
<div class="conversationList__item__interactions">
3838
{if $view->hasBulkInteractions()}
39-
<label class="button small jsTooltip" title="{lang}wcf.clipboard.item.mark{/lang}">
39+
<label class="listView__selectItem__label jsTooltip" title="{lang}wcf.clipboard.item.mark{/lang}">
4040
<input type="checkbox" class="listView__selectItem" aria-label="{lang}wcf.clipboard.item.mark{/lang}">
4141
</label>
4242
{/if}
@@ -62,6 +62,10 @@
6262
<a href="{if $conversation->isNew()}{link controller='Conversation' object=$conversation action='firstNew'}{/link}{else}{$conversation->getLink()}{/if}" class="conversationList__item__link">{$conversation->subject}</a>
6363
</h2>
6464

65+
<div class="conversationList__item__teaser">
66+
{$conversation->getTeaser()}
67+
</div>
68+
6569
{hascontent}
6670
<div class="conversationList__item__labels">
6771
<ul class="labelList">
@@ -74,10 +78,6 @@
7478
</div>
7579
{/hascontent}
7680

77-
<div class="conversationList__item__teaser">
78-
{$conversation->getTeaser()}
79-
</div>
80-
8181
{if $conversation->getTeaserImage()}
8282
<div class="conversationList__item__image">
8383
{unsafe:$conversation->getTeaserImage()->toHtml()}

0 commit comments

Comments
 (0)