import re


def __capitalize_hexadecimals(source):
    """ Capitalize all hexadecimal strings
    
    :param source: The source CSS string
    :return: The CSS string with all hexadecimal values capitalized
    """

    def found(match):
        return match[0].replace(match[1], match[1].lower())

    return re.sub(r'#([\dabcdefABCDEF]{8}|[\dabcdefABCDEF]{6}|[\dabcdefABCDEF]{3})', found, source)