packageDocumentation module public export function getCssVariable ( variableName , htmlElement ? ) { const element = htmlElement ?? document . documentElement ; const cssStyles = getComputedStyle ( element , null ) ; const cssVal = String ( cssStyles . getPropertyValue ( variableName ) ) . trim ( ) ; return cssVal ; } public export function getCssVariableAsNumber ( variableName , htmlElement ? ) { let cssValNum = NaN ; const cssValStr = getCssVariable ( variableName , htmlElement ) ; if ( cssValStr ) cssValNum = parseFloat ( cssValStr ) ; return cssValNum ; }