def pad(tokens, base_url):
    """``pad`` descriptor validation."""
    if len(tokens) == 2:
        values = [None, None]
        for token in tokens:
            if token.type == 'number':
                if token.is_integer and token.value >= 0 and values[0] is None:
                    values[0] = token.int_value
            elif token.type in ('string', 'ident'):
                values[1] = ('string', token.value)
            url = get_url(token, base_url)
            if url is not None and url[0] == 'url':
                values[1] = ('url', url[1])

        if None not in values:
            return tuple(values)
``pad`` descriptor validation.
weasyprint/css/validation/descriptors.py