Remove all variable modes

style.removeAllVariableModes(options)

Remove all variable modes from a style.


Syntax

1style.emoveAllVariableModes(
2 options?: {
3 breakpointId?: BreakpointId
4 pseudoStateKey?: PseudoStateKey
5 }
6): Promise<null>

Parameters

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

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

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

Returns

Promise<null>

A promise that resolves to null.

Example

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

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canModifyStyleBlocksAnyAnyCanvasDesign