function formatValue(key, value) {
    if (value === null || value === undefined || value === '') {
        return '';
    }

    // Properties that should get px units for numeric values
    const needsPx = /^(width|height|top|right|bottom|left|margin|padding|fontSize|borderRadius|marginTop|marginRight|marginBottom|marginLeft|paddingTop|paddingRight|paddingBottom|paddingLeft|borderTopWidth|borderRightWidth|borderBottomWidth|borderLeftWidth)$/;

    // Properties that should never get px units
    const noPx = /^(lineHeight|opacity|zIndex|flexGrow|flexShrink|order)$/;

    if (typeof value === 'number') {
        if (needsPx.test(key)) {
            return `${value}px`;
        }
        if (!noPx.test(key)) {
            return `${value}px`;
        }
    }

    return String(value);
}
Formats a CSS value, adding units where necessary
@param {string} key - The CSS property name
@param {*} value - The value to format
@returns {string} The formatted CSS value