Skip to content

Commit b968a55

Browse files
refactor: responsiveness, branding, icon. (#26)
1 parent 7308943 commit b968a55

4 files changed

Lines changed: 113 additions & 40 deletions

File tree

src/index.html

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h1>
2626
/><span class="brand-text">@knighted/develop</span></a
2727
>
2828
</h1>
29-
<p>Compiler-as-a-Service (at the edge of your browser).</p>
29+
<p>Browser IDE with compiler-as-a-service.</p>
3030
</div>
3131
<div class="status" id="status">Idle</div>
3232
</header>
@@ -292,8 +292,14 @@ <h2>Component</h2>
292292
>
293293
<svg viewBox="0 0 24 24" aria-hidden="true">
294294
<path
295-
d="M20.017 14.669L23 13.564l-.012-3.208-2.996-1.085a8.455 8.455 0 0 0-.437-1.05l1.329-2.893-2.277-2.26-2.886 1.351a8.396 8.396 0 0 0-1.052-.436L13.564 1l-3.208.012-1.085 2.996a8.485 8.485 0 0 0-1.05.437L5.328 3.116l-2.26 2.276L4.419 8.28a8.378 8.378 0 0 0-.436 1.052L1 10.436l.012 3.208 2.996 1.085a8.46 8.46 0 0 0 .437 1.05l-1.329 2.893 2.276 2.26 2.887-1.351a8.383 8.383 0 0 0 1.052.436L10.436 23l3.208-.012 1.085-2.996a8.478 8.478 0 0 0 1.05-.437l2.893 1.329 2.26-2.276-1.351-2.887a8.382 8.382 0 0 0 .436-1.052zm-.287 3.73l-1.275 1.285-2.694-1.238-.429.215a7.612 7.612 0 0 1-.928.385l-.452.156-1.01 2.789-1.81.007-1.03-2.779-.456-.151a7.394 7.394 0 0 1-.926-.385l-.43-.21-2.688 1.257-1.286-1.275 1.239-2.695-.216-.43a7.551 7.551 0 0 1-.386-.926l-.155-.452-2.79-1.01-.005-1.81 2.777-1.03.152-.456a7.46 7.46 0 0 1 .384-.927l.212-.43L4.27 5.601l1.275-1.285 2.694 1.238.429-.215a7.612 7.612 0 0 1 .928-.385l.452-.156 1.01-2.789 1.81-.007 1.03 2.779.456.151a7.35 7.35 0 0 1 .925.385l.43.211L18.4 4.27l1.285 1.275-1.239 2.695.216.43a7.551 7.551 0 0 1 .386.926l.155.452 2.79 1.01.005 1.81-2.777 1.03-.152.456a7.46 7.46 0 0 1-.384.927l-.212.43zM12 7.2a4.8 4.8 0 1 0 4.8 4.8A4.8 4.8 0 0 0 12 7.2zm0 8.6a3.8 3.8 0 1 1 3.8-3.8 3.804 3.804 0 0 1-3.8 3.8z"
295+
d="M20.017 14.669L23 13.564l-.012-3.208-2.996-1.085a8.455 8.455 0 0 0-.437-1.05l1.329-2.893-2.277-2.26-2.886 1.351a8.396 8.396 0 0 0-1.052-.436L13.564 1l-3.208.012-1.085 2.996a8.485 8.485 0 0 0-1.05.437L5.328 3.116l-2.26 2.276L4.419 8.28a8.378 8.378 0 0 0-.436 1.052L1 10.436l.012 3.208 2.996 1.085a8.46 8.46 0 0 0 .437 1.05l-1.329 2.893 2.276 2.26 2.887-1.351a8.383 8.383 0 0 0 1.052.436L10.436 23l3.208-.012 1.085-2.996a8.478 8.478 0 0 0 1.05-.437l2.893 1.329 2.26-2.276-1.351-2.887a8.382 8.382 0 0 0 .436-1.052zm-.287 3.73l-1.275 1.285-2.694-1.238-.429.215a7.612 7.612 0 0 1-.928.385l-.452.156-1.01 2.789-1.81.007-1.03-2.779-.456-.151a7.394 7.394 0 0 1-.926-.385l-.43-.21-2.688 1.257-1.286-1.275 1.239-2.695-.216-.43a7.551 7.551 0 0 1-.386-.926l-.155-.452-2.79-1.01-.005-1.81 2.777-1.03.152-.456a7.46 7.46 0 0 1 .384-.927l.212-.43L4.27 5.601l1.275-1.285 2.694 1.238.429-.215a7.612 7.612 0 0 1 .928-.385l.452-.156 1.01-2.789 1.81-.007 1.03 2.779.456.151a7.35 7.35 0 0 1 .925.385l.43.211L18.4 4.27l1.285 1.275-1.239 2.695.216.43a7.551 7.551 0 0 1 .386.926l.155.452 2.79 1.01.005 1.81-2.777 1.03-.152.456a7.46 7.46 0 0 1-.384.927l-.212.43zM12 7.2a4.8 4.8 0 1 0 4.8 4.8A4.8 4.8 0 0 0 12 7.2z"
296296
></path>
297+
<circle
298+
class="editor-tools-toggle__inner-ring"
299+
cx="12"
300+
cy="12"
301+
r="3.8"
302+
></circle>
297303
</svg>
298304
</button>
299305
<button
@@ -388,8 +394,14 @@ <h2>Styles</h2>
388394
>
389395
<svg viewBox="0 0 24 24" aria-hidden="true">
390396
<path
391-
d="M20.017 14.669L23 13.564l-.012-3.208-2.996-1.085a8.455 8.455 0 0 0-.437-1.05l1.329-2.893-2.277-2.26-2.886 1.351a8.396 8.396 0 0 0-1.052-.436L13.564 1l-3.208.012-1.085 2.996a8.485 8.485 0 0 0-1.05.437L5.328 3.116l-2.26 2.276L4.419 8.28a8.378 8.378 0 0 0-.436 1.052L1 10.436l.012 3.208 2.996 1.085a8.46 8.46 0 0 0 .437 1.05l-1.329 2.893 2.276 2.26 2.887-1.351a8.383 8.383 0 0 0 1.052.436L10.436 23l3.208-.012 1.085-2.996a8.478 8.478 0 0 0 1.05-.437l2.893 1.329 2.26-2.276-1.351-2.887a8.382 8.382 0 0 0 .436-1.052zm-.287 3.73l-1.275 1.285-2.694-1.238-.429.215a7.612 7.612 0 0 1-.928.385l-.452.156-1.01 2.789-1.81.007-1.03-2.779-.456-.151a7.394 7.394 0 0 1-.926-.385l-.43-.21-2.688 1.257-1.286-1.275 1.239-2.695-.216-.43a7.551 7.551 0 0 1-.386-.926l-.155-.452-2.79-1.01-.005-1.81 2.777-1.03.152-.456a7.46 7.46 0 0 1 .384-.927l.212-.43L4.27 5.601l1.275-1.285 2.694 1.238.429-.215a7.612 7.612 0 0 1 .928-.385l.452-.156 1.01-2.789 1.81-.007 1.03 2.779.456.151a7.35 7.35 0 0 1 .925.385l.43.211L18.4 4.27l1.285 1.275-1.239 2.695.216.43a7.551 7.551 0 0 1 .386.926l.155.452 2.79 1.01.005 1.81-2.777 1.03-.152.456a7.46 7.46 0 0 1-.384.927l-.212.43zM12 7.2a4.8 4.8 0 1 0 4.8 4.8A4.8 4.8 0 0 0 12 7.2zm0 8.6a3.8 3.8 0 1 1 3.8-3.8 3.804 3.804 0 0 1-3.8 3.8z"
397+
d="M20.017 14.669L23 13.564l-.012-3.208-2.996-1.085a8.455 8.455 0 0 0-.437-1.05l1.329-2.893-2.277-2.26-2.886 1.351a8.396 8.396 0 0 0-1.052-.436L13.564 1l-3.208.012-1.085 2.996a8.485 8.485 0 0 0-1.05.437L5.328 3.116l-2.26 2.276L4.419 8.28a8.378 8.378 0 0 0-.436 1.052L1 10.436l.012 3.208 2.996 1.085a8.46 8.46 0 0 0 .437 1.05l-1.329 2.893 2.276 2.26 2.887-1.351a8.383 8.383 0 0 0 1.052.436L10.436 23l3.208-.012 1.085-2.996a8.478 8.478 0 0 0 1.05-.437l2.893 1.329 2.26-2.276-1.351-2.887a8.382 8.382 0 0 0 .436-1.052zm-.287 3.73l-1.275 1.285-2.694-1.238-.429.215a7.612 7.612 0 0 1-.928.385l-.452.156-1.01 2.789-1.81.007-1.03-2.779-.456-.151a7.394 7.394 0 0 1-.926-.385l-.43-.21-2.688 1.257-1.286-1.275 1.239-2.695-.216-.43a7.551 7.551 0 0 1-.386-.926l-.155-.452-2.79-1.01-.005-1.81 2.777-1.03.152-.456a7.46 7.46 0 0 1 .384-.927l.212-.43L4.27 5.601l1.275-1.285 2.694 1.238.429-.215a7.612 7.612 0 0 1 .928-.385l.452-.156 1.01-2.789 1.81-.007 1.03 2.779.456.151a7.35 7.35 0 0 1 .925.385l.43.211L18.4 4.27l1.285 1.275-1.239 2.695.216.43a7.551 7.551 0 0 1 .386.926l.155.452 2.79 1.01.005 1.81-2.777 1.03-.152.456a7.46 7.46 0 0 1-.384.927l-.212.43zM12 7.2a4.8 4.8 0 1 0 4.8 4.8A4.8 4.8 0 0 0 12 7.2z"
392398
></path>
399+
<circle
400+
class="editor-tools-toggle__inner-ring"
401+
cx="12"
402+
cy="12"
403+
r="3.8"
404+
></circle>
393405
</svg>
394406
</button>
395407
<button
@@ -450,7 +462,7 @@ <h2>Styles</h2>
450462
<h2>Preview</h2>
451463
<div class="controls">
452464
<label class="color-control" for="preview-bg-color">
453-
Background
465+
<span class="preview-bg-label">Background</span>
454466
<input id="preview-bg-color" type="color" value="#12141c" />
455467
</label>
456468
<label class="toggle">

src/styles/layout-shell.css

Lines changed: 76 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,48 @@
4545
}
4646

