Files
persionalBrand/apps/admin/src/features/brand/ComponentTemplatePreview.css
T

174 lines
3.7 KiB
CSS

.component-template-preview-shell {
height: 100%;
}
.component-template-preview__tools {
display: flex;
gap: 8px;
padding: 8px 12px;
border-bottom: 1px solid var(--admin-border);
background: #fff;
}
.component-template-preview__tools button {
padding: 4px 12px;
border: 1px solid var(--admin-border);
border-radius: 6px;
background: #fff;
cursor: pointer;
}
.component-template-preview__tools button[aria-pressed="true"] {
border-color: var(--admin-primary);
color: var(--admin-primary);
}
.component-template-preview {
position: relative;
width: 100%;
height: calc(100% - 49px);
min-height: 510px;
padding: 24px 16px;
overflow-x: hidden;
overflow-y: auto;
background: var(--admin-fill);
}
.component-template-preview__canvas {
position: relative;
container-type: inline-size;
width: min(100%, 390px);
min-height: calc(100% - 48px);
margin: 0 auto;
overflow: visible;
border-radius: 14px;
background: #fff;
box-shadow:
0 0 0 1px rgba(0, 0, 0, 0.04),
0 10px 30px rgba(0, 0, 0, 0.08);
}
:where(.component-template-preview__canvas) {
--brand-button-height: 11.7333333cqw;
--brand-button-compact-height: 6.1333333cqw;
}
.component-template-preview__canvas,
.component-template-preview__canvas * {
box-sizing: border-box;
}
.component-template-preview__canvas > * {
width: 100%;
max-width: 100%;
}
:where(.component-template-preview__canvas) button {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: var(--brand-button-height);
appearance: none;
margin: 0;
padding: 0;
border: 0;
border-radius: 0;
background: transparent;
color: inherit;
font: inherit;
line-height: 1.5;
text-align: center;
}
:where(.component-template-preview__canvas) input {
display: block;
width: 100%;
min-width: 0;
}
.component-template-preview__canvas img {
flex-shrink: 0;
display: block;
max-width: 100%;
object-fit: cover;
}
.component-template-preview[data-editor-mode="edit"] [data-editor-target] {
cursor: pointer;
}
.component-template-preview__outline {
position: absolute;
z-index: 5;
pointer-events: none;
border: 2px solid var(--admin-primary);
border-radius: 4px;
}
.component-template-preview__outline.is-selected {
z-index: 6;
border-color: var(--admin-primary);
box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.16);
}
.component-template-preview__composite-select {
position: absolute;
z-index: 7;
width: max-content !important;
padding: 2px 8px !important;
border: 1px solid var(--admin-primary) !important;
border-radius: 4px !important;
background: #fff !important;
color: var(--admin-primary) !important;
font-size: 12px !important;
line-height: 20px !important;
cursor: pointer;
}
.component-template-preview__outline span {
position: absolute;
top: 0;
left: 0;
max-width: calc(100% - 8px);
transform: translateY(-100%);
padding: 2px 7px;
overflow: hidden;
border-radius: 4px 4px 0 0;
background: var(--admin-primary);
color: #fff;
font-size: 12px;
line-height: 18px;
text-overflow: ellipsis;
white-space: nowrap;
}
.component-template-preview__outline.is-selected span {
top: 4px;
transform: none;
}
.component-template-preview__tools[hidden] {
display: none;
}
.component-template-preview-shell:has(.component-template-preview__tools[hidden])
.component-template-preview {
height: 100%;
}
.component-template-preview__overlay-host {
position: absolute;
inset: 0;
z-index: 5;
pointer-events: none;
display: none;
}
.component-template-preview__overlay-host.is-visible {
display: block;
}
.component-template-preview__overlay-host > .component-template-preview__composite-select {
pointer-events: auto;
}