Remove variable mode on a style

style.removeVariableMode(collection, options)

Remove a variable mode from a style, by using the variable collection that belongs to the variable mode.


Syntax

1 removeVariableMode(
2 collection: VariableCollection,
3 options?: BreakpointAndPseudo
4 ): Promise<null>;

Parameters

  • collection: VariableCollection - The variable collection that belongs to the variable mode.
  • options?: BreakpointAndPseudo - The breakpoint and pseudo state for the style.

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
9await primaryStyle?.removeVariableMode(variableCollection)
10}

Try this example

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canModifyStyleBlocksAnyAnyCanvasDesign