Remove variable modes

style.removeVariableModes(props, options)

Remove multiple variable modes from a style. Each variable mode is associated with a variable collection. To remove multiple variable modes, provide an array of variable mode objects.


Syntax

1removeVariableModes(
2 modes: Array<VariableMode>,
3 options?: BreakpointAndPseudo
4): Promise<null>;

Parameters

Returns

Promise<null>

A Promise that resolves to null.

Example

1// Get Selected Element
2const selectedElement = await webflow.getSelectedElement()
3
4if (selectedElement?.styles) {
5// Get Styles
6const styles = await selectedElement.getStyles()
7const primaryStyle = styles[0] // Get the primary style
8
9// Get Variable Modes from Collection
10const variableModes = await variableCollection?.getAllVariableModes()
11const remove = await primaryStyle?.removeVariableModes(variableModes)
12
13}

Try this example

Designer ability

Designer AbilityLocaleBranchWorkflowSitemode
canModifyStyleBlocksAnyAnyCanvasDesign