Wix.Styles

getStyleId

Retrieves the component’s styleId. The styleId represents a set of style parameters we’ve stored for a specific component – colors, fonts, numbers, and booleans.

SDK Version: SDK 1.65.0+
Editor Version: New Editor
Display: Live Site, Preview
Components: Widget, Pinned (aka Fixed-Position) Widget, Page

Once you know the component’s styleId, you can retrieve these style parameters using getStyleParamsByStyleId.

Syntax:

コピー
1

Parameters:

名称タイプ説明
callback (required)Function A callback function that receives the styleId

Example:

コピー
1

getStyleParams

Retrieves the style parameters of the current component: booleans, numbers, colors, and fonts.

SDK Version: SDK 1.26.0+
Editor Version: New Editor, Old Editor
Display: Live Site, Preview
Components: Widget, Pinned (aka Fixed-Position) Widget, Page

Note:
If calling this method in the settings endpoint, it returns the style parameters of the component that opened the settings endpoint.

Syntax:

コピー
1

Parameters:

名称タイプ説明
callbackFunction Callback function to retrieve the style values

Example:

コピー
1

Returns:

コピー
1

getStyleParamsByStyleId

Retrieves the style parameters for a given styleId. The styleId represents a set of style parameters we’ve stored for a specific component – colors, fonts, numbers, and booleans.

SDK Version: SDK 1.65.0+
Editor Version: New Editor
Display: Live Site, Preview
Components: Widget, Pinned (aka Fixed-Position) Widget, Page

You can get the component’s styleId using getStyleId.

Syntax:

コピー
1

Parameters:

名称タイプ説明
styleId (required)StringThe component’s styleId
onSuccess (required)FunctionCallback function to retrieve the component’s style parameters
onFailureFunction Callback function to handle the case that the styleId wasn't found

Example:

コピー
1
役に立ちましたか?
はい
いいえ