Skip to content

Commit 6d2e7ad

Browse files
imp: Improve the look of links on mobile
1 parent 96aa639 commit 6d2e7ad

File tree

2 files changed

+351
-129
lines changed

2 files changed

+351
-129
lines changed
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
.link {
2+
position: relative;
3+
4+
display: flex;
5+
width: 100%;
6+
max-width: 100%;
7+
margin-bottom: var(--space-medium);
8+
9+
flex-direction: column;
10+
flex-grow: 1;
11+
12+
box-shadow: 0 1px 4px 1px var(--color-grey-2);
13+
14+
transition: box-shadow 0.5s ease-in-out;
15+
}
16+
17+
.link:focus-within {
18+
box-shadow: 0 1px 4px 1px var(--color-purple-2);
19+
}
20+
21+
@media (min-width: 800px) {
22+
.link {
23+
max-width: 31%;
24+
margin-right: 1%;
25+
margin-left: 1%;
26+
}
27+
}
28+
29+
.link__meta {
30+
display: flex;
31+
padding: var(--space-smaller);
32+
33+
align-items: flex-start;
34+
}
35+
36+
@media (min-width: 800px) {
37+
.link__meta {
38+
position: absolute;
39+
right: 0;
40+
left: 0;
41+
}
42+
}
43+
44+
.link__meta-warning,
45+
.link__meta-date {
46+
padding: 0 var(--space-small);
47+
48+
font-size: var(--size-small);
49+
font-style: italic;
50+
51+
border-radius: var(--radius);
52+
}
53+
54+
.link__meta-warning {
55+
color: var(--color-text-warning);
56+
text-align: left;
57+
58+
background-color: var(--color-back-warning);
59+
border: none;
60+
}
61+
62+
.link__meta-warning:hover,
63+
.link__meta-warning:focus {
64+
background-color: var(--color-back-warning);
65+
}
66+
67+
.link__meta-warning span {
68+
white-space: nowrap;
69+
}
70+
71+
.link__meta-separator {
72+
flex-grow: 1;
73+
}
74+
75+
.link__meta-date {
76+
opacity: 0.8;
77+
background-color: var(--color-purple-1);
78+
}
79+
80+
.link__body {
81+
display: flex;
82+
padding: var(--space-smaller);
83+
84+
flex: 1;
85+
}
86+
87+
.link__meta + .link__body {
88+
margin-top: calc(-1 * var(--space-smaller));
89+
}
90+
91+
@media (min-width: 800px) {
92+
.link__body {
93+
padding: 0;
94+
95+
flex-direction: column;
96+
}
97+
98+
.link__meta + .link__body {
99+
margin-top: 0;
100+
}
101+
}
102+
103+
.link__image-container {
104+
width: 85px;
105+
height: 85px;
106+
107+
flex-shrink: 0;
108+
}
109+
110+
.link__image {
111+
width: 100%;
112+
height: 100%;
113+
114+
border-radius: var(--radius);
115+
116+
object-fit: cover;
117+
}
118+
119+
@media (min-width: 800px) {
120+
.link__image-container {
121+
width: 100%;
122+
height: 156px;
123+
}
124+
125+
.link__image {
126+
border-radius: 0;
127+
}
128+
}
129+
130+
.link__content {
131+
overflow: hidden;
132+
133+
margin-left: var(--space-small);
134+
135+
flex-shrink: 1;
136+
}
137+
138+
@media (min-width: 800px) {
139+
.link__content {
140+
margin-left: 0;
141+
padding: var(--space-small);
142+
}
143+
}
144+
145+
.link__title {
146+
margin-top: 0;
147+
margin-bottom: var(--space-medium);
148+
149+
font-size: var(--size-normal);
150+
font-weight: bold;
151+
line-height: 1.25;
152+
}
153+
154+
.link__title a {
155+
overflow: hidden;
156+
157+
display: block;
158+
159+
text-decoration: none;
160+
text-overflow: ellipsis;
161+
}
162+
163+
.link__text {
164+
margin-top: var(--space-small);
165+
margin-bottom: var(--space-small);
166+
167+
color: var(--color-text-secondary);
168+
font-size: var(--size-small);
169+
overflow-wrap: anywhere;
170+
}
171+
172+
.link__text--oneline {
173+
display: flex;
174+
175+
align-items: baseline;
176+
177+
white-space: nowrap;
178+
}
179+
180+
.link__ellipsis {
181+
overflow: hidden;
182+
183+
text-overflow: ellipsis;
184+
}
185+
186+
.link__actions {
187+
display: flex;
188+
padding: var(--space-smaller);
189+
190+
align-items: center;
191+
justify-content: space-between;
192+
193+
background-color: var(--color-purple-1);
194+
background-image: linear-gradient(to right, var(--color-purple-2), var(--color-purple-3), var(--color-purple-2));
195+
background-repeat: repeat-x;
196+
background-position: 0 100%;
197+
background-size: 100% 3px;
198+
box-shadow: 0 -1px 2px 0 var(--color-purple-1);
199+
}
200+
201+
@media (min-width: 800px) {
202+
.link__actions {
203+
padding: var(--space-small);
204+
}
205+
}
206+
207+
.link__actions-group {
208+
display: flex;
209+
210+
align-items: center;
211+
}
212+
213+
.link__actions-group > * + * {
214+
margin-left: var(--space-small);
215+
}

0 commit comments

Comments
 (0)