UI polish Phase 2: deeper restyle (guides toggle, pages/layers panels, topbar, modal, context menu) #7
@@ -83,13 +83,14 @@ const ZonePreview: React.FC<{ craftState: string | null; zone: 'header' | 'foote
|
|||||||
<div
|
<div
|
||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
data-zone-preview={zone}
|
data-zone-preview={zone}
|
||||||
|
className="zone-preview-sep"
|
||||||
style={{
|
style={{
|
||||||
width: '100%',
|
width: '100%',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
pointerEvents: 'none',
|
pointerEvents: 'none',
|
||||||
userSelect: 'none',
|
userSelect: 'none',
|
||||||
borderBottom: zone === 'header' ? '1px dashed rgba(245,158,11,0.3)' : 'none',
|
borderBottom: zone === 'header' ? '1px dashed rgba(148,163,184,0.25)' : 'none',
|
||||||
borderTop: zone === 'footer' ? '1px dashed rgba(245,158,11,0.3)' : 'none',
|
borderTop: zone === 'footer' ? '1px dashed rgba(148,163,184,0.25)' : 'none',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -319,8 +319,12 @@ export const PagesPanel: React.FC = () => {
|
|||||||
padding: '1px 5px',
|
padding: '1px 5px',
|
||||||
borderRadius: 'var(--radius-sm)',
|
borderRadius: 'var(--radius-sm)',
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
|
display: 'inline-flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
gap: 4,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<i className="fa fa-home" aria-hidden="true" style={{ fontSize: 8, color: 'inherit' }} />
|
||||||
Landing
|
Landing
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
|
|||||||
+29
-12
@@ -1053,27 +1053,44 @@ body {
|
|||||||
(called by every component) wires that event to a native
|
(called by every component) wires that event to a native
|
||||||
mouseover/mouseleave listener on each node's dom internally, so this
|
mouseover/mouseleave listener on each node's dom internally, so this
|
||||||
rule is a real mouse-hover highlight for any node (container or leaf).
|
rule is a real mouse-hover highlight for any node (container or leaf).
|
||||||
`data-layer-hovered` is set directly by the Layers panel (LayersPanel.tsx)
|
Scoped under `.canvas-device-frame` and suppressed by `.guides-off` so
|
||||||
on its own row hover/focus -- a separate producer (writing straight to the
|
"Show guides: off" stays airtight. */
|
||||||
target's dom rather than through Craft's `hovered` event, since the
|
.canvas-device-frame [data-craft-hovered] {
|
||||||
action that drives it is stripped from the public `useEditor()` API at
|
|
||||||
runtime) that drives the identical highlight when hovering a layer row.
|
|
||||||
Both are scoped under `.canvas-device-frame` and suppressed by
|
|
||||||
`.guides-off` so "Show guides: off" stays airtight either way. */
|
|
||||||
.canvas-device-frame [data-craft-hovered],
|
|
||||||
.canvas-device-frame [data-layer-hovered] {
|
|
||||||
outline: 2px dashed var(--color-accent) !important;
|
outline: 2px dashed var(--color-accent) !important;
|
||||||
outline-offset: -1px;
|
outline-offset: -1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* `data-layer-hovered` is set directly by the Layers panel (LayersPanel.tsx)
|
||||||
|
on its own row hover/focus -- a separate producer (writing straight to the
|
||||||
|
target's dom rather than through Craft's `hovered` event, since the
|
||||||
|
action that drives it is stripped from the public `useEditor()` API at
|
||||||
|
runtime) that drives a highlight when hovering a layer row. This is a
|
||||||
|
deliberate locator action (not a structural drop-target guide), so it
|
||||||
|
uses a SOLID outline -- visually distinct from the dashed structural
|
||||||
|
guides -- and is intentionally NOT suppressed by `.guides-off`: hiding
|
||||||
|
guides shouldn't blind the Layers-panel hover→canvas locator. */
|
||||||
|
.canvas-device-frame [data-layer-hovered] {
|
||||||
|
outline: 2px solid var(--color-accent) !important;
|
||||||
|
outline-offset: -1px;
|
||||||
|
}
|
||||||
|
|
||||||
/* "Show guides" topbar toggle (TopBar.tsx) -- flips this class on
|
/* "Show guides" topbar toggle (TopBar.tsx) -- flips this class on
|
||||||
.canvas-device-frame to hide every guide/hover outline at once. Default ON. */
|
.canvas-device-frame to hide structural drop-target guides and the
|
||||||
|
mouse-hover highlight at once. Default ON. `[data-layer-hovered]` is
|
||||||
|
deliberately excluded -- see rule above. */
|
||||||
.canvas-device-frame.guides-off [data-craft-node],
|
.canvas-device-frame.guides-off [data-craft-node],
|
||||||
.canvas-device-frame.guides-off [data-craft-hovered],
|
.canvas-device-frame.guides-off [data-craft-hovered] {
|
||||||
.canvas-device-frame.guides-off [data-layer-hovered] {
|
|
||||||
outline: none !important;
|
outline: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Header/footer zone-preview separator (Canvas.tsx ZonePreview) -- a neutral
|
||||||
|
dashed rule marking where the editable page meets the read-only
|
||||||
|
header/footer preview. It's a structural guide, so it hides with the
|
||||||
|
rest when "Show guides" is off. */
|
||||||
|
.canvas-device-frame.guides-off .zone-preview-sep {
|
||||||
|
border-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------
|
||||||
Craft.js Selection Indicator
|
Craft.js Selection Indicator
|
||||||
-------------------------------------------------------------------------- */
|
-------------------------------------------------------------------------- */
|
||||||
|
|||||||
Reference in New Issue
Block a user