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>
75 lines
1.9 KiB
Python
75 lines
1.9 KiB
Python
from pathlib import Path
|
|
import re
|
|
|
|
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 rem = 16px root; Taro flexible rem would distort — bake to px
|
|
t = re.sub(r"(\d*\.?\d+)rem\b", lambda m: f"{float(m.group(1)) * 16}px", t)
|
|
font = (
|
|
"-apple-system, BlinkMacSystemFont, 'Segoe UI', "
|
|
"'PingFang SC', 'Noto Sans SC', sans-serif"
|
|
)
|
|
t = t.replace("var(--font-outfit), var(--font-noto-sc), sans-serif", font)
|
|
t = t.replace("var(--font-noto-sc), var(--font-outfit), sans-serif", font)
|
|
extra = """
|
|
/* from app/globals.css ThemeToggle + Taro SVG wrappers */
|
|
.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: 16.8px;
|
|
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);
|
|
}
|
|
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: 19.2px;
|
|
}
|
|
.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;
|
|
}
|
|
.hub-hero-title Text,
|
|
.hub-hero-title .hub-gradient-text {
|
|
display: block;
|
|
}
|
|
"""
|
|
dst.write_text(t.rstrip() + "\n" + extra, encoding="utf-8")
|
|
print("ok", dst.stat().st_size)
|