Skip to main content

Function: getThemeRegexp()

getThemeRegexp<T>(theme): RegExp

Defined in: utils/system.ts:112

Creates a regular expression pattern for matching theme and sizing references in strings.

Type Parameters​

T​

T extends object

Parameters​

theme​

T

The theme object to extract paths from

Returns​

RegExp

Regular expression for matching theme/sizing references

Example​

const regex = getThemeRegexp({ colors: { primary: '#007AFF' } });
const match = 'theme.colors.primary'.match(regex);