refine editor sheet to floating pill button
All checks were successful
deploy / deploy (push) Successful in 1m32s
All checks were successful
deploy / deploy (push) Successful in 1m32s
- collapsed state: floating pill button in bottom-right corner - removed panel background when collapsed (transparent) - violet accent colour to distinguish from shop theme - white glow outline for visibility on any background - consistent behaviour on mobile and desktop - opens to bottom sheet (mobile) or side panel (desktop) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f4f036b84b
commit
3f96769840
@ -2392,6 +2392,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
@media (prefers-reduced-motion: reduce) {
|
||||||
.editor-sheet {
|
.editor-sheet {
|
||||||
transition: none;
|
transition: none;
|
||||||
@ -2400,52 +2401,87 @@
|
|||||||
|
|
||||||
/* ── Mobile: bottom-anchored ── */
|
/* ── Mobile: bottom-anchored ── */
|
||||||
@media (max-width: 767px) {
|
@media (max-width: 767px) {
|
||||||
|
/* Collapsed: floating pill button, no panel background */
|
||||||
.editor-sheet {
|
.editor-sheet {
|
||||||
bottom: 0;
|
left: auto;
|
||||||
left: 0;
|
right: 16px;
|
||||||
right: 0;
|
bottom: 16px;
|
||||||
height: 85dvh;
|
top: auto;
|
||||||
border-radius: var(--t-radius-lg, 12px) var(--t-radius-lg, 12px) 0 0;
|
width: auto;
|
||||||
transform: translateY(calc(100% - 48px));
|
height: auto;
|
||||||
|
background: transparent;
|
||||||
|
box-shadow: none;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Open: full panel from bottom */
|
||||||
.editor-sheet[data-state="open"] {
|
.editor-sheet[data-state="open"] {
|
||||||
transform: translateY(0);
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
top: 15dvh;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
background: var(--t-surface-base);
|
||||||
|
box-shadow: var(--t-shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.15));
|
||||||
|
border-radius: var(--t-radius-lg, 12px) var(--t-radius-lg, 12px) 0 0;
|
||||||
|
border: 1px solid var(--t-border-default);
|
||||||
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Desktop: right-anchored ── */
|
/* ── Desktop: right-anchored ── */
|
||||||
|
/* ── Desktop: same floating button, side panel when open ── */
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
|
/* Collapsed: floating pill button, no panel background (same as mobile) */
|
||||||
.editor-sheet {
|
.editor-sheet {
|
||||||
|
left: auto;
|
||||||
|
right: 16px;
|
||||||
|
bottom: 16px;
|
||||||
|
top: auto;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
background: transparent;
|
||||||
|
box-shadow: none;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Open: side panel from right */
|
||||||
|
.editor-sheet[data-state="open"] {
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
border-radius: var(--t-radius-lg, 12px) 0 0 var(--t-radius-lg, 12px);
|
|
||||||
width: 420px;
|
width: 420px;
|
||||||
max-width: 90vw;
|
max-width: 90vw;
|
||||||
transform: translateX(calc(100% - 48px));
|
background: var(--t-surface-base);
|
||||||
flex-direction: column;
|
box-shadow: var(--t-shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.15));
|
||||||
}
|
border-radius: var(--t-radius-lg, 12px) 0 0 var(--t-radius-lg, 12px);
|
||||||
|
border: 1px solid var(--t-border-default);
|
||||||
.editor-sheet[data-state="open"] {
|
border-right: none;
|
||||||
transform: translateX(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ── Edit button in collapsed state ── */
|
/* ── Edit button in collapsed state ── */
|
||||||
.editor-sheet-edit-btn {
|
.editor-sheet-edit-btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
padding: 0.375rem 0.75rem;
|
padding: 0.5rem 0.875rem;
|
||||||
background: var(--t-accent);
|
background: oklch(0.5 0.18 280);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 6px;
|
border-radius: 9999px;
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: filter 0.15s;
|
transition: filter 0.15s, box-shadow 0.15s;
|
||||||
|
/* Soft glow for visibility over any background */
|
||||||
|
box-shadow:
|
||||||
|
0 2px 8px rgba(0, 0, 0, 0.2),
|
||||||
|
0 0 0 3px rgba(255, 255, 255, 0.6);
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-sheet-edit-btn:hover {
|
.editor-sheet-edit-btn:hover {
|
||||||
@ -2458,52 +2494,6 @@
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Desktop collapsed: icon-only button with tooltip */
|
|
||||||
@media (min-width: 768px) {
|
|
||||||
.editor-sheet[data-state="collapsed"] .editor-sheet-edit-btn {
|
|
||||||
padding: 0.5rem;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.editor-sheet[data-state="collapsed"] .editor-sheet-edit-btn span {
|
|
||||||
/* Visually hidden but accessible to screen readers */
|
|
||||||
position: absolute;
|
|
||||||
width: 1px;
|
|
||||||
height: 1px;
|
|
||||||
padding: 0;
|
|
||||||
margin: -1px;
|
|
||||||
overflow: hidden;
|
|
||||||
clip: rect(0, 0, 0, 0);
|
|
||||||
white-space: nowrap;
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Tooltip on hover - dark tooltip for visibility on any theme */
|
|
||||||
.editor-sheet[data-state="collapsed"] .editor-sheet-edit-btn::after {
|
|
||||||
content: "Edit page";
|
|
||||||
position: absolute;
|
|
||||||
right: calc(100% + 8px);
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
padding: 0.375rem 0.5rem;
|
|
||||||
background: #1a1a1a;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 0.75rem;
|
|
||||||
font-weight: 500;
|
|
||||||
border-radius: 4px;
|
|
||||||
white-space: nowrap;
|
|
||||||
opacity: 0;
|
|
||||||
pointer-events: none;
|
|
||||||
transition: opacity 0.15s;
|
|
||||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
.editor-sheet[data-state="collapsed"] .editor-sheet-edit-btn:hover::after,
|
|
||||||
.editor-sheet[data-state="collapsed"] .editor-sheet-edit-btn:focus::after {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ── Dirty indicator ── */
|
/* ── Dirty indicator ── */
|
||||||
.editor-sheet-dirty {
|
.editor-sheet-dirty {
|
||||||
|
|||||||
@ -700,6 +700,7 @@ const EditorSheet = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
document.addEventListener("keydown", this._onKeydown)
|
document.addEventListener("keydown", this._onKeydown)
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
destroyed() {
|
destroyed() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user