Skip to main content

StyleSetter

Overview

By enabling StyleSetter, you can configure style properties through a style configuration panel.

Display

Setter Configuration

PropertyTypeDescription
unitStringDefault value: px
placeholderScaleNumberDefault computed size scale. Default value: 1 When no value is set, the system computes the displayed value via window.getComputedStyle. In some scenarios, such as mobile, the editor may show a width of 375 while the design width is 750 — in that case, set this scale to 2.
showModuleListString[]Default value: ['background', 'border', 'font', 'layout', 'position']. Corresponds to the five sections: background, border, text, layout, and position. Show or hide sections as needed for your scenario. For example, for a text component that does not need border styling, you can hide the border module.
isShowCssCodeBooleanDefault value: true. Whether to show CSS source editing.
layoutPropsConfigObjectLayout style settings
layoutPropsConfig.showDisPlayListString[]Default value: ['inline', 'flex', 'block', 'inline-block', 'none'] Show as needed
layoutPropsConfig.isShowPaddingStringDefault value: true Whether to show padding (all four sides)
layoutPropsConfig.isShowMarginBooleanDefault value: true Whether to show margin (all four sides)
layoutPropsConfig.isShowWidthHeightBooleanDefault value: true Whether to show width and height
fontPropsConfigObjectText style settings
fontPropsConfig.fontFamilyListArray[ { value: 'Helvetica', label: 'Helvetica' }, { value: 'Arial', label: 'Arial' },] Customize font family options
positionPropsConfigObjectPosition style settings
positionPropsConfig.isShowFloatBooleanDefault: true. Whether to show float
positionPropsConfig.isShowClearBooleanDefault: true. Whether to show clear float