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
      • Get all styles
      • Get style by name or path
      • Create style
      • Set style name
      • Remove style
      • Is combo class
      • Get style type
      • Is from library
      • Get parent style
    • Managing Style Properties
    • Managing 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
  • webflow.getAllStyles()
  • Syntax
  • Returns
  • Example
  • Designer Ability
StylesCreating & Retrieving Styles

Get all styles

Was this page helpful?
Previous

Get style by name or path

Next
Built with

webflow.getAllStyles()

Retrieve all Styles, also known as Classes, present on the Webflow site.

Syntax

1webflow.getAllStyles(): Promise<Array<Style>>

Returns

Promise<Array<Style>>

A Promise that resolves to an array of Style objects representing all the styles present on the current site.

Example

1// Get all Styles
2const allStyles = await webflow.getAllStyles();
3
4// List Styles
5if (allStyles.length > 0) {
6
7 console.log("List of all styles:");
8
9 allStyles.forEach(async (style, index) => {
10
11 // Print style names and ids
12 console.log(`${index + 1}. Style Name: ${await style.getName()}, Style ID: ${style.id}`);
13 });
14} else {
15 console.log("No styles found in the current context.");
16}

Try this example

Designer Ability

Checks for authorization only

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny