Masonry
不同高度的卡片:测量布局、图像和自适应列。
何时使用
Masonry 将不同高度的卡片或图像放置在最短的列中。将其用于内容不均匀的收藏和画廊。对于具有共同高度的规则线条,Grid 适合。
布局取决于 DOM 尺寸。在当前的API中,元素出现在mount之后;使用 SSR 时,会保留一个空根。如果必须在没有 JavaScript 的情况下阅读内容,请选择不同的页面组合。
卡数据和标记
items 包含 key、数据和可选 children、列和 height。键在转换为字符串后必须保持唯一,并在数组更新时保持不变。
| 问题 | 设置 | 示例 |
|---|---|---|
| 放置不同高度的卡片 | items、itemRender |
不同高度的卡片 |
| 更改屏幕上的列数 | responsive columns |
自适应扬声器 |
| 更改主题阈值和间隔 | theme.token.screen* |
阈值、列和间隔 |
| 布置图像 | 内容维度 | 不同纵横比的图像 |
| 更新卡片内容 | fresh |
添加和编辑卡片 |
| 更喜欢特定的列 | item.column |
首选栏目 |
itemRender - 带有项目字段、index 和计算列的精简代码片段。如果不为 null/undefined,则 item.children 优先:甚至 0、false 和空字符串会覆盖渲染器。共济会本身的一般 children 不会创造卡片。
item.height 字段不指定布局几何形状:使用测量的 DOM 高度。为内容分配高度或让文本和图像确定高度,如示例中所示。
列、间距和测量
columns 接受正整数或 viewport 的 responsive 地图。默认情况下有三列;对于没有匹配的地图,使用 xs,然后使用一列。小数值不进行四舍五入,不适合此设置。
gutter 设置间距,一对 - 水平和垂直分别。对于当前的实现,请使用 px 中的数字或 responsive 数字映射。 GridGutter 类型允许 CSS 字符串,但 Masonry 添加 px 并在算术中使用该值,而不进行字符串规范化;这种场景仍然是有限的。
在启用了 Source 引擎的主题中,responsive columns 和两个 gutter 轴都使用全局 theme.token.screen*。在没有主题的正常模式下,应用标准边框。 Xs 读取 screenXSMax、sm 以及更多 - screenSM/screenMD/…;min/max 还检查顺序。尽管卡片尚未创建,但错误的订单已在 SSR 中被拒绝。
阈值示例 将 576/768 更改为 640/900,显示继承和 theme.inherit:false。设计令牌(design tokens)无需重新安装即可更新:保留根、编辑器、选择和 FormData。如果 screenSM 大于 screenSMMin,则 xs 和 sm 之间可能存在间隙而不匹配。 columns 使用xs或一列,每个 gutter 单独解析并且可以变为null;列的回退不会延续到间隔。
默认情况下,该组件监控图像的 root 和 load/error 事件;更改 items 也会触发重新计算。 fresh 包括在内容任意更改时对卡片大小进行额外监控。 动态示例 改变高度而不改变卡标识。
onLayoutChange 按原始顺序返回元素以及计算列及其原始字段。这是分配通知,而不是新的数据顺序。首选 item.column 仅限于现有列。
设计和生命周期
classNames/styles 从 props 设置 root/item 对象或函数;回调查看允许的 columns 数。styles 包含 CSS 字符串。卡片几何形状在语义项 styles 之后应用,因此通过布局 API 及其内容设置位置和尺寸。
ConfigProvider.masonry继承了设计;传递的嵌套记录将替换父记录。 语义示例 显示提供程序的本地样式和默认值。没有专有的命名组件令牌;颜色和字体决定了卡片的内容和整体主题。
bind:nativeElement 返回根 div。卸载时,组件会清除 ref、观察者和订阅。本机请求、对象 URL 和内容资源由应用程序释放。
按列的视觉分布保留了 DOM 中元素的原始顺序。对于具有交互式活动的卡片,请检查阅读和 Tab 顺序以及更改列数。
非空本地 prefixCls 更改 root/item/motion 类。空字符串和 undefined 继承 ConfigProvider.prefixCls 并带有 -masonry 后缀,默认为 ant-masonry。语义回调接收原始本地 prefixCls 值而不是完整解析的类。 前缀示例 在不同列数的区域中显示相同的类,fresh 并在更新时保存编辑器。
单元格宽度服务变量遵循不带点的通用前缀:--suite-masonry-item-width。独立于本地类和 theme.cssVar.prefix;使用列/gutter 设置 columns 和间隔。 Svelte 保留来自 ConfigProvider.direction 的方向并隔离 root/RTL 规则。不会重现一般参考样式表中名称 ant-masonry-rtl 的 RTL 副作用。
示例
不同高度的卡片
测量 DOM 后,元素被分配到最短的列中。 onLayoutChange 显示计算出的分布。
<script lang="ts">
import { Masonry } from '@woodger/antd';
const items = [90, 130, 70, 110, 150, 80].map((height, key) => ({ key, data: { height } }));
let distribution = $state(("测量后"));
</script>
<style>
.tile {
display: grid;
align-content: center;
gap: 8px;
box-sizing: border-box;
padding: 12px;
border-radius: 8px;
background: var(--ant-color-primary-bg);
text-align: center;
overflow-wrap: anywhere;
}
output {
display: block;
margin-top: 16px;
overflow-wrap: anywhere;
}
</style>
<Masonry
items={(items)}
columns={(3)}
gutter={12}
onLayoutChange={next => {
distribution = next.map(item => `${Number(
item.key
) + 1}→${item.column + 1}`).join(', ');
}}
>
{#snippet itemRender(item)}
<div class="tile" style={`height:${item.data.height}px`}>
{(item.index + 1)}
</div>
{/snippet}
</Masonry>
<output aria-label={("砌体分布")}>{distribution}</output>
<script lang="ts">
import { Masonry } from '@woodger/antd';
const items = [90, 130, 70, 110, 150, 80].map((height, key) => ({ key, data: { height } }));
</script>
<style>
.tile {
display: grid;
align-content: center;
gap: 8px;
box-sizing: border-box;
padding: 12px;
border-radius: 8px;
background: var(--ant-color-primary-bg);
text-align: center;
overflow-wrap: anywhere;
}
</style>
<Masonry items={(items)} columns={({ xs: 1, sm: 2, lg: 3 })} gutter={[{
xs: 8,
sm: 16,
lg: 24
}, 12]}>
{#snippet itemRender(item)}
<div class="tile" style={`height:${item.data.height}px`}>{("卡片 ")}{(item.index + 1)}</div>
{/snippet}
</Masonry>
不同纵横比的图像
Masonry 监控图像加载并重新测量高度。这使用本地生成的 SVG,无需外部请求。
<script lang="ts">
import { Masonry } from '@woodger/antd';
const items = [160, 240, 190, 280, 180, 210].map((height, key) => ({
key,
data: {
src: `data:image/svg+xml,${encodeURIComponent(
`<svg xmlns="http://www.w3.org/2000/svg" width="240" height="${height}" viewBox="0 0 240 ${height}"><rect width="240" height="${height}" fill="${key
% 2
? '#08979c'
: '#722ed1'}"/><circle cx="120" cy="${height
/ 2}" r="48" fill="white" opacity=".3"/></svg>`
)}`
}
}));
</script>
<style>
img {
display: block;
width: 100%;
border-radius: 8px;
}
</style>
<Masonry items={(items)} columns={(2)} gutter={12}>
{#snippet itemRender(item)}<img src={item.data.src} alt={("几何插图 " + String((item.index + 1)) + "")} />{/snippet}
</Masonry>
添加和编辑卡片
fresh 观察 items 的高度。稳定的 key 可以在添加、删除内容和更改高度时保留内容。
<script lang="ts">
import { Button, Masonry } from '@woodger/antd';
let items = $state([90, 130, 70].map((height, key) => ({ key, data: { height } })));
let nextKey = $state(3);
function add() {
items = [...items, { key: nextKey, data: { height: 100 } }];
nextKey += 1;
}
function grow() {
items = items.map(
(item, index) => index === 0
? { ...item, data: { height: item.data.height + 40 } }
: item
);
}
</script>
<style>
.tile {
display: grid;
align-content: center;
gap: 8px;
box-sizing: border-box;
padding: 12px;
border-radius: 8px;
background: var(--ant-color-primary-bg);
text-align: center;
overflow-wrap: anywhere;
}
.controls {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 12px;
margin-bottom: 16px;
}
output {
display: block;
margin-top: 16px;
overflow-wrap: anywhere;
}
</style>
<div class="controls">
<Button onclick={add}>{("添加卡")}</Button>
<Button disabled={!items.length} onclick={() => { items = items.slice(0, -1); }}>
{("删除最后一个")}
</Button>
<Button disabled={!items.length} onclick={grow}>{("先放大")}</Button>
</div>
<Masonry items={(items)} columns={(2)} gutter={12} fresh>
{#snippet itemRender(item)}
<div class="tile" style={`height:${item.data.height}px`}>{("卡片 ")}{(Number(
item.key
) + 1)}</div>
{/snippet}
</Masonry>
<output
aria-label={("砖石卡数量")}
>{(items.length)}</output>
首选栏目
列指定从零开始的索引。随着列数的减少,索引仅限于最后一个可用列。
<script lang="ts">
import { Masonry } from '@woodger/antd';
let columns = $state(3);
const items = [90, 130, 70, 110].map((height, key) => ({
key,
column: key === 0 ? 2 : undefined,
data: { height }
}));
</script>
<style>
.tile {
display: grid;
align-content: center;
gap: 8px;
box-sizing: border-box;
padding: 12px;
border-radius: 8px;
background: var(--ant-color-primary-bg);
text-align: center;
overflow-wrap: anywhere;
}
.controls {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 12px;
margin-bottom: 16px;
}
label {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
</style>
<div
class="controls"
><label>{("砖石扬声器 ")}<select
bind:value={columns}
><option
value={2}
>2</option><option
value={3}
>3</option><option
value={4}
>4</option></select></label></div>
<Masonry items={(items)} columns={(columns)} gutter={12}>
{#snippet itemRender(item)}
<div class="tile" style={`height:${item.data.height}px`}>{(item.index + 1)}{(": 柱子 ")}{(item.column + 1)}</div>
{/snippet}
</Masonry>
不同轴距
数字对指定水平和垂直 gutter(以 px 为单位)。该控件更改几何形状而不重新创建数据。
<script lang="ts">
import { Masonry } from '@woodger/antd';
const items = [90, 130, 70, 110, 150, 80].map((height, key) => ({ key, data: { height } }));
let horizontal = $state(12);
let vertical = $state(20);
</script>
<style>
.tile {
display: grid;
align-content: center;
gap: 8px;
box-sizing: border-box;
padding: 12px;
border-radius: 8px;
background: var(--ant-color-primary-bg);
text-align: center;
overflow-wrap: anywhere;
}
.controls {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 12px;
margin-bottom: 16px;
}
label {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
</style>
<div class="controls">
<label>{("水平间距 ")}<input
type="range"
min="0"
max="32"
bind:value={horizontal}
/><output>{horizontal}</output></label>
<label>{("垂直间距 ")}<input
type="range"
min="0"
max="32"
bind:value={vertical}
/><output>{vertical}</output></label>
</div>
<Masonry items={(items)} columns={(2)} gutter={[horizontal, vertical]}>
{#snippet itemRender(item)}
<div class="tile" style={`height:${item.data.height}px`}>
{(item.index + 1)}
</div>
{/snippet}
</Masonry>
语义槽和提供者
ConfigProvider.masonry 指定总体布局。本地函数 styles 获取允许的 columns 数。
<script lang="ts">
import { ConfigProvider, Masonry } from '@woodger/antd';
const items = [90, 130, 70, 110, 150, 80].map((height, key) => ({ key, data: { height } }));
</script>
<style>
.tile {
display: grid;
align-content: center;
gap: 8px;
box-sizing: border-box;
padding: 12px;
border-radius: 8px;
background: var(--ant-color-primary-bg);
text-align: center;
overflow-wrap: anywhere;
}
</style>
<ConfigProvider masonry={{
styles: {
root: `
border: 1px dashed var(--ant-color-border);
border-radius: 8px;
`
}
}}>
<Masonry items={(items)} columns={(2)} gutter={12} classNames={{
item: 'custom-masonry-item'
}} styles={({ props }) => ({ item: `opacity:${props.columns === 2 ? 0.9 : 1}` })}>
{#snippet itemRender(item)}
<div class="tile" style={`height:${item.data.height}px`}>
{(item.index + 1)}
</div>
{/snippet}
</Masonry>
</ConfigProvider>
相同的局部类用于不同数量的列。更改高度后新鲜更新布局,保存编辑器。
本地和共享前缀
具有一个局部类的两列;fresh 的 styles,原始前缀并保存编辑器。
<script lang="ts">
import { Checkbox, ConfigProvider, Input, Masonry, type MasonryItemType } from '@woodger/antd';
let custom = $state(true);
let local = $state(true);
let tall = $state(false);
let draft = $state('');
const prefix = $derived(custom ? 'suite' : 'ant');
const items: MasonryItemType<{ height: number; title: string }>[] = [
{ key: 'draft', data: { height: 96, title: "草稿" } },
{ key: 'guide', data: { height: 64, title: "管理" } },
{ key: 'api', data: { height: 80, title: 'API' } },
{ key: 'examples', data: { height: 72, title: "示例" } }
];
</script>
<style>
.example {
display: grid;
gap: 20px;
min-width: 0;
}
.controls {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
.tile {
display: grid;
box-sizing: border-box;
align-content: start;
gap: 8px;
min-width: 0;
padding: 12px;
border-radius: 8px;
background: var(--ant-color-fill-secondary);
overflow-wrap: anywhere;
}
p { margin: 0; }
output { overflow-wrap: anywhere; }
</style>
<div class="example">
<div class="controls">
<Checkbox bind:checked={custom}>{("通用前缀 Masonry 套件")}</Checkbox>
<Checkbox bind:checked={local}>{("砌体本地前缀")}</Checkbox>
<Checkbox bind:checked={tall}>{("带前缀的放大卡")}</Checkbox>
</div>
<ConfigProvider prefixCls={prefix} theme={{ cssVar: { prefix: 'masonry-theme' } }}>
<Masonry
items={(items)}
columns={(2)}
gutter={12}
fresh
class="prefix-masonry-main"
prefixCls={local ? 'project-masonry' : ''}
styles={({ props }) => ({
root: `outline: 1px ${props.prefixCls ? 'solid' : 'dashed'} var(--ant-color-primary-border)`
})}
>
{#snippet itemRender(item)}
<div class="tile" style={`height: ${item.key === 'draft'
&& tall ? 148 : item.data.height}px`}>
<span>{(item.data.title)}</span>
{#if item.key === 'draft'}
<Input bind:value={draft} aria-label={("带前缀的砌体草图")} />
{/if}
</div>
{/snippet}
</Masonry>
</ConfigProvider>
<ConfigProvider prefixCls="neighbor">
<Masonry items={(items.slice(1, 3))} columns={(1)} gutter={8}
class="prefix-masonry-neighbor" prefixCls={local ? 'project-masonry' : ''}>
{#snippet itemRender(item)}
<div
class="tile"
style={`height: ${item.data.height}px`}
>{(item.data.title)}</div>
{/snippet}
</Masonry>
</ConfigProvider>
<output
aria-label={("前缀砌体")}
>{("\n 一般的: ")}{prefix}{(";班级: ")}{(local ? 'project-masonry' : prefix + '-masonry')}
</output>
<p>
{("相同的局部类用于不同数量的列。更改高度后新鲜更新布局,保存编辑器。")}
</p>
</div>
<script lang="ts">
import { Button, Card, Masonry } from '@woodger/antd';
const source = [120, 80, 160, 100, 140, 90].map((height, index) => ({
key: index,
data: { height, title: `卡片 ${index + 1}` }
}));
let reversed = $state(false);
let items = $derived(reversed ? [...source].reverse() : source);
</script>
<style>
.actions { margin-bottom: 16px; }
.masonry { min-height: 300px; }
</style>
<div class="actions">
<Button
onclick={() => { reversed = !reversed; }}
>{("更改卡片顺序")}</Button>
</div>
<div class="masonry">
<Masonry
items={(items)}
columns={({ xs: 1, sm: 2, lg: 3 })}
gutter={16}
fresh
>
{#snippet itemRender(item)}
<Card size="small" title={(item.data.title)} style={`height:${item
.data.height}px`}>{("\n 高度 ")}{(item.data.height)}px
</Card>
{/snippet}
</Masonry>
</div>
阈值砌体父级
旧砌体阈值
砖石阈值重置
列和两个装订线轴读取全局 theme.token.screen*。其sm/md阈值为640/900px;嵌套区域继承它们,inherit:false返回576/768px。 sm 查询使用 screenSM 而不是 screenSMMin。在没有匹配的间隔中,列恢复为 xs,间隔单独解析。更改标记会保存元素和编辑器;有了SSR,就会留下一个没有卡的空根。
主题阈值、列和间距
全局屏幕* 标记会更改 columns 和两个 gutter 轴。继承与 inherit:false 的比较;更新阈值时保存卡片、编辑器和 nativeElement。
Breakpoints.svelte<script lang="ts"> import { Checkbox, ConfigProvider } from '@woodger/antd'; import BreakpointMasonry from './BreakpointMasonry.svelte'; let custom = $state(true); let separateMinimum = $state(false); const token = $derived( custom ? { screenXSMax: 639, screenSMMin: 640, screenSM: separateMinimum ? 680 : 640, screenSMMax: 899, screenMDMin: 900, screenMD: separateMinimum ? 920 : 900 } : {} ); </script> <style> .example, .scopes { display: grid; gap: 24px; min-width: 0; } .controls { display: flex; flex-wrap: wrap; gap: 12px; } p { margin: 0; } </style> <div class="example"> <div class="controls"> <Checkbox bind:checked={custom}>{("你自己的门槛砌体")}</Checkbox> <Checkbox bind:checked={separateMinimum}> {("单独的 screenSMMin 和 screenSM Masonry")} </Checkbox> </div> <ConfigProvider theme={{ cssVar: { prefix: 'responsive-masonry' }, token }}> <div class="scopes"> <BreakpointMasonry id="custom" title={("阈值砌体父级")} /> <ConfigProvider> <BreakpointMasonry id="inherited" title={("旧砌体阈值")} /> </ConfigProvider> <ConfigProvider theme={{ inherit: false }}> <BreakpointMasonry id="reset" title={("砖石阈值重置")} /> </ConfigProvider> </div> </ConfigProvider> <p> {("列和两个装订线轴读取全局 theme.token.screen*。其sm/md阈值为640/900px;嵌套区域继承它们,inherit:false返回576/768px。 sm 查询使用 screenSM 而不是 screenSMMin。在没有匹配的间隔中,列恢复为 xs,间隔单独解析。更改标记会保存元素和编辑器;有了SSR,就会留下一个没有卡的空根。")} </p> </div>BreakpointMasonry.svelte<script lang="ts"> import { Input, Masonry, type MasonryItemType } from '@woodger/antd'; let { id, title }: { id: string; title: string } = $props(); let draft = $state(("草稿")); let nativeElement = $state<HTMLDivElement>(); let columns = $state(0); const items: MasonryItemType<{ height: number }>[] = [112, 64, 96, 72, 88, 56] .map((height, key) => ({ key, data: { height } })); </script> <style> section { display: grid; gap: 12px; min-width: 0; padding: 16px; border-radius: 8px; background: var(--ant-color-bg-container); color: var(--ant-color-text); } .tile { display: grid; align-content: start; gap: 8px; box-sizing: border-box; min-width: 0; padding: 12px; border-radius: 8px; background: var(--ant-color-fill-secondary); overflow-wrap: anywhere; } h4 { margin: 0; } </style> <section id={`masonry-breakpoints-${id}`} aria-label={(title)}> <h4>{(title)}</h4> <form aria-label={("" + String((title)) + ": 形式")} onsubmit={event => { event.preventDefault(); }}> <Masonry items={(items)} bind:nativeElement columns={({ xs: 1, sm: 2, md: 3 })} gutter={[{ xs: 0, sm: 12, md: 18 }, { xs: 4, sm: 8, md: 12 }]} onLayoutChange={layout => { columns = layout.length ? Math.max(...layout.map(item => item.column ?? 0)) + 1 : 0; }}> {#snippet itemRender(item)} <div class="tile" style={`height:${item.data.height}px`}> <span>{("卡片 ")}{(item.index + 1)}</span> {#if item.index === 0} <Input name="draft" aria-label={("" + String((title)) + ": 草稿")} bind:value={draft} /> {/if} </div> {/snippet} </Masonry> </form> <output aria-label={("" + String((title)) + ": 扬声器")} >{("演讲嘉宾: ")}{columns}</output> <output aria-label={("" + String((title)) + ": 根")}>{(nativeElement ? "已连接" : "等待挂载")}</output> </section>
API
ant.design 实时页面主题映射到已安装包的公共 API。 Props 的完整定义位于 @woodger/antd 中。
| 主题 | 示例或限制 |
|---|---|
| CSS prefixes | 本地类、公共命名空间宽度和保存测量的单元格。 |
| Basic | 高度测量和短柱。 |
| Responsive | 按 viewport 排列的列和 gutter。 |
| Image | 上传不同比例的图像。 |
| Dynamic | 添加、删除和新鲜监控。 |
| Custom semantic dom styling | 本地函数和 ConfigProvider.masonry。 |
| 属性 | 描述 | 类型 | 默认 |
|---|---|---|---|
prefixCls | root/item/运动类的完整本地前缀。空字符串和 undefined 继承相同的前缀。 styles/classNames 获取原始本地前缀;宽度服务变量取决于 ConfigProvider.prefixCls。 | string | ConfigProvider + -masonry |
items | 唯一的 key、数据和可选的 children/列/height。 | MasonryItemType<Data>[] | — |
itemRender | 苗条的片段;获取原始字段、index 和计算列。 | Snippet<[MasonryRenderInfo<Data>]> | — |
columns | 由 theme.token.screen* 映射的正整数或断点。令牌是继承的,并且无需重新安装即可更改查询。对于没有匹配的地图,请使用 xs,然后使用 1。 | number | GridResponsive<number> | 3 |
gutter | 两个轴或一对水平轴和垂直轴的一个数字间隔。每个轴的 responsive 地图使用全局屏幕*主题阈值。 | GridGutter | [GridGutter, GridGutter] | 0 |
fresh | 通过 ResizeObserver 持续监控各个元素的大小。 | boolean | false |
onLayoutChange | 维度后具有计算列的 items 的原始顺序。 | (items with column) => void | — |
classNames | 类 root/item、对象或函数。 | MasonrySemantic<Data> | — |
styles | CSS 行 root/item;该函数接收启用了 columns 的 props。 | MasonrySemantic<Data> | — |
nativeElement | bind:nativeElement 在挂载后返回 root。 | HTMLDivElement | — |
children | 兼容的道具字段;单元格是通过 items 指定的,而不是通过一般 children 指定的。 | MasonryContent | — |
MasonryItem
key 是唯一的字符串或数字,转换为字符串后检查唯一性。列是从零开始的首选索引。数据存储应用程序数据; itemRender 接收它们以及 index 和列。采用 height 是为了兼容,但不会取代 DOM 尺寸。
Semantic DOM
root 是一个具有计算高度的 div,item 是一个定位单元格。按列的视觉分布不会改变原始的阅读和键盘顺序。 ConfigProvider.masonry 和本地 classNames/styles 样式根/item。
在 SSR 上 root 是空的;items 在挂载后出现,就像原来的效果一样。如果您需要服务器端内容,请选择不同的应用程序组合。 bind:nativeElement 在卸载时被清除;该组件自行删除观察者和订阅。
注册令牌
Masonry 没有自己的组件令牌。卡片的颜色和字体决定了子组件和整体主题; root/item 使用语义样式进行 styles 设置。布局和间距由 columns/gutter 设置。
| 代币 | 当前值 |
|---|---|
motionDurationFast | 0.1s |
motionDurationSlow | 0.3s |
motionEaseOut | cubic-bezier(0.215, 0.61, 0.355, 1) |
FAQ
为什么更改高度不会重新排列布局?
对于任意内容更改,启用 fresh。如果没有它,就会观察到根、图像加载和 items 更改。
什么优先于 itemRender?
item.children,除了 null/undefined。一般 children 的单元格不会创建。
为什么 height 不设置卡片的高度?
布局衡量 DOM。设置内容本身的大小或使用其自然高度。
是否可以将 gutter 作为 CSS 字符串传递?
该类型允许这样做,但几何中还没有字符串规范化。使用数字区间或 responsive 数字映射。