#!/usr/bin/env python # -*- coding: utf-8 -*- """C-2a-4b 旧蓝分流·大家伙批次 7 文件 child-index(16) / parent-index(6) / index-home(3 JS) / wuxing-sandbox(5) / articles.vue(4) / dimension-detail(3 JS) / member-detail(1 JS) 关键决策: - child-index:clay 设计系统整体迁移品牌橙(注释/渐变/边框/阴影);数据类目槽 task-cat--life / quick-icon--growth -> sky-600 rgba(2,132,199,x)(防与 study/tasks 的 sky-500 rgba(14,165,233,x) 及既有橙槽撞色) - parent-index:stat-icon-orange/act-add 名橙实蓝 -> 恢复品牌橙语义(主行动角色); milestone-trophy/pending-icon--blue/advice -> info 蓝;JS 渐变蓝槽 -> info 蓝渐变 (数组第 4 槽已是橙,禁撞色) - wuxing-sandbox:深海军蓝面板上的旧蓝族仅翻「品牌氛围层」——ambient 光晕 + toggle 选中态; #8FC5E8 面板 chrome(title/badge/energy/toggle-inactive)与 #42A5F5 水行语义保留 (chrome 翻橙会与火行 #FF6B35 撞色) - articles.vue:弃 $c-brand-legacy 局部声明(含 C-2 移交注释块),内联到用法 - dimension-detail canvas / member-detail:JS 真实 hex(禁 SCSS 变量) """ import io import re import sys ORANGE = '$brand-primary' ORANGE_DARK = '$brand-primary-dark' ORANGE_LIGHT = '$brand-primary-light' # 每文件:[(old, new, expect_hit)] 按序施加;fix_lang=True 时补 lang="scss" JOBS = [ # ---- 1. child-index:clay 设计系统整体迁移 ---- ('pages/home-pages/child-index.vue', True, [ ('色彩体系:品牌蓝(#5B9BD5)+浅蓝(#8FC5E8)', '色彩体系:品牌橙(#F97316)+浅橙(#FB923C)', 1), ('积分卡片 — Flat Rounded 蓝色渐变', '积分卡片 — Flat Rounded 橙色渐变', 1), ('border: 4rpx solid #8FC5E8;', 'border: 4rpx solid %s;' % ORANGE_LIGHT, 1), ('rgba(143,197,232,0.30)', 'rgba(251,146,60,0.30)', 1), ('linear-gradient(145deg, #8FC5E8, #5B9BD5);', 'linear-gradient(145deg, %s, %s);' % (ORANGE_LIGHT, ORANGE), 1), ('border: 4rpx solid #3A7CC4;', 'border: 4rpx solid %s;' % ORANGE_DARK, 1), ('rgba(91,155,213,0.25)', 'rgba(249,115,22,0.25)', 1), ('rgba(91,155,213,0.18)', 'rgba(249,115,22,0.18)', 1), # 数据类目槽(值唯一,防撞色) ('rgba(91,155,213,0.12)', 'rgba(2,132,199,0.12)', 1), # task-cat--life ('rgba(91,155,213,0.15)', 'rgba(2,132,199,0.15)', 1), # quick-icon--growth # 中性 clay 阴影随品牌族 ('rgba(91,155,213,0.08)', 'rgba(249,115,22,0.08)', 3), ('rgba(91,155,213,0.06)', 'rgba(249,115,22,0.06)', 3), ]), # ---- 2. parent-index:同名不同色需整行定位 ---- ('pages/home-pages/parent-index.vue', False, [ ("'linear-gradient(135deg, #5B9BD5, #8FC5E8)',", "'linear-gradient(135deg, #0EA5E9, #38BDF8)',", 1), ('.stat-icon-orange { background: rgba(91, 155, 213, 0.12); }', '.stat-icon-orange { background: rgba(249,115,22,0.12); }', 1), ('.milestone-trophy { background: rgba(91, 155, 213, 0.12); }', '.milestone-trophy { background: rgba(14,165,233,0.12); }', 1), ('.pending-icon--blue { background: rgba(91,155,213,0.12); }', '.pending-icon--blue { background: rgba(14,165,233,0.12); }', 1), ('background: rgba(91,155,213,0.1);', 'background: rgba(14,165,233,0.1);', 1), ('.act-add { background: rgba(91, 155, 213, 0.12); }', '.act-add { background: rgba(249,115,22,0.12); }', 1), ]), # ---- 3. index-home:JS 渐变蓝槽 x3(第 4 槽已橙,禁撞色)---- ('pages/index-home/index.vue', False, [ ("'linear-gradient(135deg, #5B9BD5, #8FC5E8)',", "'linear-gradient(135deg, #0EA5E9, #38BDF8)',", 3), ]), # ---- 4. wuxing-sandbox:氛围层 + 选中态翻橙,chrome/水行保留 ---- ('components/wuxing-sandbox.vue', True, [ ('rgba(91, 155, 213, 0.04)', 'rgba(249,115,22,0.04)', 1), ('rgba(66, 165, 245, 0.03)', 'rgba(251,146,60,0.03)', 1), ('rgba(91,155,213,0.10)', 'rgba(249,115,22,0.10)', 1), ('linear-gradient(135deg, #5B9BD5, #3A7CC2);', 'linear-gradient(135deg, %s, %s);' % (ORANGE, ORANGE_DARK), 1), ('border-color: #5B9BD5;', 'border-color: %s;' % ORANGE, 1), ]), # ---- 5. articles.vue:弃局部声明,内联到用法 ---- ('pages/mind-detail/articles.vue', False, [ ('// C-2 待翻转:旧品牌蓝残留(filter-chip.active 底色 / article-category 前景 + 浅底)。\n' '// B 批纪律保原值令牌化,翻转移交 C-2 角色分流(此处为品牌交互用法,预案翻品牌橙)\n' '$c-brand-legacy: #5B9BD5;\n' '$c-brand-legacy-tint: rgba(91,155,213,0.1);\n', '', 1), ('background: $c-brand-legacy;', 'background: %s;' % ORANGE, 1), ('color: $c-brand-legacy;', 'color: %s;' % ORANGE, 1), ('background: $c-brand-legacy-tint;', 'background: rgba(249,115,22,0.1);', 1), ]), # ---- 6. dimension-detail:canvas JS 真实 hex ---- ('pages/body-detail/dimension-detail.vue', False, [ ("ctx.setStrokeStyle('#4A9BD7')", "ctx.setStrokeStyle('#F97316')", 1), ("ctx.setFillStyle('rgba(74, 155, 215, 0.1)')", "ctx.setFillStyle('rgba(249,115,22,0.1)')", 1), ("ctx.setFillStyle('#4A9BD7')", "ctx.setFillStyle('#F97316')", 1), ]), # ---- 7. member-detail:home 槽 -> 品牌橙(与 FamilyRelationGraph home 一致)---- ('pages/member-detail/member-detail.vue', False, [ ("color: '#5B9BD5', gradient: 'linear-gradient(135deg, #5B9BD5, #3A7CC4)'", "color: '#F97316', gradient: 'linear-gradient(135deg, #F97316, #EA580C)'", 1), ]), ] RESIDUAL_RE = re.compile( r'(?]*>[\s\S]*?', re.M) def fix_lang(src, page): m = STYLE_RE.search(src) block = m.group(0) first, rest = block.split('\n', 1) if 'lang=' not in first: if '