| 1234567891011121314151617181920212223242526272829303132 |
- // 批次 1 走查反馈「文字偏小」:把驾驶舱内 <=11u 的裸像素字号统一上调 1px。
- // 只动 font-size 行,不碰其他声明;标题类(>=13u)已在 tokens 与组件里单独处理。
- import { readFileSync, writeFileSync } from 'node:fs'
- const targets = [
- ['src/modules/cockpit/CockpitShell.vue', [1796, 1859, 1874, 1922, 1985, 2016, 2125]],
- ['src/modules/cockpit/components/MapCoordinateBlocked.vue', [103, 162, 174]],
- ['src/modules/cockpit/components/PanelBlocks.vue', [607]],
- ['src/modules/cockpit/components/CockpitPanel.vue', [199]],
- ['src/modules/cockpit/components/MapCanvas.vue', [502]],
- ]
- let changed = 0
- for (const [file, lineNumbers] of targets) {
- const lines = readFileSync(file, 'utf8').split('\n')
- for (const n of lineNumbers) {
- const i = n - 1
- const line = lines[i]
- const m = /font-size:\s*calc\((\d+(?:\.\d+)?)\s*\*\s*var\(--u/.exec(line)
- if (!m) {
- console.log(`SKIP ${file}:${n} (未匹配) -> ${line.trim()}`)
- continue
- }
- const old = Number(m[1])
- const next = Math.round((old + 1) * 10) / 10
- lines[i] = line.replace(m[0], m[0].replace(String(old), String(next)))
- console.log(`${file}:${n} ${old}u -> ${next}u`)
- changed += 1
- }
- writeFileSync(file, lines.join('\n'))
- }
- console.log(`\n共修改 ${changed} 处`)
|