Skip to main content

getFontStyle

Spicetify provides a function that returns the CSS style for a given font variant used in the Spotify app.

tip

This function is used to provide backwards compatibility for older Spicetify extensions and custom apps that uses main-type- classes.

Instead of using this function to get Spotify stylings, you can simply add the main-type-<variant> class to your element.

function getFontStyle(font: Variant): string;

Parameters

ParameterTypeDescription
fontVariantFont variant

Returns

string - CSS style for the given font variant.

Example

const style = getFontStyle("forte");

// Returns "viola" if given an invalid variant
// Equivalent to `getFontStyle("viola");`
const style = getFontStyle("invalid-variant");