def css_shorthand(*values):
    """css 4-edge shorthand"""
    n = len(values)
    if n <= 1:
        top, right, bottom, left = (list(values) or [0]) * 4
    elif n == 2:
        top = bottom = values[0]
        right = left = values[1]
    elif n == 3:
        top, right, bottom = values
        left = right
    elif n:
        top, right, bottom, left = values
    else:
        raise ValueError('too many values for margins')
    return top, right, bottom, left
