Skip to content

Commit 5957177

Browse files
henderkesclaude
andcommitted
Style ToolboxPath as a bordered chip so it stands out from prose
The previous styling was deliberately minimal — no border, no background — to stay "non-invasive". In practice it was too quiet: the path text blended into the surrounding sentence and readers walked straight past it. Renders each path as a small inline pill: subtle glass background, 1px translucent border, rounded corners, and a slightly smaller font size so it doesn't dominate the line. The leaf segment keeps the accent colour and gets a heavier weight so the actual control name still pops. kind="command" chips additionally use the mono font, so command paths look code-shaped at a glance. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fed7c57 commit 5957177

1 file changed

Lines changed: 30 additions & 16 deletions

File tree

site/src/components/ToolboxPath.astro

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
* steps={['Hotkeys', 'Add', 'Pcons: Toggle active set']} />
1414
* <ToolboxPath kind="command" steps={['/dmg report']} />
1515
*
16-
* Styling is deliberately minimal — no border or background by default.
17-
* It should read as a quiet "here's where this lives" footnote next to
18-
* the prose, not a callout that hijacks the page.
16+
* Rendered as a small bordered chip so the eye picks it out as "this is
17+
* a UI path, not part of the surrounding sentence". Small enough not to
18+
* dominate the line, but obviously its own thing.
1919
*/
2020
2121
type Kind = 'settings' | 'window' | 'widget' | 'hotkey' | 'command';
@@ -58,19 +58,32 @@ const labels: Record<Kind, string> = {
5858
<style>
5959
.tb-path {
6060
display: inline-flex;
61-
align-items: baseline;
61+
align-items: center;
6262
flex-wrap: wrap;
63-
gap: 0.15rem 0.3rem;
64-
font-size: 0.85em;
65-
line-height: 1.4;
66-
color: var(--color-fg-meta);
63+
gap: 0.2rem 0.35rem;
64+
padding: 0.2rem 0.55rem;
65+
font-size: 0.78rem;
66+
line-height: 1.35;
67+
color: var(--color-fg-sub);
68+
background: var(--color-glass);
69+
border: 1px solid var(--color-border-glass);
70+
border-radius: 0.375rem;
71+
/* Sit a touch above text baseline so the chip doesn't push the
72+
surrounding line height around when used inline. */
73+
vertical-align: middle;
6774
}
6875
.tb-path-icon {
69-
color: var(--color-accent-deep);
70-
font-size: 0.85em;
76+
color: var(--color-accent);
77+
font-size: 0.9em;
78+
line-height: 1;
7179
}
72-
.tb-path[data-kind='command'] .tb-path-icon {
80+
.tb-path[data-kind='command'] {
81+
/* Command paths read most naturally as code-shaped chips. */
7382
font-family: var(--font-mono);
83+
font-size: 0.75rem;
84+
letter-spacing: -0.01em;
85+
}
86+
.tb-path[data-kind='command'] .tb-path-icon {
7487
letter-spacing: -0.05em;
7588
}
7689
.tb-path-step {
@@ -81,11 +94,12 @@ const labels: Record<Kind, string> = {
8194
}
8295
.tb-path-leaf {
8396
color: var(--color-accent);
84-
font-weight: 500;
97+
font-weight: 600;
8598
}
86-
/* When the prose stylesheet wraps us in <li>, keep our left-edge
87-
aligned with the bullet text. */
88-
:global(.prose li) > .tb-path {
89-
margin-top: 0.2rem;
99+
/* When the prose stylesheet wraps us in <li>, give a little vertical
100+
breathing room from the bullet text above. */
101+
:global(.prose li) > .tb-path,
102+
:global(.prose p) > .tb-path {
103+
margin-top: 0.15rem;
90104
}
91105
</style>

0 commit comments

Comments
 (0)