v0.10.14: H13.5 counter 统计条(9084925)完成
- image-box 支持 title_typography_*/description_typography_*(36px/700/#ED6C00 标题、 18px 描述)、image_space(图标下距 6px)、text_align、title_color 落样式; 对应键进 slim 白名单 - 六列图标宽 30% 仅存 post-18 生成 CSS(DB 无 image_size),scoped 补规则 (efe1577/d48a588/46684e1/17330e2/a7cd0a1/e6b1413) - 双端节内相对几何/计算样式 JSON 逐字节一致:sec h 208→235 与原站全等, 列边框 #E0E5F9(globals ee1917e)、末列四边;H0-H13.5 全页高度回归零差异
This commit is contained in:
@@ -891,15 +891,31 @@ function ImageBoxWidget({ settings }: { settings: Record<string, unknown> }) {
|
||||
const isRow = pos === "left" || pos === "right";
|
||||
const imgW = sizeCss(settings.image_size);
|
||||
const titleSpace = sizeCss(settings.title_bottom_space);
|
||||
// 图与标题间距 image_space(H13.5 counter 条实测 6px,生成规则 margin-bottom:6px)
|
||||
const imgSpace = sizeCss(settings.image_space);
|
||||
// 内容垂直对齐(content_vertical_alignment 控件,仅 left/right 行布局生效):
|
||||
// 由 per-widget 生成规则输出 align-items(514e513 middle → center 实测;否则 flex 默认 stretch)
|
||||
const vaMap: Record<string, string> = { top: "flex-start", middle: "center", bottom: "flex-end" };
|
||||
const va = isRow ? vaMap[s(settings.content_vertical_alignment)] : undefined;
|
||||
// 文本对齐 text_align(H13.5 counter 条 left)与标题/描述排版
|
||||
// (title_typography_* / description_typography_* 组合字段,counter 条 36px/700 橙 + 18px 描述)
|
||||
const textAlign = s(settings.text_align) as CSSProperties["textAlign"] | undefined;
|
||||
const titleStyle: CSSProperties = {
|
||||
...(titleSpace ? { marginBottom: titleSpace } : {}),
|
||||
...typographyCss(settings, "title_typography"),
|
||||
};
|
||||
// 标题色 title_color(resolveGlobals 已解析 globals/colors?id=primary → #ED6C00)
|
||||
if (s(settings.title_color)) titleStyle.color = s(settings.title_color) as string;
|
||||
const descStyle = typographyCss(settings, "description_typography");
|
||||
// flex/边距在 app.css 的 .el-imagebox-pos-* 规则(带 768 断点),这里只带 per-widget 图宽与垂直对齐
|
||||
const figStyle: CSSProperties | undefined = isRow && imgW ? { width: imgW } : undefined;
|
||||
const figStyle: CSSProperties | undefined = isRow && imgW
|
||||
? { width: imgW }
|
||||
: imgSpace
|
||||
? { marginBottom: imgSpace }
|
||||
: undefined;
|
||||
return (
|
||||
<div className={"el-imagebox" + posCls}>
|
||||
<div className="el-imagebox-wrapper" style={va ? { alignItems: va } : undefined}>
|
||||
<div className="el-imagebox-wrapper" style={{ ...(va ? { alignItems: va } : {}), ...(textAlign ? { textAlign } : {}) }}>
|
||||
{url ? (
|
||||
<figure className="el-imagebox-img" style={figStyle}>
|
||||
{link ? (
|
||||
@@ -912,7 +928,7 @@ function ImageBoxWidget({ settings }: { settings: Record<string, unknown> }) {
|
||||
{title || desc ? (
|
||||
<div className="el-imagebox-content">
|
||||
{title ? (
|
||||
<Tag className="el-imagebox-title" style={titleSpace ? { marginBottom: titleSpace } : undefined}>
|
||||
<Tag className="el-imagebox-title" style={Object.keys(titleStyle).length ? titleStyle : undefined}>
|
||||
{link ? (
|
||||
<a {...linkProps} dangerouslySetInnerHTML={{ __html: title }} />
|
||||
) : (
|
||||
@@ -921,7 +937,13 @@ function ImageBoxWidget({ settings }: { settings: Record<string, unknown> }) {
|
||||
)}
|
||||
</Tag>
|
||||
) : null}
|
||||
{desc ? <p className="el-imagebox-description" dangerouslySetInnerHTML={{ __html: desc }} /> : null}
|
||||
{desc ? (
|
||||
<p
|
||||
className="el-imagebox-description"
|
||||
style={Object.keys(descStyle).length ? descStyle : undefined}
|
||||
dangerouslySetInnerHTML={{ __html: desc }}
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
@@ -47,6 +47,18 @@ const SETTING_KEYS = new Set([
|
||||
"image_size",
|
||||
"title_bottom_space",
|
||||
"content_vertical_alignment",
|
||||
// image-box 图标间距/文本对齐/标题与描述排版(H13.5 counter 条)
|
||||
"image_space",
|
||||
"text_align",
|
||||
"title_typography_typography",
|
||||
"title_typography_font_size",
|
||||
"title_typography_font_size_mobile",
|
||||
"title_typography_font_size_tablet",
|
||||
"title_typography_font_weight",
|
||||
"description_typography_typography",
|
||||
"description_typography_font_size",
|
||||
"description_typography_font_size_mobile",
|
||||
"description_typography_font_size_tablet",
|
||||
"gradient_angle",
|
||||
"color_a",
|
||||
"color_b",
|
||||
|
||||
Reference in New Issue
Block a user