nomadro/apps/miniprogram/scripts/_fix_nav_css.py
eric 69b0bd8224 Ship Taro H5 Vite build and Next-parity hub/nav/book/vip pages.
Switch miniprogram H5 to Vite for fast local compile; align portal pages and static icons for cross-machine continue.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-29 04:36:12 -05:00

25 lines
951 B
Python

from pathlib import Path
p = Path(r"c:\project\gitlab-instance-0a899031_nomadro\apps\miniprogram\src\styles\navmini.scss")
t = p.read_text(encoding="utf-8")
f = "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Noto Sans SC', sans-serif"
repls = [
"var(--font-outfit), 'Sora', system-ui, sans-serif",
"var(--font-noto-sc), 'Manrope', 'PingFang SC', 'Noto Sans SC', system-ui, sans-serif",
"'Sora', system-ui, sans-serif",
"'Manrope', 'PingFang SC', 'Noto Sans SC', system-ui, sans-serif",
]
for old in repls:
t = t.replace(old, f)
extra = """
/* Taro H5: custom elements inherit navmini layout */
.taro_page, .navmini-root, .app-shell { min-height: 100%; }
.link-meta .link-title,
.link-meta .link-desc { display: block; }
.cat-heading .cat-h2 { margin: 0; font: inherit; }
"""
if "Taro H5: custom elements" not in t:
t = t.rstrip() + "\n" + extra
p.write_text(t, encoding="utf-8")
print("ok", p.stat().st_size)