Skip to content

@sqlrooms/monaco-editor / getCssColor

Function: getCssColor()

getCssColor(variableName, fallbackColor): string

Safely gets a CSS variable and ensures it's in a format Monaco can use

Parameters

ParameterTypeDescription
variableNamestringCSS variable name (e.g. '--background')
fallbackColorstringFallback color if the variable isn't found

Returns

string

A color string in a format Monaco can use (typically hex)