Skip to content

Commit bd3fdff

Browse files
authored
A collection of website polishing (#4784)
* Tighten up sidebar. * Standardize CSS ordering between dev and prod. Previously, the site would render one way in prod and another in dev! The issue was that vite was tree-shaking CSS and wound up re-ordering things in a way it thought was permissible, whereas in dev, without that optimization, the CSS was actuallys sequenced differently. This led to a noticable huge margin in dev, but not in prod. This commit asserts the official ordering the CSS layers, and then adds a fix for the left-margin issue. This should now standard dev and prod. * Reduce code font-size from 16px to 14px. * Improve main paragraph text rendering. Use more readable line height and paragraph separation. * Improve spacing after file tree. * Fix sidebar inconsistencies on 3rd level of nav.
1 parent b4a611c commit bd3fdff

File tree

1 file changed

+44
-8
lines changed

1 file changed

+44
-8
lines changed

docs-starlight/src/styles/global.css

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
@layer base, starlight, theme, components, utilities;
1+
@layer base, starlight.base, starlight.reset, starlight.core, starlight.content, starlight.components, starlight.utils, theme, components, utilities;
22
@import '@astrojs/starlight-tailwind';
33
@import "tailwindcss/theme.css" layer(theme);
44
@import "tailwindcss/utilities.css" layer(utilities);
55

6-
@import "./buttons.css";
7-
@import "./contactform.css";
8-
@import "./lists.css";
6+
@import "./buttons.css" layer(components);
7+
@import "./contactform.css" layer(components);
8+
@import "./lists.css" layer(components);
99

1010
/* Starlight Fixes */
11-
@import "./starlight-search.css";
11+
@import "./starlight-search.css" layer(components);
1212

1313
@font-face {
1414
font-family: 'Inter';
@@ -282,18 +282,35 @@ p code {
282282

283283
#starlight__sidebar ul li {
284284
margin: 0;
285-
padding-top: 0.5em;
286-
padding-bottom: 0.5em;
287285
}
288286

289287
#starlight__sidebar ul li ul li {
290288
padding-left: 1em;
291289
}
292290

293-
#starlight__sidebar details summary {
291+
#starlight__sidebar ul li a {
292+
font-size: calc(16 / 16 * 1rem);
293+
}
294+
295+
#starlight__sidebar details {
296+
padding-left: 0;
297+
margin-bottom: 10px;
298+
}
299+
300+
#starlight__sidebar summary {
301+
margin-top: 5px;
294302
padding-left: 0;
295303
}
296304

305+
#starlight__sidebar details details details {
306+
margin-bottom: 0;
307+
}
308+
309+
#starlight__sidebar details details details summary {
310+
margin-top: 0;
311+
padding: 0.3em var(--sl-sidebar-item-padding-inline);
312+
}
313+
297314
.opensourcecard {
298315
border-left: 0;
299316
}
@@ -302,6 +319,25 @@ p code {
302319
border-right: 0;
303320
}
304321

322+
/* Main pane */
323+
324+
.main-pane .sl-container {
325+
margin-inline: 0;
326+
}
327+
328+
.main-pane p {
329+
line-height: 1.6;
330+
margin-bottom: 1.5rem;
331+
}
332+
333+
.main-pane starlight-file-tree {
334+
margin-bottom: 1.8rem;
335+
}
336+
337+
.main-pane .code {
338+
font-size: calc(14 / 16 * 1rem);
339+
}
340+
305341
starlight-toc h2 {
306342
background-color: var(--color-toc-background);
307343
color: var(--color-code-text);

0 commit comments

Comments
 (0)