Remove all variable modes

style.removeAllVariableModes(options)

Remove all variable modes from a style.


Syntax

style.emoveAllVariableModes(
options?: {
breakpointId?: BreakpointId
pseudoStateKey?: PseudoStateKey
}
): Promise<null>

Parameters

  • options?: BreakpointAndPseudo - The breakpoint and pseudo state for the style.
    • BreakpointId: Identifies the responsive breakpoint to get styles for.

      type BreakpointId = "xxl" | "xl" | "large" | "main" | "medium" | "small" | "tiny"
    • PseudoStateKey: Specifies a CSS pseudo-class to get styles for.

      type PseudoStateKey = "noPseudo" | "nth-child(odd)" | "nth-child(even)" |
      "first-child" | "last-child" | "hover" | "active" |
      "visited" | "focus" | "focus-visible" | "focus-within" |
      "placeholder" | "empty" | "before" | "after"

Returns

Promise<null>

A promise that resolves to null.

Example

// Get Selected Element
const selectedElement = await webflow.getSelectedElement()
if (selectedElement?.styles) {
// Get Styles
const styles = await selectedElement.getStyles()
const primaryStyle = styles[0] // Get the primary style
// Get Variable Modes
const remove = await primaryStyle?.removeAllVariableModes()
}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canModifyStyleBlocksAnyAnyCanvasDesign