webflow.getPseudoMode()

Get the current pseudo-class state (e.g. hover, focus, pressed) of the designer.

Syntax

1webflow.getPseudoMode(): Promise<null | PseudoStateKey>

Returns

A Promise that resolves to the current pseudo-class state of the designer, or null if no pseudo-state is active.

Promise<PseudoStateKey | null>

Pseudo-StateDesigner StateDescription
hoverHoverElement is hovered over by the mouse
pressedPressedElement is in pressed state
visitedVisitedLink element has been visited
focusFocusedElement has keyboard/input focus
focus-visibleFocused (Keyboard)Element has keyboard focus with visible indicator
focus-withinElement or its descendant has focus
placeholderPlaceholderPlaceholder text in form block inputs
first-childFirst ItemFirst Collection Item in a collection list
last-childLast ItemLast Collection Item in a collection list
nth-child(odd)Odd ItemsOdd-numbered Collection Item in a collection list
nth-child(even)Even ItemsEven-numbered Collection Item in a collection list

Example

1const pseudoState = await webflow.getPseudoMode();
2console.log(pseudoState);
3// Output: "hover"

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny
Built with