.component-viewer { border-radius: var(--radius-xs); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; > .controls { align-items: center; background: var(--color-bg-surface); border-top: 1px solid var(--color-border-subtle); display: flex; flex-wrap: wrap; gap: var(--spacing-sm); justify-content: space-between; padding: var(--spacing-sm); position: relative; .example-select { line-height: 0; } .end-segments { display: flex; flex-grow: 1; flex-wrap: wrap; gap: var(--spacing-sm); justify-content: flex-end; } .hidden-segments { display: flex; flex-grow: 1; flex-wrap: wrap; gap: var(--spacing-sm); justify-content: flex-end; opacity: 0; transition: opacity var(--animation-normal) ease; } &:hover .hidden-segments { opacity: 1; } .device-size-segments, .direction-segments, .theme-segments, .view-segments { .options { display: flex; gap: 0; } .option { margin: 0; } .segment { min-width: auto; padding: var(--spacing-xs); .segment-icon { height: 1rem; width: 1rem; } } } .view-segments { margin-right: 0; } .resize-handle { cursor: ns-resize; height: 5px; left: calc(var(--spacing-sm) * -1); margin: 0 var(--spacing-sm); position: absolute; right: calc(var(--spacing-sm) * -1); top: -1px; transition: background-color var(--animation-normal) ease; &:hover { background: var(--color-border); } &.dragging { background: var(--color-border-strong); } } } > .previews { container-type: inline-size; max-height: 30rem; min-height: 10rem; > .preview { background-color: var(--color-bg); border: 1px solid var(--color-border-subtle); border-bottom: 0; border-radius: var(--radius-xs); border-bottom-left-radius: 0; border-bottom-right-radius: 0; display: none; height: 100%; max-height: inherit; min-height: inherit; overflow-y: auto; position: relative; transition: max-width var(--animation-slow) ease-in-out; > .examples > *:first-child { margin-top: 0 !important; } } > .preview.active { display: block; } > .code { display: none; height: 100%; max-height: inherit; min-height: inherit; overflow-y: auto; position: relative; .astro-code { overflow-y: scroll; code { counter-reset: line; } .line { &::before { color: #6e7681; content: counter(line); counter-increment: line; display: inline-block; margin-right: 16px; min-width: 2em; padding-left: 16px; text-align: right; user-select: none; } } } .code-header { position: absolute; right: var(--spacing-lg); top: var(--spacing-sm); z-index: 10; } } } } .hide { display: none; } .component-viewer[data-device-size="mobile"] .preview { max-width: var(--content-width-xs); } .component-viewer[data-device-size="tablet"] .preview { max-width: var(--content-width-lg); } .component-viewer[data-device-size="desktop"] .preview { max-width: 100%; }