For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Resources
Get started
ReferenceGuidesExamplesChangelog
ReferenceGuidesExamplesChangelog
  • Designer API
    • Introduction
    • Getting Started
    • Webflow CLI
    • Error Handling
    • App Modes
  • Elements
    • Creating & Retrieving Elements
    • Element Properties & Methods
    • Element Types & Methods
  • Styles
    • Managing Style Properties
    • Managing Variable Modes
      • Get variable mode
      • Get variable modes
      • Set variable mode
      • Set variable modes
      • Remove variable mode
      • Remove variable modes
      • Remove all variable modes
  • Components
  • Variables & Collections
    • Variable Collections
    • Variables
    • Variable Modes
  • Assets
  • Pages & Folders
  • Utilities
    • User Events & Notifications
    • App Intents & Connections
  • Additional Resources
    • API Playground
    • FAQs
LogoLogo
Resources
Get started
On this page
  • style.removeVariableModes(props, options)
  • Syntax
  • Parameters
  • Returns
  • Example
  • Designer ability
StylesManaging Variable Modes

Remove variable modes

Was this page helpful?
Previous

Remove all variable modes

Next
Built with

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

1style.removeVariableModes(
2 modes: Array<{{VARIABLE_MODES}}>,
3 options?: {
4 breakpointId?: {{BREAKPOINT_ID}},
5 pseudoStateKey?: {{PSEUDO_STATE_KEY}}
6 }
7): Promise<null>;

Parameters

  • modes: Array<VariableMode> - An array of variable modes to remove.

  • options?: BreakpointAndPseudo - An object t hat lets you filter properties by breakpoint and/or pseudo-state. (Optional)

    • 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" |
      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// 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