Skip to content

Commit 5ceb467

Browse files
committed
style: refine layout and styling of LiveDemo component for improved usability
1 parent bc3acff commit 5ceb467

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

docs/src/components/LiveDemo.astro

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</select>
2525
</div>
2626
<div class="control-item">
27-
<label for="demo-exclude">Exclude Repos (comma-separated)</label>
27+
<label for="demo-exclude">Exclude Repos</label>
2828
<input type="text" id="demo-exclude" placeholder="repo-one, repo-two" />
2929
</div>
3030
</div>
@@ -139,16 +139,22 @@
139139
</script>
140140

141141
<style>
142+
/* Override Starlight's .sl-markdown-content spacing rules */
143+
.demo-wrapper,
144+
.demo-wrapper * {
145+
margin-top: 0 !important;
146+
}
147+
142148
.demo-wrapper {
143-
margin: 2rem 0;
149+
margin: 2rem 0 !important;
144150
}
145151

146152
.demo-controls {
147153
background: var(--sl-color-bg-sidebar);
148154
border: 1px solid var(--sl-color-gray-5);
149155
border-radius: 0.75rem;
150156
padding: 2rem;
151-
margin-bottom: 1.5rem;
157+
margin-bottom: 1.5rem !important;
152158
display: flex;
153159
flex-direction: column;
154160
gap: 1.5rem;
@@ -162,7 +168,7 @@
162168

163169
.control-row {
164170
display: grid;
165-
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
171+
grid-template-columns: repeat(4, 1fr);
166172
gap: 1rem;
167173
}
168174

@@ -218,14 +224,20 @@
218224
}
219225

220226
.control-group .control-row {
221-
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
227+
grid-template-columns: repeat(3, 1fr);
228+
}
229+
230+
@media (max-width: 768px) {
231+
.control-group .control-row {
232+
grid-template-columns: 1fr;
233+
}
222234
}
223235

224236
.control-group-label {
225237
font-size: 0.9rem;
226238
font-weight: 700;
227239
color: var(--sl-color-text);
228-
margin-bottom: 0.25rem;
240+
margin-bottom: 0.25rem !important;
229241
}
230242

231243
.demo-btn {
@@ -254,11 +266,11 @@
254266
background: transparent;
255267
border: 1px solid var(--sl-color-text-accent);
256268
color: var(--sl-color-text-accent);
257-
margin-top: 0.75rem;
269+
margin-top: 0.75rem !important;
258270
}
259271

260272
#demo-container {
261-
margin: 2rem 0;
273+
margin: 2rem 0 !important;
262274
padding: 1.5rem;
263275
background: var(--sl-color-bg);
264276
border: 1px solid var(--sl-color-gray-5);
@@ -267,14 +279,14 @@
267279
}
268280

269281
.demo-output {
270-
margin-top: 2rem;
282+
margin-top: 2rem !important;
271283
}
272284

273285
.demo-output-label {
274286
font-size: 1rem;
275287
font-weight: 600;
276288
color: var(--sl-color-text);
277-
margin-bottom: 0.75rem;
289+
margin-bottom: 0.75rem !important;
278290
}
279291

280292
#demo-code {

0 commit comments

Comments
 (0)