feat(typography): 可视化排版选择器(Sveltia inline 组件)+ 颜色扩充 + 方案 10
- 可视化选择(核心痛点解决):Sveltia 原生支持 registerEditorComponent
的 inline 形态且 onInsert 能拿到 selectedText → 实现「选中文字 → Insert ▸
排版 → 选字体/颜色 → 自动包 span class」完整链路;因 inline 组件只能进
Insert 菜单(field-based 虽可上工具栏但拿不到 selectedText),两个独立组件
会互相抢 pattern 匹配,故收敛为单入口 + 18 项分组面板(键盘可达/Esc 取消/
onEdit 回填当前类)
- public/admin/typography-classes.js 为单一事实源(扩展与文档共用)
- 颜色扩充 4 类:ink-warm / ink-cool / ink-faint / ink-accent-soft,全部亮暗
双态实测 ≥4.5:1(ink-faint 取白底达标的最淡值 4.69/4.75)
- 字体:体积账否决 webfont 新增(@fontsource zcool-xiaowei 用到即 +647.7KB,
远超 150KB 阈值;smiley-sans 无可用版本、sarasa 包为空壳),改为落地 4 个
**系统回退类**(font-song/font-kai-sys/font-hei-sys/font-fangsong,零下载,
文档注明依赖访客设备)
- 白名单 17 类同步;docs/写作指南.md 三表更新
- docs/research/10-页面后台化方案.md:五方案对比 + 推荐方案 E(页面骨架 blocks
/ 区块字段 / 局部自由区 / 样式即数据四层)+ 关于页九类区块 + 消毒与验收断言
+ 分阶段清单(约 7.2d)
验证: 16/16 颜色 computed 与对比度实测;选择器 7/7(桩 CMS 覆盖注册/插入/
编辑三层);构建 48 页 exit 0;E2E 37/37
Spec: none (排版能力 + 方案文档)
Co-authored-by: GLM-5.3
This commit is contained in:
1 parent
c5cdcd5bf9
commit
2cab243891
9 files changed
+731
-6
No files matched your search
@@ -14,11 +14,37 @@ const ALLOWED = new Set([
|
||||
'ink-3',
|
||||
'ink-muted',
|
||||
'ink-accent',
|
||||
'ink-accent-soft',
|
||||
'ink-warm',
|
||||
'ink-cool',
|
||||
'ink-faint',
|
||||
'c-blue',
|
||||
'c-blue-soft',
|
||||
'c-teal',
|
||||
'c-teal-soft',
|
||||
'c-green',
|
||||
'c-green-soft',
|
||||
'c-yellow',
|
||||
'c-yellow-soft',
|
||||
'c-orange',
|
||||
'c-orange-soft',
|
||||
'c-red',
|
||||
'c-red-soft',
|
||||
'c-pink',
|
||||
'c-pink-soft',
|
||||
'c-purple',
|
||||
'c-purple-soft',
|
||||
// 字族(与分轨排版共存的四个既有字族)
|
||||
'font-serif',
|
||||
'font-kai',
|
||||
'font-sans',
|
||||
'font-mono',
|
||||
// 系统字族回退类(不下载字体,命中访客本机字体)
|
||||
'font-song',
|
||||
'font-kai-sys',
|
||||
'font-hei-sys',
|
||||
'font-fangsong',
|
||||
'font-kai-light',
|
||||
// 文学排版
|
||||
'drop-cap',
|
||||
'quote-line',
|
||||
|
||||
Reference in new issue
Block a user