def expand_gap(tokens, name):
    """Expand the ``gap`` property."""
    if len(tokens) == 1:
        if gap(tokens) is None:
            raise InvalidValues
        yield 'row-gap', tokens
        yield 'column-gap', tokens
    elif len(tokens) == 2:
        column_gap, row_gap = gap(tokens[0:1]), gap(tokens[1:2])
        if None in (column_gap, row_gap):
            raise InvalidValues
        yield 'row-gap', tokens[0:1]
        yield 'column-gap', tokens[1:2]
    else:
        raise InvalidValues
Expand the ``gap`` property.
weasyprint/css/validation/expanders.py