def defstyle(style=None):
    """
    Create a defs element that wraps a CSS style.

    Args:
        style (string): A CSS string.

    Returns:
        str (unicode in Python 2)
    """
    if style:
        return (u'<defs><style type="text/css"><![CDATA[{}]]></style></defs>'
            .format(style))
    else:
        return u'<defs />'
