Skip to content

Commit 62d0a72

Browse files
style: group README badge preview with unified block styling
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent bfc0b2d commit 62d0a72

3 files changed

Lines changed: 38 additions & 17 deletions

File tree

src/app/globals.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,27 @@ button {
342342
opacity: 0.88;
343343
}
344344

345+
/* README badge preview block — shields badge + copy button grouped */
346+
.readme-badge-block {
347+
margin-top: 8px;
348+
padding: 14px;
349+
border: 1px solid #e5dcc8;
350+
background: rgba(255, 255, 255, 0.28);
351+
}
352+
.readme-badge-row {
353+
display: flex;
354+
align-items: center;
355+
justify-content: space-between;
356+
gap: 12px;
357+
flex-wrap: wrap;
358+
}
359+
.readme-badge-caption {
360+
font-size: 10px;
361+
color: #b0a89e;
362+
letter-spacing: 0.04em;
363+
margin: 10px 0 0;
364+
}
365+
345366
.subpage-faq-cta {
346367
display: inline-flex;
347368
align-items: center;

src/components/CertificateCard.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -632,26 +632,23 @@ export default function CertificateCard({ cert, onReset }: Props) {
632632
const shieldsUrl = `https://img.shields.io/badge/%F0%9F%AA%A6%20declared%20dead-view%20certificate-555?style=for-the-badge&labelColor=cc0000`
633633
const badgeMd = `[![commitmentissues](${shieldsUrl})](${repoUrl})`
634634
return (
635-
<div style={{ marginTop: '6px' }}>
636-
{/* eslint-disable-next-line @next/next/no-img-element */}
637-
<img
638-
src={shieldsUrl}
639-
alt="README badge preview"
640-
loading="lazy"
641-
decoding="async"
642-
style={{ height: '28px', width: 'auto', display: 'block', marginBottom: '10px' }}
643-
/>
644-
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '12px' }}>
645-
<p style={{ fontFamily: MONO, fontSize: '10px', color: '#b0a89e', margin: 0, letterSpacing: '0.04em' }}>
646-
↻ paste once — updates automatically
647-
</p>
635+
<div className="readme-badge-block">
636+
<div className="readme-badge-row">
637+
{/* eslint-disable-next-line @next/next/no-img-element */}
638+
<img
639+
src={shieldsUrl}
640+
alt="README badge preview"
641+
loading="lazy"
642+
decoding="async"
643+
style={{ height: '28px', width: 'auto', display: 'block', flexShrink: 0 }}
644+
/>
648645
<button
649646
type="button"
650647
onClick={async () => { try { await navigator.clipboard.writeText(badgeMd); setBadgeCopied(true); setTimeout(() => setBadgeCopied(false), 2000) } catch { /* ignore */ } }}
651648
className="readme-copy-btn"
652649
style={{
653650
fontFamily: MONO, fontSize: '10px', fontWeight: 700, letterSpacing: '0.06em',
654-
padding: '8px 14px', minHeight: '44px',
651+
padding: '8px 14px', minHeight: '36px',
655652
background: badgeCopied ? '#2d7a3c' : 'transparent',
656653
color: badgeCopied ? '#fff' : '#4a4440',
657654
border: `2px solid ${badgeCopied ? '#2d7a3c' : '#cec6bb'}`,
@@ -666,6 +663,9 @@ export default function CertificateCard({ cert, onReset }: Props) {
666663
{badgeCopied ? '✓ copied!' : '⎘ copy to readme'}
667664
</button>
668665
</div>
666+
<p className="readme-badge-caption" style={{ fontFamily: MONO }}>
667+
↻ paste once — updates automatically
668+
</p>
669669
</div>
670670
)
671671
})()}

src/components/ReadmeBadge.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export default function ReadmeBadge({ username }: Props) {
4040
</div>
4141

4242
{/* Copy row */}
43-
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '12px', marginTop: '10px' }}>
44-
<p style={{ fontFamily: MONO, fontSize: '10px', color: '#b0a89e', margin: 0, letterSpacing: '0.04em' }}>
43+
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '12px', marginTop: '4px' }}>
44+
<p className="readme-badge-caption" style={{ fontFamily: MONO, margin: 0, textAlign: 'left' }}>
4545
↻ paste once — updates automatically
4646
</p>
4747
<button
@@ -53,7 +53,7 @@ export default function ReadmeBadge({ username }: Props) {
5353
fontWeight: 700,
5454
letterSpacing: '0.06em',
5555
padding: '8px 14px',
56-
minHeight: '44px',
56+
minHeight: '36px',
5757
background: copied ? '#2d7a3c' : 'transparent',
5858
color: copied ? '#fff' : '#4a4440',
5959
border: `2px solid ${copied ? '#2d7a3c' : '#cec6bb'}`,

0 commit comments

Comments
 (0)