/
Article.ts
82 lines (74 loc) · 1.46 KB
/
Article.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import styled from "styled-components";
export const ImageContainer = styled.div`
margin-right: 0.5rem;
& img {
width: 100%;
height: auto;
border-radius: 4px;
}
`;
export const Description = styled.div`
position: absolute;
top: 100%;
left: 0;
width: 100%;
height: 100%;
padding: 0.5rem;
box-sizing: border-box;
margin: 0 !important;
background: rgba(50, 50, 50, 0.95);
transition: all ease 200ms;
opacity: 0;
justify-content: center;
display: flex;
flex-direction: column;
align-items: center;
max-width: 100%;
text-align: center;
}
`;
export const Article = styled.article`
padding: 0.5rem 1rem;
margin-top: 1.5rem;
margin-bottom: 2.5rem;
border: 1px solid rgba(100, 100, 100, 0.7);
background: rgba(40, 40, 40, 1);
border-radius: 0.25rem;
position: relative;
overflow: hidden;
text-align: center;
& > * {
flex: 1 auto;
margin: 0.5rem auto;
margin-bottom: 0.5rem;
}
& header > * {
padding-bottom: 0.5em;
line-height: 1.2;
&:last-child {
padding-bottom: 0;
}
}
${ImageContainer} {
min-width: 60px;
max-width: 60px;
}
&:hover {
& ${Description} {
top: 0%;
opacity: 1;
}
}
@media (pointer: coarse) {
padding-bottom: 0;
${Description} {
position: static;
height: auto;
opacity: 1;
width: auto;
max-width: none;
margin-left: -1rem !important;
margin-right: -1rem !important;
}
}
`;