> This page is for Designer API.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.webflow.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.webflow.com/_mcp/server.

# Get style by name or path

## **`webflow.getStyleByName(nameOrPath)`**

Retrieve a Style by its name or path.

### Syntax

```typescript
webflow.getStyleByName(nameOrPath: string | Array<string>): Promise<Style | null>
```

### Parameters

* **`nameOrPath`**: *string | Array\<string>* - The name of the style to retrieve or the path to the style to retrieve, consisting of the name of the parent and the name of the style.

### Returns

**Promise\<*`Style`* | `null`>**

A Promise that resolves to a style object, or `null` if the named style doesn't exist.

### Examples

Getting a style by name:

```typescript
// Retrieve the style by name
const retrievedStyle = await webflow.getStyleByName(styleName);

if (retrievedStyle) {
  // Get and print properties of the retrieved style
  const styleProperties = await retrievedStyle.getProperties();
  console.log("Style properties:", styleProperties);
} else {
  console.log(`Style ${styleName} not found.`);
}
```

[Try this example](https://webflow.com/oauth/authorize?response_type=code\&client_id=19511de1ec410f9228d8dcbc9420e67916dea80d86d18f0c9a533eb475ea0f62)

Getting a style by path:

```typescript
// Retrieve the style by parent name and style name
const retrievedStyle = await webflow.getStyleByName([styleParentName, styleName]);

if (retrievedStyle) {
  // Get and print properties of the retrieved style
  const styleProperties = await retrievedStyle.getProperties();
  console.log("Style properties:", styleProperties);
} else {
  console.log(`Style ${styleName} with parent ${styleParentName} not found.`);
}
```

[Try this example](https://webflow.com/oauth/authorize?response_type=code\&client_id=19511de1ec410f9228d8dcbc9420e67916dea80d86d18f0c9a533eb475ea0f62)

### Designer Ability

Checks for authorization only

| Designer Ability    | Locale | Branch | Workflow | Sitemode |
| :------------------ | :----- | :----- | :------- | :------- |
| **canAccessCanvas** | Any    | Any    | Any      | Any      |