def build_css_tag(url: str, defer: bool) -> str:
    """
    Make ``link`` element from URL and donload-rule.

    :param url: Target URL
    :param defer: Flag to donload defer
    """
    attrs = {
        "href": url,
        "rel": "stylesheet",
    }
    if defer:
        attrs["rel"] = "preload"
        attrs["as"] = "style"
        attrs["onload"] = "this.onload=null;this.rel='stylesheet'"
    attr_text = " ".join(f'{k}="{v}"' for k, v in attrs.items())
    return f"<link {attr_text}>"