Skip to content

Commit

Permalink
Added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Oct 9, 2023
1 parent d0f2fa5 commit 807796b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/components/src/theme/ThemeUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,25 @@ export function getThemePreloadData(): ThemePreloadData | null {
/**
* Identifies start and end indices of any css variable expressions in the given
* string.
*
* e.g.
* getCssVariableRanges('var(--aaa-aa) var(--bbb-bb)')
* yields:
* [
* [0, 12],
* [14, 26],
* ]
*
* In cases where there are nested expressions, only the indices of the outermost
* expression will be included.
*
* e.g.
* getCssVariableRanges('var(--ccc-cc, var(--aaa-aa, green)) var(--bbb-bb)')
* yields:
* [
* [0, 34], // range for --ccc-cc expression
* [36, 48], // range for --bbb-bb expression
* ]
* @param value The string to search for css variable expressions
* @returns An array of [start, end] index pairs for each css variable expression
*/
Expand Down

0 comments on commit 807796b

Please sign in to comment.