forked from Creditra/Creditra-Frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandPalette.css
More file actions
213 lines (184 loc) · 4.88 KB
/
Copy pathCommandPalette.css
File metadata and controls
213 lines (184 loc) · 4.88 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
/* CommandPalette — Cmd/Ctrl+K overlay
WCAG 2.1 AA: colours meet 4.5:1 on dark surface, focus rings are visible */
.cp-overlay {
position: fixed;
inset: 0;
z-index: 80;
display: flex;
align-items: flex-start;
justify-content: center;
padding-top: clamp(4rem, 12vh, 8rem);
padding-inline: 1rem;
}
.cp-backdrop {
position: absolute;
inset: 0;
background: rgba(7, 10, 14, 0.75);
backdrop-filter: blur(3px);
}
.cp-dialog {
position: relative;
width: min(600px, 100%);
border: 1px solid rgba(88, 166, 255, 0.25);
border-radius: 1rem;
background: linear-gradient(180deg, rgba(22, 28, 40, 0.99), rgba(13, 17, 23, 0.99));
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
overflow: hidden;
animation: cpEnter 150ms ease-out;
}
/* ── Search row ─────────────────────────────────────────────────────────── */
.cp-search-row {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.75rem 1rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.cp-search-icon {
font-size: 1rem;
color: var(--muted, #8b949e);
flex-shrink: 0;
}
.cp-input {
flex: 1;
background: transparent;
border: none;
outline: none;
color: var(--text, #e6edf3);
font-size: 1rem;
line-height: 1.5;
caret-color: var(--accent, #58a6ff);
}
.cp-input::placeholder {
color: var(--muted, #8b949e);
}
.cp-close {
display: flex;
align-items: center;
background: transparent;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 0.4rem;
padding: 0.15rem 0.45rem;
cursor: pointer;
color: var(--muted, #8b949e);
}
.cp-close:focus-visible {
outline: 2px solid var(--accent, #58a6ff);
outline-offset: 2px;
}
.cp-close kbd {
font-size: 0.75rem;
font-family: inherit;
color: inherit;
}
/* ── Results list ───────────────────────────────────────────────────────── */
.cp-list {
list-style: none;
margin: 0;
padding: 0.375rem 0;
max-height: min(360px, 60vh);
overflow-y: auto;
overscroll-behavior: contain;
}
.cp-list li[aria-selected="true"] > .cp-item {
/* reinforced by .cp-item--active; aria-selected is for AT */
}
.cp-empty {
padding: 1.25rem 1rem;
text-align: center;
color: var(--muted, #8b949e);
font-size: 0.9rem;
}
.cp-item {
display: flex;
align-items: center;
gap: 0.75rem;
width: 100%;
padding: 0.625rem 1rem;
background: transparent;
border: none;
cursor: pointer;
color: var(--text, #e6edf3);
text-align: left;
border-radius: 0;
transition: background 80ms;
}
.cp-item:focus-visible {
outline: 2px solid var(--accent, #58a6ff);
outline-offset: -2px;
}
.cp-item--active,
.cp-item:hover {
background: rgba(88, 166, 255, 0.12);
}
.cp-item-icon {
font-size: 1.1rem;
flex-shrink: 0;
width: 1.5rem;
text-align: center;
/* neutral — purely decorative */
}
.cp-item-text {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 0.1rem;
}
.cp-item-label {
font-size: 0.9375rem;
font-weight: 500;
/* #e6edf3 on dark bg: contrast ~13:1 ✓ AA */
}
.cp-item-desc {
font-size: 0.8125rem;
color: var(--muted, #8b949e);
/* #8b949e on dark bg: contrast ~4.8:1 ✓ AA */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.cp-item-hint {
flex-shrink: 0;
}
.cp-item-hint kbd {
font-size: 0.75rem;
font-family: inherit;
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 0.3rem;
padding: 0.1rem 0.35rem;
background: rgba(255, 255, 255, 0.05);
color: var(--muted, #8b949e);
}
/* ── Footer ─────────────────────────────────────────────────────────────── */
.cp-footer {
display: flex;
gap: 1rem;
padding: 0.5rem 1rem;
border-top: 1px solid rgba(255, 255, 255, 0.07);
color: var(--muted, #8b949e);
font-size: 0.75rem;
}
.cp-footer kbd {
font-family: inherit;
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 0.3rem;
padding: 0.05rem 0.3rem;
background: rgba(255, 255, 255, 0.05);
color: var(--muted, #8b949e);
font-size: 0.7rem;
}
/* ── Animation ──────────────────────────────────────────────────────────── */
@keyframes cpEnter {
from { opacity: 0; transform: translateY(-6px) scale(0.98); }
to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
.cp-dialog { animation: none; }
}
@media (max-width: 480px) {
.cp-overlay { padding-top: 2rem; padding-inline: 0.5rem; }
.cp-footer { display: none; }
}
/* Reduced Motion Override */
[data-motion="reduced"] .cp-dialog { animation: none; }