-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyles.scss
106 lines (94 loc) · 2.17 KB
/
styles.scss
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Dictionary
$color-background: #cecddd;
$color-arrow: #cecddd;
$color-text: #000000;
$color-word: #34316b;
$before-width: 0.5rem;
$after-width: 0.5rem;
.dictionary {
padding: 2rem;
max-width: 700px;
margin: auto;
line-height: 1.5;
&__word {
border-bottom: 2px dotted $color-word;
color: $color-word;
cursor: help;
position: relative;
&__definition {
position: absolute;
z-index: 10000000;
bottom: calc(100% + 0.5rem);
transform: translateX(-50%);
left: 50%;
width: 30rem;
background: $color-background;
padding: 0.75rem 1rem;
color: $color-text;
font-size: 0.8em;
pointer-events: none;
user-select: none;
border-radius: 2px;
animation-duration: .2s;
animation-fill-mode: both;
animation-name: dictionary;
animation-duration: .2s;
&:before,
&:after {
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
top: 100%;
left: 50%;
}
&:before {
border-width: $before-width;
margin-left: -$before-width;
border-top-color: $color-arrow;
}
&:after {
border-width: $after-width;
margin-left: -$after-width;
border-top-color: $color-background;
}
@media screen and (max-width: 760px){
position: fixed;
top: 50%;
width: calc(100vw - 2rem);
left: 1rem;
right: 1rem;
transform: translateY(-50%) !important;
span {
display: block;
height: 100&;
position: fixed;
top: 50%;
width: calc(100vw - 2rem);
left: 0;
right: 0;
transform: translateY(-50%);
background-color: $color-background;
padding: 1rem;
border-radius: 2px;
}
&:before,
&:after {
display: none;
}
}
}
}
}
@keyframes dictionary {
from {
opacity: 0;
transform: translateX(-50%) translate3d(0, 15%, 0);
}
to {
opacity: 1;
transform: translateX(-50%);
}
}