def tab_size(token):
    """Validation for ``tab-size``.

    See https://www.w3.org/TR/css-text-3/#tab-size

    """
    if token.type == 'number' and token.int_value is not None:
        value = token.int_value
        if value >= 0:
            return value
    return get_length(token, negative=False)
Validation for ``tab-size``.

See https://www.w3.org/TR/css-text-3/#tab-size
weasyprint/css/validation/properties.py