def parse_declarations(input):
    """Parse declarations in a given rule content."""
    normal_declarations = []
    important_declarations = []
    for declaration in tinycss2.parse_blocks_contents(input):
        # TODO: warn on error
        # if declaration.type == 'error':
        if (declaration.type == 'declaration' and
                not declaration.name.startswith('-')):
            # Serializing perfectly good tokens just to re-parse them later :(
            value = tinycss2.serialize(declaration.value).strip()
            declarations = (
                important_declarations if declaration.important
                else normal_declarations)
            declarations.append((declaration.lower_name, value))
    return normal_declarations, important_declarations
Parse declarations in a given rule content.
weasyprint/svg/css.py