Skip to content

Commit 4f484e5

Browse files
committed
feat: refactor Toolbar component layout and enhance styling for brand icons and actions
1 parent 87ce340 commit 4f484e5

2 files changed

Lines changed: 70 additions & 27 deletions

File tree

src/components/Toolbar.jsx

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,27 @@ export default function Toolbar({
2525
/>
2626
<span>{BRAND.name}</span>
2727
<span className="version-badge">v{APP_VERSION}</span>
28-
<a
29-
className="icon-button github-icon"
30-
href={BRAND.repoUrl}
31-
target="_blank"
32-
rel="noopener noreferrer"
33-
aria-label="View on GitHub"
34-
title="View on GitHub"
35-
>
36-
<RiGithubFill size={20} />
37-
</a>
28+
<div className="brand-icons">
29+
<a
30+
className="icon-button github-icon"
31+
href={BRAND.repoUrl}
32+
target="_blank"
33+
rel="noopener noreferrer"
34+
aria-label="View on GitHub"
35+
title="View on GitHub"
36+
>
37+
<RiGithubFill size={20} />
38+
</a>
39+
<button
40+
className="icon-button theme-toggle"
41+
type="button"
42+
onClick={onToggleTheme}
43+
aria-label={isDark ? 'Switch to light mode' : 'Switch to dark mode'}
44+
title={isDark ? 'Light mode' : 'Dark mode'}
45+
>
46+
{isDark ? <RiSunFill size={20} /> : <RiMoonFill size={20} />}
47+
</button>
48+
</div>
3849
</div>
3950

4051
<div className="actions">
@@ -53,15 +64,6 @@ export default function Toolbar({
5364
<button type="button" onClick={onExportHtml}>
5465
Export HTML
5566
</button>
56-
<button
57-
className="icon-button theme-toggle"
58-
type="button"
59-
onClick={onToggleTheme}
60-
aria-label={isDark ? 'Switch to light mode' : 'Switch to dark mode'}
61-
title={isDark ? 'Light mode' : 'Dark mode'}
62-
>
63-
{isDark ? <RiSunFill size={20} /> : <RiMoonFill size={20} />}
64-
</button>
6567
<input
6668
ref={fileInputRef}
6769
type="file"

src/styles/app.css

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ a {
7171
font-weight: 700;
7272
}
7373

74+
.brand-icons {
75+
display: inline-flex;
76+
align-items: center;
77+
gap: 6px;
78+
margin-left: 4px;
79+
}
7480
.brand-icon {
7581
width: 28px;
7682
height: 28px;
@@ -114,7 +120,7 @@ body.dark .version-badge {
114120
}
115121

116122
.icon-button.github-icon {
117-
margin-left: 4px;
123+
margin-left: 0;
118124
}
119125
.actions {
120126
display: flex;
@@ -234,11 +240,16 @@ button:not(.icon-button):hover {
234240
}
235241

236242
.mermaid {
243+
display: flex;
244+
justify-content: center;
245+
align-items: flex-start;
237246
width: 100%;
238247
overflow-x: auto;
248+
text-align: center;
239249
}
240250

241251
.mermaid svg {
252+
display: block;
242253
max-width: 100%;
243254
height: auto;
244255
}
@@ -263,6 +274,22 @@ button:not(.icon-button):hover {
263274
padding: 8px;
264275
}
265276

277+
.markdown-body blockquote {
278+
margin: 14px 0;
279+
padding: 10px 14px;
280+
border-left: 4px solid var(--primary);
281+
border-radius: 0 10px 10px 0;
282+
background: color-mix(in srgb, var(--accent) 18%, var(--panel));
283+
color: var(--muted);
284+
}
285+
286+
.markdown-body blockquote > :first-child {
287+
margin-top: 0;
288+
}
289+
290+
.markdown-body blockquote > :last-child {
291+
margin-bottom: 0;
292+
}
266293
.footer {
267294
border-top: 1px solid var(--border);
268295
padding: 12px 16px;
@@ -296,17 +323,26 @@ button:not(.icon-button):hover {
296323
row-gap: 6px;
297324
}
298325

326+
.brand-icons {
327+
margin-left: auto;
328+
}
299329
.actions {
300330
width: 100%;
301331
display: grid;
302332
grid-template-columns: repeat(3, minmax(0, 1fr));
303-
gap: 8px;
333+
gap: 6px;
304334
}
305335

306336
.actions button:not(.icon-button),
307337
.actions .icon-button {
308338
width: 100%;
309-
min-height: 38px;
339+
min-height: 34px;
340+
}
341+
342+
.actions button:not(.icon-button) {
343+
font-size: 0.78rem;
344+
padding: 6px 8px;
345+
border-radius: 7px;
310346
}
311347

312348
.actions .icon-button {
@@ -328,17 +364,17 @@ button:not(.icon-button):hover {
328364

329365
.mobile-tabs {
330366
display: flex;
331-
gap: 8px;
367+
gap: 6px;
332368
}
333369

334370
.mobile-tabs button {
335371
flex: 1;
336372
border: 1px solid var(--border);
337373
background: var(--panel);
338374
color: var(--muted);
339-
border-radius: 10px;
340-
padding: 10px 12px;
341-
font-size: 0.9rem;
375+
border-radius: 8px;
376+
padding: 7px 10px;
377+
font-size: 0.8rem;
342378
font-weight: 600;
343379
}
344380

@@ -363,6 +399,11 @@ button:not(.icon-button):hover {
363399

364400
@media (max-width: 640px) {
365401
.actions {
366-
grid-template-columns: repeat(2, minmax(0, 1fr));
402+
grid-template-columns: repeat(3, minmax(0, 1fr));
403+
}
404+
405+
.version-badge {
406+
font-size: 0.7rem;
407+
padding: 3px 8px;
367408
}
368409
}

0 commit comments

Comments
 (0)