diff --git a/app/static/editor.js b/app/static/editor.js index e7e4f63..9f555fc 100644 --- a/app/static/editor.js +++ b/app/static/editor.js @@ -90,6 +90,7 @@ const Studio={ selected=parentIndex;Studio.modified();Studio.draw(); }, setLayoutGap(value){const block=blocks[selected];if(!block||block.type!=='layout')return;block.gap=Math.max(0,Math.min(64,Math.round(Number(value)||0)));Studio.modified();Studio.inspector()}, + clearStyleField(field){const b=blocks[selected];if(!b||!b.style)return;delete b.style[field];if(!Object.keys(b.style).length)delete b.style;Studio.modified();Studio.draw();Studio.refreshPreview()}, setLayoutPreset(preset){ const block=blocks[selected];const widths=editorTools.layoutPreset(block,preset); if(!widths)return toast('当前列数不支持这种预设',true); @@ -407,7 +408,7 @@ const Studio={ out+=''; } out+=`
响应式样式
`; - out+=`
快速设置外观

不必先调色值:选择样式后会立即更新预览,也可以撤销。

字体与颜色
背景与间距
`; + out+=`
快速设置外观

不必先调色值:选择样式后会立即更新预览,也可以撤销。

字体与颜色
背景与间距
`; const sharing=selectedChildId?editorTools.findChildInRoot(blocks,b.id,selectedChildId)?.child?.shared_ref:b.shared_ref; if(sharing)out+=`
已关联公共组件 · v${html(sharing.version)}

此区块将来可以按需同步新版。直接修改后会被视为本地定制。

`; out+='
'; diff --git a/themes/trade-pro/blocks.css b/themes/trade-pro/blocks.css index c72443b..8cdadac 100644 --- a/themes/trade-pro/blocks.css +++ b/themes/trade-pro/blocks.css @@ -445,3 +445,11 @@ min-height: min(64vh, 480px); } } + +/* ── 区块级字号/颜色自定义(编辑器实时预览消费)── */ +.sf-section h1,.sf-section h2{font-size:var(--sf-title-size,clamp(38px,5vw,76px))!important} +.sf-section h3{font-size:calc(var(--sf-title-size,28px) * 0.6)!important} +.sf-section p,.sf-section li{font-size:var(--sf-text-size,16px)!important} +.sf-section .sf-kicker{color:var(--sf-accent-c,#3569d3)!important} +.sf-section .sf-link,.sf-section .sf-section-head>a,.sf-section .sf-item-copy small{color:var(--sf-accent-c,#3569d3)!important} +.sf-section .sf-button{background:var(--sf-btn-c,var(--accent,#315ee2))!important}