4747
.status {
48+
--status-accent: var(--text-subtle);
49+
--status-bg: var(--surface-chip);
50+
--status-fg: var(--text-subtle);
4851
font-size: 0.9rem;
52+
font-weight: 600;
53+
line-height: 1.2;
54+
display: inline-flex;
55+
align-items: center;
56+
gap: 8px;
4957
padding: 8px 12px;
50-
border-radius: 999px;
51-
background: var(--surface-chip);
52-
color: var(--text-subtle);
58+
border-radius: 10px;
59+
border: 1px solid color-mix(in srgb, var(--status-accent) 40%, var(--border-subtle));
60+
background: var(--status-bg);
61+
color: var(--status-fg);
62+
}
63+
64+
.status::before {
65+
content: '';
66+
width: 8px;
67+
height: 8px;
68+
border-radius: 2px;
69+
background: var(--status-accent);
70+
flex: none;
5371
}
5472

5573
.status--neutral {
56-
background: var(--surface-chip);
57-
color: var(--text-subtle);
74+
--status-accent: var(--text-subtle);
75+
--status-bg: var(--surface-chip);
76+
--status-fg: var(--text-subtle);
77+
border-color: color-mix(in srgb, var(--border-subtle) 72%, transparent);
5878
}
5979

6080
.status--pending {
61-
background: color-mix(in srgb, var(--accent) 18%, transparent);
62-
color: color-mix(in srgb, var(--panel-text) 72%, var(--accent));
81+
--status-accent: color-mix(in srgb, var(--accent) 88%, var(--panel-text));
82+
--status-bg: color-mix(in srgb, var(--accent) 18%, transparent);
83+
--status-fg: color-mix(in srgb, var(--panel-text) 72%, var(--accent));
6384
}
6485

