feat: md icon prefix

This commit is contained in:
2026-03-13 11:33:13 +08:00
parent 346b97153f
commit 9e8d4e6388
4 changed files with 33 additions and 7 deletions
+16 -1
View File
@@ -269,7 +269,22 @@ export function createDeckStore(
const generateCode = () => {
const layersStr = formatLayers(state.layerConfigs);
return `:md-deck[${state.rawSrc || state.src}]{size="${state.sizeW}x${state.sizeH}" grid="${state.gridW}x${state.gridH}" bleed="${state.bleed}" padding="${state.padding}" layers="${layersStr}"}`;
const parts = [
`:md-deck[${state.rawSrc || state.src}]`,
`{size="${state.sizeW}x${state.sizeH}"`,
`grid="${state.gridW}x${state.gridH}"`
];
// 仅在非默认值时添加 bleed 和 padding
if (state.bleed !== DECK_DEFAULTS.BLEED) {
parts.push(`bleed="${state.bleed}"`);
}
if (state.padding !== DECK_DEFAULTS.PADDING) {
parts.push(`padding="${state.padding}"`);
}
parts.push(`layers="${layersStr}"}`);
return parts.join(' ');
};
const copyCode = async () => {