Multiple style improvements and pixel layout fixes
This commit is contained in:
parent
e385c7291c
commit
de9b80e23d
|
@ -356,22 +356,16 @@
|
|||
}
|
||||
|
||||
/* Preview styles */
|
||||
/* The additional 6px of size is to account for 4px padding and 2px border */
|
||||
#clip-root.preview {
|
||||
padding: 2px;
|
||||
padding: 6px;
|
||||
}
|
||||
#clip-root.tablet-preview {
|
||||
width: calc(1024px + 6px);
|
||||
height: calc(768px + 6px);
|
||||
width: calc(1024px + 12px);
|
||||
height: calc(768px + 12px);
|
||||
}
|
||||
#clip-root.mobile-preview {
|
||||
width: calc(390px + 6px);
|
||||
height: calc(844px + 6px);
|
||||
}
|
||||
|
||||
.preview #app-root {
|
||||
border: 1px solid var(--spectrum-global-color-gray-300);
|
||||
border-radius: 4px;
|
||||
width: calc(390px + 12px);
|
||||
height: calc(844px + 12px);
|
||||
}
|
||||
|
||||
/* Print styles */
|
||||
|
|
|
@ -619,6 +619,7 @@
|
|||
if (isBlock) {
|
||||
return
|
||||
}
|
||||
console.log("select", id)
|
||||
e.stopPropagation()
|
||||
builderStore.actions.selectComponent(id)
|
||||
}
|
||||
|
@ -691,7 +692,7 @@
|
|||
data-parent={$component.id}
|
||||
style={wrapperCSS}
|
||||
{draggable}
|
||||
on:click={handleWrapperClick}
|
||||
on:click|self={handleWrapperClick}
|
||||
>
|
||||
{#if errorState}
|
||||
<ComponentErrorState
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
.grid :global(> .component) {
|
||||
display: flex;
|
||||
overflow: auto;
|
||||
pointer-events: all;
|
||||
|
||||
/* On desktop, use desktop metadata and fall back to mobile */
|
||||
/* Position vars */
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
z-index: var(--zIndex);
|
||||
border: 2px solid var(--color);
|
||||
pointer-events: none;
|
||||
border-radius: 2px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.indicator.withText {
|
||||
border-top-left-radius: 0;
|
||||
|
@ -123,7 +123,7 @@
|
|||
|
||||
/* Anchor */
|
||||
.anchor {
|
||||
--size: 24px;
|
||||
--size: 20px;
|
||||
position: absolute;
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
|
@ -133,11 +133,12 @@
|
|||
border-radius: 50%;
|
||||
}
|
||||
.anchor-inner {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
width: calc(var(--size) / 2);
|
||||
height: calc(var(--size) / 2);
|
||||
background: white;
|
||||
border: 2px solid var(--color);
|
||||
pointer-events: none;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.anchor.right {
|
||||
right: calc(var(--size) / -2 - 1px);
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
export let prefix = null
|
||||
export let allowResizeAnchors = false
|
||||
|
||||
// Offset = 6 (clip-root padding) - 1 (half the border thickness)
|
||||
const offset = 6 - 1
|
||||
const config = memo($$props)
|
||||
const errorColor = "var(--spectrum-global-color-static-red-600)"
|
||||
const defaultState = () => ({
|
||||
|
@ -146,11 +148,10 @@
|
|||
})
|
||||
observer.observe(child)
|
||||
observers.push(observer)
|
||||
|
||||
const elBounds = child.getBoundingClientRect()
|
||||
nextState.indicators.push({
|
||||
top: Math.round(elBounds.top + scrollY - deviceBounds.top + 1),
|
||||
left: Math.round(elBounds.left + scrollX - deviceBounds.left + 1),
|
||||
top: Math.round(elBounds.top + scrollY - deviceBounds.top + offset),
|
||||
left: Math.round(elBounds.left + scrollX - deviceBounds.left + offset),
|
||||
width: Math.round(elBounds.width + 2),
|
||||
height: Math.round(elBounds.height + 2),
|
||||
visible: false,
|
||||
|
|
Loading…
Reference in New Issue