Spaces:
Paused
Paused
File size: 7,449 Bytes
aceb1b2 | 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 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | /* Universal Memos sidebar.
Polished pass: consistent spacing scale, full interaction/focus
states, tinted neutrals, WCAG-AA contrast, motion-reduced friendly.
Vanilla CSS, no deps, no build step. */
:root {
--memo-space-1: 4px;
--memo-space-2: 8px;
--memo-space-3: 12px;
--memo-space-4: 16px;
--memo-space-5: 24px;
--memo-radius: 8px;
/* Tinted neutrals (slight blue tint, not pure gray/black) */
--memo-ink: #1f2330;
--memo-ink-soft: #5b6072;
--memo-line: #e4e5ec;
--memo-surface: #ffffff;
--memo-surface-2: #f7f8fb;
--memo-accent: #4063b8;
--memo-accent-ink: #ffffff;
--memo-focus: #6c8cff;
}
.memo-panel-toggle {
position: fixed;
right: 0;
top: 42%;
transform: translateY(-50%);
z-index: 1040;
display: flex;
align-items: center;
gap: var(--memo-space-2);
min-height: 44px;
border: 1px solid var(--memo-line);
border-right: none;
background: var(--memo-surface);
color: var(--memo-ink);
padding: 10px 14px;
border-radius: var(--memo-radius) 0 0 var(--memo-radius);
box-shadow: -1px 1px 6px rgba(31, 35, 48, 0.08);
cursor: pointer;
font-size: 0.85rem;
font-weight: 600;
transition: background-color 160ms ease-out, transform 160ms ease-out;
}
.memo-panel-toggle:hover { background: var(--memo-surface-2); transform: translateY(-50%) translateX(-2px); }
.memo-panel-toggle:active { background: #eef0f6; }
.memo-panel {
position: fixed;
right: 0;
top: 0;
height: 100vh;
width: 360px;
max-width: 92vw;
background: var(--memo-surface);
border-left: 1px solid var(--memo-line);
box-shadow: -4px 0 24px rgba(31, 35, 48, 0.10);
z-index: 1050;
display: flex;
flex-direction: column;
color: var(--memo-ink);
}
/* `hidden` keeps native display:none semantics (out of the a11y tree).
A short fade-in on open keeps it from snapping in without animating
layout. */
.memo-panel:not([hidden]) { animation: memo-panel-in 200ms ease-out; }
@keyframes memo-panel-in {
from { opacity: 0; transform: translateX(12px); }
to { opacity: 1; transform: translateX(0); }
}
.memo-panel-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--memo-space-4);
border-bottom: 1px solid var(--memo-line);
font-size: 0.95rem;
font-weight: 700;
letter-spacing: 0.01em;
}
.memo-panel-header button {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border: none;
border-radius: 6px;
background: none;
font-size: 1.25rem;
line-height: 1;
cursor: pointer;
color: var(--memo-ink-soft);
transition: background-color 140ms ease-out, color 140ms ease-out;
}
.memo-panel-header button:hover { background: var(--memo-surface-2); color: var(--memo-ink); }
.memo-list {
flex: 1;
overflow-y: auto;
padding: var(--memo-space-4);
display: flex;
flex-direction: column;
gap: var(--memo-space-3);
}
.memo-empty {
color: var(--memo-ink-soft);
font-size: 0.85rem;
text-align: center;
margin-top: var(--memo-space-5);
}
.memo-item {
border: 1px solid var(--memo-line);
border-radius: var(--memo-radius);
padding: var(--memo-space-3) var(--memo-space-4);
background: var(--memo-surface-2);
transition: border-color 140ms ease-out;
}
.memo-item:hover { border-color: #cdd1e0; }
.memo-item .memo-body {
white-space: pre-wrap;
word-break: break-word;
font-size: 0.9rem;
line-height: 1.5;
color: var(--memo-ink);
}
.memo-item .memo-meta {
margin-top: var(--memo-space-2);
font-size: 0.72rem;
color: var(--memo-ink-soft);
display: flex;
gap: var(--memo-space-2);
align-items: center;
flex-wrap: wrap;
}
.memo-badge {
border-radius: 999px;
padding: 1px 8px;
font-size: 0.68rem;
font-weight: 600;
letter-spacing: 0.02em;
border: 1px solid transparent;
}
/* WCAG-AA contrast on the small badge text */
.memo-badge.private { background: #eceef4; color: #494f63; border-color: #dcdfe9; }
.memo-badge.shared { background: #e2f1e7; color: #246b3c; border-color: #bcdec8; }
.memo-badge.anchor { background: #e8edfa; color: #2f4ea0; border-color: #c7d4f0; }
.memo-actions { margin-left: auto; display: flex; gap: var(--memo-space-3); }
.memo-actions button {
border: none;
background: none;
color: var(--memo-accent);
cursor: pointer;
font-size: 0.74rem;
font-weight: 600;
padding: 2px 2px;
border-radius: 4px;
transition: color 140ms ease-out, background-color 140ms ease-out;
}
.memo-actions button:hover { color: #2c4a93; background: #eef2fb; }
.memo-actions button[data-act="del"] { color: #b23b3b; }
.memo-actions button[data-act="del"]:hover { color: #8f2a2a; background: #fbeeee; }
.memo-composer {
border-top: 1px solid var(--memo-line);
padding: var(--memo-space-4);
display: flex;
flex-direction: column;
gap: var(--memo-space-3);
background: var(--memo-surface);
}
.memo-composer textarea {
width: 100%;
min-height: 68px;
resize: vertical;
border: 1px solid var(--memo-line);
border-radius: 6px;
padding: var(--memo-space-2) var(--memo-space-3);
font: inherit;
font-size: 0.88rem;
line-height: 1.45;
color: var(--memo-ink);
transition: border-color 140ms ease-out, box-shadow 140ms ease-out;
}
.memo-composer textarea::placeholder { color: #9aa0b4; }
.memo-composer-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--memo-space-2);
font-size: 0.8rem;
color: var(--memo-ink-soft);
}
.memo-composer select {
font: inherit;
font-size: 0.8rem;
padding: 4px 6px;
border: 1px solid var(--memo-line);
border-radius: 5px;
background: var(--memo-surface);
color: var(--memo-ink);
}
.memo-primary {
border: 1px solid var(--memo-accent);
background: var(--memo-accent);
color: var(--memo-accent-ink);
min-height: 36px;
padding: 7px 16px;
border-radius: 6px;
cursor: pointer;
font-size: 0.85rem;
font-weight: 600;
transition: background-color 150ms ease-out, transform 120ms ease-out;
}
.memo-primary:hover { background: #36559e; }
.memo-primary:active { transform: translateY(1px); }
.memo-anchor-hint {
font-size: 0.76rem;
color: #2f4ea0;
background: #e8edfa;
border: 1px solid #c7d4f0;
border-radius: 6px;
padding: var(--memo-space-2) var(--memo-space-3);
}
.memo-anchor-hint label {
display: flex;
align-items: flex-start;
gap: var(--memo-space-2);
margin: 0;
cursor: pointer;
}
/* Visible keyboard focus everywhere (never rely on color alone) */
.memo-panel-toggle:focus-visible,
.memo-panel button:focus-visible,
.memo-panel textarea:focus-visible,
.memo-panel select:focus-visible,
.memo-actions button:focus-visible {
outline: 2px solid var(--memo-focus);
outline-offset: 2px;
}
.memo-composer textarea:focus {
outline: none;
border-color: var(--memo-focus);
box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.18);
}
@media (prefers-reduced-motion: reduce) {
.memo-panel,
.memo-panel-toggle,
.memo-primary,
.memo-item,
.memo-actions button,
.memo-panel-header button {
transition: none;
}
.memo-panel:not([hidden]) { animation: none; }
}
|