6586
.status--error {
66-
background: color-mix(in srgb, rgb(var(--danger-rgb)) 20%, transparent);
67-
color: color-mix(in srgb, rgb(var(--danger-rgb)) 85%, var(--panel-text));
87+
--status-accent: color-mix(in srgb, rgb(var(--danger-rgb)) 88%, var(--panel-text));
88+
--status-bg: color-mix(in srgb, rgb(var(--danger-rgb)) 20%, transparent);
89+
--status-fg: color-mix(in srgb, rgb(var(--danger-rgb)) 85%, var(--panel-text));
6890
}
6991

7092
.app-grid {
@@ -333,6 +355,23 @@
333355
}
334356
}
335357

358+
@media (max-width: 640px) {
359+
.app-header {
360+
flex-direction: column;
361+
align-items: flex-start;
362+
justify-content: flex-start;
363+
gap: 10px;
364+
}
365+
366+
.app-header p {
367+
max-width: 32ch;
368+
}
369+
370+
.app-header .status {
371+
align-self: flex-start;
372+
}
373+
}
374+
336375
.layout-toggle {
337376
display: inline-grid;
338377
place-content: center;
@@ -441,6 +480,8 @@
441480
}
442481

443482
.app-grid {
483+
--mobile-editor-max-height: clamp(280px, 42dvh, 520px);
484+
--mobile-preview-max-height: clamp(320px, 52dvh, 680px);
444485
grid-template-columns: minmax(0, 1fr);
445486
grid-template-rows: auto auto auto;
446487
height: auto;
@@ -450,25 +491,35 @@
450491
'preview';
451492
}
452493

