Skip to content

Commit 0878d1c

Browse files
committed
Fix mobile experience
1 parent 91fb70b commit 0878d1c

File tree

3 files changed

+35
-23
lines changed

3 files changed

+35
-23
lines changed

src/app.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ body {
4444
margin: 0;
4545
background: var(--bg-primary);
4646
color: var(--text-primary);
47+
height: 100dvh;
48+
overflow: hidden;
4749
}
4850

4951
@layer atoms {
@@ -77,6 +79,9 @@ body {
7779
color: var(--text-primary);
7880
text-transform: uppercase;
7981
letter-spacing: 0.5px;
82+
overflow: hidden;
83+
text-wrap: nowrap;
84+
text-overflow: ellipsis;
8085
}
8186

8287
color-input {

src/app.svelte

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,8 @@
279279
onkeydown={handleKeyDown}
280280
/>
281281

282-
<div class="container">
283-
<!-- Main Content -->
284-
<div class="content">
282+
<div class="app">
283+
<div class="horizontal-container">
285284
<!-- Left Panel: Design Tokens -->
286285
<aside class="panel left-panel">
287286
<div class="panel-header">
@@ -411,52 +410,52 @@
411410
</div>
412411

413412
<style>
414-
.container {
415-
display: flex;
416-
flex-direction: column;
417-
height: 100vh;
413+
.app {
414+
container-type: inline-size;
415+
width: 100%;
416+
height: 100%;
417+
display: grid;
418418
}
419419
420-
/* Main content */
421-
.content {
422-
display: flex;
423-
flex: 1;
424-
overflow: hidden;
420+
.horizontal-container {
421+
display: grid;
422+
grid-template-columns: max(320px, 30%) 1fr;
423+
grid-template-rows: 100%;
424+
overflow-x: auto;
425+
overflow-y: hidden;
426+
scroll-snap-type: x mandatory;
427+
428+
@container (width <= 720px) {
429+
grid-template-columns: 100cqw 100cqw;
430+
}
425431
}
426432
427433
/* Panels */
428434
.panel {
429435
display: grid;
430436
grid-template-rows: var(--panel-header-height) 1fr;
431437
background: var(--bg-primary);
432-
border-right: 1px solid var(--border-color);
438+
scroll-snap-align: center;
433439
}
434440
435441
.left-panel {
436-
width: max(320px, 30%);
437442
border-right: 1px solid var(--border-color);
438-
anchor-name: --app-left-panel;
439-
}
440-
441-
.right-panel {
442-
flex: 1;
443-
border-right: none;
444443
}
445444
446445
.panel-header {
447446
display: flex;
448447
justify-content: flex-start;
449448
align-items: center;
450-
padding: 0 12px;
449+
padding: 0 8px;
451450
border-bottom: 1px solid var(--border-color);
452451
flex-shrink: 0;
453452
background: var(--bg-primary);
454453
gap: 8px;
454+
overflow: hidden;
455455
}
456456
457457
.toolbar-actions {
458458
display: flex;
459-
gap: 8px;
460459
align-items: center;
461460
margin-left: auto;
462461
}

src/editor.svelte

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,13 +1107,21 @@
11071107
top: calc(var(--panel-header-height) + 16px);
11081108
bottom: auto;
11091109
right: auto;
1110-
max-height: calc(100dvh - var(--panel-header-height) - 16px - 16px);
1110+
max-height: calc(100cqh - var(--panel-header-height) - 16px - 16px);
11111111
width: 360px;
11121112
left: max(320px, 30%);
11131113
display: grid;
11141114
/* collapse heading and content in safari */
11151115
grid-template-rows: max-content max-content;
11161116
overflow: auto;
1117+
1118+
@container (width <= 720px) {
1119+
margin: auto;
1120+
inset: 8px;
1121+
width: auto;
1122+
height: auto;
1123+
max-height: none;
1124+
}
11171125
}
11181126
11191127
.input-with-button {

0 commit comments

Comments
 (0)