aboutsummaryrefslogtreecommitdiff
path: root/users/ryan/modules/simple-bar/simple-bar-source/lib/styles/components/missives.js
blob: 18e7b176881dafa1a0b7cb8ccab96d6e20a6c1ff (plain)
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
// Styles for /lib/components/missives/{missive|missives}.jsx components
export const missivesStyles = /* css */ `
.missives {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}
.missive {
  --gradient-size: 100px;

  position: absolute;
  top: 0;
  width: fit-content;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  box-sizing: border-box;
  background-color: var(--background);
  pointer-events: auto;
  transition: transform 160ms var(--transition-easing);
}
.missive::after {
  content: "";
  position: absolute;
  top: 0;
  height: 100%;
  width: var(--gradient-size);
  pointer-events: none;
}
.missive--left {
  left: 0;
  animation: left-missive-appearance 320ms var(--transition-easing);
}
@keyframes left-missive-appearance {
  0% {
    transform: translateX(-100%);
  }
}
.missive--left::after {
  left: 100%;
  background: linear-gradient(to right, var(--background) 0%, transparent 100%);
}
.missive--right {
  right: 0;
  flex-direction: row-reverse;
  animation: right-missive-appearance 320ms var(--transition-easing);
}
@keyframes right-missive-appearance {
  0% {
    transform: translateX(100%);
  }
}
.missive--right::after {
  right: 100%;
  background: linear-gradient(to left, var(--background) 0%, transparent 100%);
}
.missive__text {
  max-width: calc(100vw - var(--gradient-size));
  overflow: hidden;
}
.missive__close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  fill: var(--foreground);
  background-color: transparent;
  border: 0;
  cursor: pointer;
  user-select: none;
  border-radius: var(--item-radius);
  transition: box-shadow 160ms var(--transition-easing);
}
.missive__close:hover {
  box-shadow: var(--light-shadow), var(--hover-ring);
}
.missive__close-icon {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
}
`;