Skip to main content

foundation-utils.getcurrentdesignsystemprefix

Home > @genesislcap/foundation-utils > getCurrentDesignSystemPrefix

getCurrentDesignSystemPrefix() function

Get the current design system prefix by checking available providers. If no provider is found, falls back to the provided prefix.

Signature:

export declare function getCurrentDesignSystemPrefix(element: HTMLElement, fallbackPrefix: string): string;

Parameters

Parameter

Type

Description

element

HTMLElement

The starting HTML element

fallbackPrefix

string

The prefix to fallback to if the provider is not available

Returns:

string

The current design system prefix

Example

const prefix = getCurrentDesignSystemPrefix(myElement, 'default-prefix');
logger.debug(prefix); // e.g., 'rapid' or 'default-prefix'