New functions for accessing styles and manipulating Div Block element tags

Retrieve styles by paths

The function webflow.getStyleByName() can now accept a nested style path array to get a style, instead of only a single style name. If you have different styles with the same name within a site, you can pass an array with the name of the parent style and the name of the child style to identify a specific style, as in this example:

1const retrievedStyle = await webflow.getStyleByName(["fa-cms-filter-container", "fa-hide-cms-filter"]);

This change is backward-compatible because the function still accepts a single style name.

For more information, see Get style by name or path.

Get and set Div Block element tags

The new functions element.getTag() and element.setTag() allow you to get and set the element tag on a Div Block element, which sets its purpose on the page, such as header, footer, or figure.

For more information, see Get Div Block element tag and Set Div Block element tag.