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>
82 lines
2.2 KiB
Python
82 lines
2.2 KiB
Python
from pathlib import Path
|
|
|
|
# Exact copy of Next app/hub.css — keep rem; H5 locks html { font-size: 16px }
|
|
src = Path(r"c:\project\gitlab-instance-0a899031_nomadro\app\hub.css")
|
|
dst = Path(r"c:\project\gitlab-instance-0a899031_nomadro\apps\miniprogram\src\styles\hub.scss")
|
|
t = src.read_text(encoding="utf-8")
|
|
# Next fonts → system stack (no next/font CSS vars)
|
|
f = "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Noto Sans SC', sans-serif"
|
|
t = t.replace("var(--font-outfit), var(--font-noto-sc), sans-serif", f)
|
|
t = t.replace("var(--font-noto-sc), var(--font-outfit), sans-serif", f)
|
|
extra = r"""
|
|
/* app/globals.css ThemeToggle — rem, same as Next */
|
|
.nd-theme-toggle {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 40px;
|
|
height: 40px;
|
|
border-radius: 12px;
|
|
border: 1px solid rgba(78, 205, 196, 0.28);
|
|
background: rgba(78, 205, 196, 0.1);
|
|
color: #4ecdc4;
|
|
font-size: 1.05rem;
|
|
cursor: pointer;
|
|
transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
|
|
}
|
|
.nd-theme-toggle:hover {
|
|
background: rgba(78, 205, 196, 0.18);
|
|
border-color: rgba(78, 205, 196, 0.5);
|
|
transform: translateY(-1px);
|
|
}
|
|
.light .nd-theme-toggle,
|
|
html.light .nd-theme-toggle,
|
|
[data-theme='light'] .nd-theme-toggle {
|
|
border-color: rgba(13, 148, 136, 0.3);
|
|
background: rgba(13, 148, 136, 0.1);
|
|
color: #0d9488;
|
|
}
|
|
.hub-logo-text {
|
|
font-family: var(--hub-font-display);
|
|
font-weight: 700;
|
|
font-size: 1.2rem;
|
|
color: var(--hub-text);
|
|
}
|
|
.hub-logo-svg,
|
|
.hub-globe-wrap {
|
|
display: block;
|
|
line-height: 0;
|
|
}
|
|
.hub-logo-svg svg {
|
|
width: 34px;
|
|
height: 34px;
|
|
display: block;
|
|
}
|
|
.hub-globe-wrap,
|
|
.hub-globe-wrap svg {
|
|
width: 100%;
|
|
height: 100%;
|
|
display: block;
|
|
}
|
|
.hub-floating-cards {
|
|
position: absolute;
|
|
inset: 0;
|
|
pointer-events: none;
|
|
}
|
|
/* Taro View 默认可能不是预期布局容器 — 只补缺,不覆盖 hub.css 的 flex/grid */
|
|
.hub-logo-svg,
|
|
.hub-globe-wrap,
|
|
.hub-floating-cards,
|
|
.hub-hero-bg-shapes,
|
|
.hub-shape {
|
|
box-sizing: border-box;
|
|
}
|
|
.hub-hero-title text,
|
|
.hub-hero-title .hub-gradient-text,
|
|
.hub-hero-title Text {
|
|
display: block;
|
|
}
|
|
"""
|
|
dst.write_text(t.rstrip() + "\n" + extra, encoding="utf-8")
|
|
print("wrote", dst, "bytes", dst.stat().st_size)
|