Align share button and all component scales with DESIGN.md

Share button was themed only in pages/home.css, so /stops, /routes and
/check rendered an unstyled button. Moved to _shared.css and rebuilt as a
ghost variant of .mu-btn:
- radius 12px -> var(--radius) 8px, min-height 44px (48px on touch)
- focus ring #2b2f42 (near-black) -> var(--c-focus)
- LINE link green -> brand purple (DESIGN.md is single-accent)
- hover/active/transition states added

Global scale cleanup (DESIGN.md allows 4px/8px radii only):
- 16 distinct border-radius values -> var(--radius-sm) / var(--radius) / var(--radius-pill)
- 39 distinct font-sizes -> 13-step scale
- outline-offset 1px/2px/3px -> 2px everywhere
- radius and type scale documented in DESIGN.md as enforced tokens

Verified across 4 pages x 2 themes: identical 44x158 button, radius 8px,
contrast 5.80 light / 7.37 dark, no horizontal overflow.
This commit is contained in:
Bkk1234 committed 2026-10-23 23:32:37 +07:00
1 parent 66d7e235c3
commit bf42076b52
14 files changed
+352 -246

No files matched your search

+115 -22
View File
@@ -7,7 +7,7 @@
.mu-logo-img {
width: 44px;
height: 44px;
border-radius: 12px;
border-radius: var(--radius);
object-fit: cover;
box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
@@ -52,7 +52,7 @@
align-items: center;
gap: 6px;
padding: 5px 10px;
border-radius: 999px;
border-radius: var(--radius-pill);
font-size: .72rem;
font-weight: 800;
letter-spacing: .02em;
@@ -69,7 +69,7 @@
z-index: 1;
margin: 0;
color: #fff;
font-size: 1.05rem;
font-size: 1rem;
font-weight: 800;
line-height: 1.25;
text-shadow: 0 2px 6px rgba(0, 0, 0, .45);
@@ -143,8 +143,8 @@
left: 12px;
z-index: 1;
padding: 4px 10px;
border-radius: 999px;
font-size: .7rem;
border-radius: var(--radius-pill);
font-size: 0.72rem;
font-weight: 700;
background: var(--c-glass);
color: var(--c-ink);
@@ -165,7 +165,7 @@
disjoint thumbnails) ---------- */
.mu-stop-grid li.mu-stop-cell {
list-style: none;
border-radius: 18px;
border-radius: var(--radius);
overflow: hidden;
box-shadow: 0 10px 24px rgba(63, 43, 94, .08);
border: 1px solid rgba(231, 224, 246, .95);
@@ -220,7 +220,7 @@
.mu-footer-brand-row img {
width: 48px;
height: 48px;
border-radius: 12px;
border-radius: var(--radius);
background: var(--c-surface);
padding: 4px;
object-fit: contain;
@@ -228,26 +228,26 @@
.mu-footer-brand-row strong {
display: block;
color: #fff;
font-size: 1.05rem;
font-size: 1rem;
font-weight: 800;
letter-spacing: .01em;
}
.mu-footer-brand-row span {
display: block;
color: var(--c-info);
font-size: .82rem;
font-size: 0.85rem;
margin-top: 2px;
}
.mu-footer-brand p.about {
margin: 0;
color: #b6bdda;
font-size: .88rem;
font-size: 0.85rem;
line-height: 1.6;
}
.mu-footer-col h4 {
margin: 0 0 10px;
color: #fff;
font-size: .9rem;
font-size: 0.95rem;
font-weight: 800;
letter-spacing: .03em;
text-transform: uppercase;
@@ -263,7 +263,7 @@
.mu-footer-col ul a {
color: #cfd5ec;
text-decoration: none;
font-size: .9rem;
font-size: 0.95rem;
line-height: 1.5;
transition: color .15s ease;
display: inline-flex;
@@ -283,7 +283,7 @@
gap: 8px;
color: #cfd5ec;
text-decoration: none;
font-size: .88rem;
font-size: 0.85rem;
}
.mu-footer-contact .row { margin-bottom: 4px; }
@@ -312,7 +312,7 @@
}
.mu-sponsor-tile {
background: var(--c-surface);
border-radius: 12px;
border-radius: var(--radius);
padding: 14px;
display: flex;
align-items: center;
@@ -344,14 +344,14 @@
.mu-footer-bottom p {
margin: 0;
color: var(--c-info);
font-size: .82rem;
font-size: 0.85rem;
letter-spacing: .02em;
}
.mu-footer-bottom .pill {
display: inline-block;
margin-left: 10px;
padding: 2px 10px;
border-radius: 999px;
border-radius: var(--radius-pill);
background: rgba(122, 76, 192, .25);
color: #d8c7ff;
font-size: .72rem;
@@ -413,7 +413,7 @@ body:has(.mu-site-footer) .mu-footer { display: none; }
gap: 2px;
background: var(--c-tint-purple);
border: 1px solid #e4dcf2;
border-radius: 999px;
border-radius: var(--radius-pill);
padding: 3px;
flex-shrink: 0;
}
@@ -426,7 +426,7 @@ body:has(.mu-site-footer) .mu-footer { display: none; }
font-size: .72rem;
line-height: 1;
padding: 6px 10px;
border-radius: 999px;
border-radius: var(--radius-pill);
cursor: pointer;
transition: background .15s ease, color .15s ease;
}
@@ -444,7 +444,7 @@ body:has(.mu-site-footer) .mu-footer { display: none; }
gap: 2px;
background: var(--c-tint-purple);
border: 1px solid #e4dcf2;
border-radius: 999px;
border-radius: var(--radius-pill);
padding: 3px;
flex-shrink: 0;
}
@@ -456,7 +456,7 @@ body:has(.mu-site-footer) .mu-footer { display: none; }
height: 34px;
min-width: 34px;
border: 0;
border-radius: 999px;
border-radius: var(--radius-pill);
background: transparent;
color: var(--c-brand-ink);
cursor: pointer;
@@ -502,7 +502,7 @@ body:has(.mu-site-footer) .mu-footer { display: none; }
gap: 6px;
min-height: 44px;
padding: 10px 18px;
border-radius: 12px;
border-radius: var(--radius);
font-family: inherit;
font-weight: 700;
font-size: .85rem;
@@ -560,7 +560,7 @@ body:has(.mu-site-footer) .mu-footer { display: none; }
min-height: 48px;
padding: 12px 20px;
border: none;
border-radius: 999px;
border-radius: var(--radius-pill);
cursor: pointer;
font-family: inherit;
font-size: .95rem;
@@ -572,3 +572,96 @@ body:has(.mu-site-footer) .mu-footer { display: none; }
}
.mu-install-btn:active { transform: translateY(1px); }
.mu-install-btn svg { width: 20px; height: 20px; }
/* ============================================================
ปุ่ม "แชร์หน้านี้" — ใช้ร่วมทุกหน้า (/ · /stops/:code · /routes/:id · /check/:id)
เดิมอยู่ใน pages/home.css → หน้าอื่นไม่มีสไตล์เลย = หลุดธีม
ตอนนี้ยึดสเกลเดียวกับ .mu-btn ตาม DESIGN.md §5:
radius 12px · min-height 44px (48px บนจอสัมผัส) · font-size .85rem · weight 700
variant = ปุ่มรอง (ghost) เพราะไม่ใช่ CTA หลักของหน้า
============================================================ */
.mu-share-row {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 8px;
margin: 22px 0 44px;
}
.mu-share-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 44px;
padding: 10px 18px;
border: 1px solid var(--c-border);
border-radius: var(--radius);
background: var(--c-surface);
color: var(--c-brand-ink);
font-family: inherit;
font-size: .85rem;
font-weight: 700;
line-height: 1;
cursor: pointer;
transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.mu-share-btn:hover {
border-color: #d8c9f2;
background: var(--c-surface-2);
}
.mu-share-btn:active { transform: translateY(1px); }
.mu-share-btn:focus-visible {
outline: 2px solid var(--c-focus);
outline-offset: 2px;
}
.mu-share-btn .ic { width: 16px; height: 16px; }
/* ข้อความใต้ปุ่ม */
.mu-share-status {
margin: 0;
font-size: 0.85rem;
line-height: 1.7;
color: var(--c-ink-2);
text-align: right;
}
.mu-share-status:empty { display: none; }
/* ลิงก์ที่คัดลอก — mono + tabular เพื่อให้อ่านง่าย/คัดลอกถูก */
.mu-share-url {
display: inline-block;
padding: 2px 8px;
border: 1px solid var(--c-border);
border-radius: var(--radius);
background: var(--c-tint-purple);
font-size: 0.78rem;
font-variant-numeric: tabular-nums;
word-break: break-all;
}
/* ปุ่มแชร์ผ่าน LINE — ม่วง (แอคเซนต์เดียวตาม DESIGN.md §7) ไม่ใช่เขียว */
.mu-share-line {
display: inline-block;
margin-left: 6px;
font-weight: 700;
color: var(--c-brand-ink);
text-decoration: none;
}
.mu-share-line:hover { text-decoration: underline; }
.mu-share-line:focus-visible {
outline: 2px solid var(--c-focus);
outline-offset: 2px;
}
/* จอแคบ: ปุ่มเต็มความกว้าง ข้อความชิดซ้าย */
@media (max-width: 560px) {
.mu-share-row { align-items: stretch; }
.mu-share-btn { justify-content: center; }
.mu-share-status { text-align: left; }
}
/* จอสัมผัส: 48dp ตาม Android guideline */
@media (pointer: coarse) {
.mu-share-btn { min-height: 48px; }
}