Skip to content

Commit 3e0249c

Browse files
authored
Merge pull request #42 from azadshaikh/main
style(component-preview): enhance layout and alignment of card and modal components
2 parents 0ac145f + 3b267a0 commit 3e0249c

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/html/components/component-preview/component-preview.astro

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,14 @@ const backgroundColor = bgColor ? 'var(--content-wrapper-bg)' : 'transparent'
7373
data-bg-color={bgColor.toString()}
7474
{...iframeSrc && { 'data-external-src': iframeSrc }}
7575
>
76-
<div class="card-header p-3 border-bottom d-flex justify-content-between align-items-center">
77-
<span class="card-title fs-6 mb-0">{title}</span>
76+
<div class="card-header p-3 border-bottom d-grid" style="grid-template-columns: 1fr auto 1fr;">
77+
<span class="card-title fs-6 mb-0 d-flex align-items-center">{title}</span>
7878

79-
<PreviewDevices />
79+
<div class="d-flex justify-content-center">
80+
<PreviewDevices />
81+
</div>
8082

81-
<div class="d-flex justify-content-end">
83+
<div class="d-flex justify-content-end align-items-center">
8284
{
8385
!disableModal && (
8486
<PreviewButton
@@ -295,14 +297,19 @@ const backgroundColor = bgColor ? 'var(--content-wrapper-bg)' : 'transparent'
295297
style="max-width: 95vw; height: 95vh; margin: 1rem auto;"
296298
>
297299
<div class="modal-content border-0 h-100">
298-
<div class="modal-header py-2 d-flex justify-content-between align-items-center bg-body-secondary border-bottom">
299-
<span class="modal-title fs-6 mb-0" id={`${previewId}-label`}>
300+
<div
301+
class="modal-header py-2 d-grid bg-body-secondary border-bottom"
302+
style="grid-template-columns: 1fr auto 1fr;"
303+
>
304+
<span class="modal-title fs-6 mb-0 d-flex align-items-center" id={`${previewId}-label`}>
300305
{title}
301306
</span>
302307

303-
<PreviewDevices />
308+
<div class="d-flex justify-content-center">
309+
<PreviewDevices />
310+
</div>
304311

305-
<div class="d-flex justify-content-end gap-2">
312+
<div class="d-flex justify-content-end gap-2 align-items-center">
306313
<PreviewButton
307314
icon="ri-sun-line"
308315
title="Toggle Theme"

0 commit comments

Comments
 (0)