453-
.component-panel,
454-
.styles-panel,
455-
.preview-panel,
456-
.app-grid--preview-right .component-panel,
457-
.app-grid--preview-right .styles-panel,
458-
.app-grid--preview-right .preview-panel,
459-
.app-grid--preview-left .component-panel,
460-
.app-grid--preview-left .styles-panel,
461-
.app-grid--preview-left .preview-panel {
494+
.app-grid :is(.component-panel, .styles-panel, .preview-panel) {
462495
height: auto;
463-
min-height: var(--expanded-panel-min-height);
464496
}
465497

466-
.component-panel.panel--collapsed-horizontal,
467-
.component-panel.panel--collapsed-vertical,
468-
.styles-panel.panel--collapsed-horizontal,
469-
.styles-panel.panel--collapsed-vertical,
470-
.preview-panel.panel--collapsed-horizontal,
471-
.preview-panel.panel--collapsed-vertical {
498+
.app-grid :is(.component-panel, .styles-panel) {
499+
min-height: min(var(--expanded-panel-min-height), var(--mobile-editor-max-height));
500+
max-height: var(--mobile-editor-max-height);
501+
}
502+
503+
.app-grid .preview-panel {
504+
min-height: min(var(--expanded-panel-min-height), var(--mobile-preview-max-height));
505+
max-height: var(--mobile-preview-max-height);
506+
}
507+
508+
.app-grid :is(.component-panel, .styles-panel) .panel-content {
509+
min-height: 0;
510+
overflow: auto;
511+
}
512+
513+
.app-grid .preview-panel .panel-content {
514+
min-height: 0;
515+
overflow: auto;
516+
}
517+
518+
.app-grid
519+
:is(.component-panel, .styles-panel, .preview-panel):is(
520+
.panel--collapsed-horizontal,
521+
.panel--collapsed-vertical
522+
) {
472523
min-height: 0;
473524
}
474525

src/styles/panels-editor.css

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,7 @@
8383
}
8484

8585
.editor-tools-toggle {
86-
opacity: 0.72;
87-
}
88-
89-
.editor-tools-toggle svg {
90-
width: 15px;
91-
height: 15px;
92-
fill: currentColor;
93-
stroke: none;
86+
opacity: 0.74;
9487
}
9588

9689
.editor-tools-toggle[aria-pressed='true'] {
@@ -100,6 +93,10 @@
10093
color: var(--select-text);
10194
}
10295

96+
.editor-tools-toggle .editor-tools-toggle__inner-ring {
97+
stroke-width: 0.75;
98+
}
99+
103100
.panel-collapse-toggle {
104101
display: inline-flex;
105102
align-items: center;
@@ -391,7 +388,6 @@ textarea:focus {
391388

392389
.component-panel,
393390
.styles-panel {
394-
max-height: none;
395-
min-height: 360px;
391+
min-height: min(360px, var(--mobile-editor-max-height));
396392
}
397393
}

src/styles/preview-controls.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,21 @@
216216
height: 16px;
217217
stroke: currentColor;
218218
fill: none;
219-
stroke-width: 1.8;
219+
stroke-width: 1;
220220
stroke-linecap: round;
221221
stroke-linejoin: round;
222222
}
223+
224+
@media (max-width: 480px) {
225+
.preview-bg-label {
226+
position: absolute;
227+
width: 1px;
228+
height: 1px;
229+
padding: 0;
230+
margin: -1px;
231+
overflow: hidden;
232+
clip: rect(0, 0, 0, 0);
233+
white-space: nowrap;
234+
border: 0;
235+
}
236+
}

0 commit comments

Comments
 (0)