Skip to content

Commit 2277b4f

Browse files
ux(profile): make badge block mobile-friendly
Made-with: Cursor
1 parent 4a5a723 commit 2277b4f

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

src/app/globals.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,12 @@ button {
374374
width: 100%;
375375
background: transparent;
376376
}
377+
378+
.readme-badge-block--profile {
379+
max-width: 520px;
380+
margin-left: auto;
381+
margin-right: auto;
382+
}
377383
.readme-badge-row {
378384
display: flex;
379385
align-items: center;
@@ -696,6 +702,21 @@ a.subpage-inline-mail {
696702
padding: 10px 16px !important;
697703
}
698704

705+
/* ReadmeBadge on profile: stack caption + button, avoid awkward side placement */
706+
.readme-badge-row {
707+
flex-direction: column;
708+
align-items: stretch;
709+
justify-content: flex-start;
710+
gap: 8px;
711+
}
712+
.readme-badge-caption {
713+
margin: 0 !important;
714+
text-align: left;
715+
}
716+
.readme-copy-btn {
717+
width: 100%;
718+
}
719+
699720
}
700721

701722
.cert-mobile-hint {

src/components/ReadmeBadge.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default function ReadmeBadge({ username }: Props) {
4747
}
4848

4949
return (
50-
<div className="readme-badge-block record-card" style={{ width: '100%', marginBottom: '22px', border: '2px solid #1a1a1a' }}>
50+
<div className="readme-badge-block readme-badge-block--profile record-card" style={{ width: '100%', marginBottom: '22px', border: '2px solid #1a1a1a' }}>
5151
{/* Badge preview — the SVG already has its own border; keep the wrapper borderless */}
5252
<div className="readme-badge-preview" style={{ width: '100%', aspectRatio: '440 / 96', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
5353
{svg ? (
@@ -90,7 +90,7 @@ export default function ReadmeBadge({ username }: Props) {
9090
</div>
9191

9292
{/* Copy row */}
93-
<div className="readme-badge-row" style={{ marginTop: '10px', flexWrap: 'wrap', justifyContent: 'space-between' }}>
93+
<div className="readme-badge-row" style={{ marginTop: '10px' }}>
9494
<p className="readme-badge-caption" style={{ fontFamily: MONO, margin: 0, textAlign: 'left' }}>
9595
↻ paste once — updates automatically
9696
</p>

0 commit comments

Comments
 (0)