Repository: wagtail/wagtail
File: wagtail/admin/templatetags/wagtailadmin_tags.py (Python)

Code before:
    Retrieves the theme name for the current user.
    """
    user = context["request"].user
    theme_name = (
        user.wagtail_userprofile.theme
        if hasattr(user, "wagtail_userprofile")
        else "system"
    )
    contrast_name = (
        user.wagtail_userprofile.contrast
        if hasattr(user, "wagtail_userprofile")
        else "system"
    )
    density_name = (
        user.wagtail_userprofile.density
        if hasattr(user, "wagtail_userprofile")
        else "default"
    )
    contrast_name = contrast_name.split("_")[0]
    return f"w-theme-{theme_name} w-density-{density_name} w-contrast-{contrast_name}"


@register.simple_tag(takes_context=True)
def admin_theme_color_scheme(context):
    """
    Retrives the color-scheme of the active theme for current user.
    """
    user = context["request"].user
    # print('userdwa',user)
    # user.wagtail_userprofile.theme = "light"
    theme_name = (
        user.wagtail_userprofile.theme
        if hasattr(user, "wagtail_userprofile")
        else "light"
    )

    # print("themename:",theme_name)
    if theme_name == "light":
        return "light dark"

    else:
        return "dark light"


@register.simple_tag
def js_translation_strings():
    warn(
        "The `js_translation_strings` template tag will be removed in a future release.",
        category=RemovedInWagtail70Warning,
    )
    return mark_safe(json.dumps(get_js_translation_strings()))

Review comment (suggestion):
```suggestion
    Retrieves the color-scheme of the active theme for current user.
```

Just a small typo. 

Code after:
    Retrieves the theme name for the current user.
    """
    user = context["request"].user
    theme_name = (
        user.wagtail_userprofile.theme
        if hasattr(user, "wagtail_userprofile")
        else "system"
    )
    contrast_name = (
        user.wagtail_userprofile.contrast
        if hasattr(user, "wagtail_userprofile")
        else "system"
    )
    density_name = (
        user.wagtail_userprofile.density
        if hasattr(user, "wagtail_userprofile")
        else "default"
    )
    contrast_name = contrast_name.split("_")[0]
    return f"w-theme-{theme_name} w-density-{density_name} w-contrast-{contrast_name}"


@register.simple_tag(takes_context=True)
def admin_theme_color_scheme(context):
    """
    Retrieves the color-scheme of the active theme for current user.
    """
    user = context["request"].user
    profile = getattr(user, "wagtail_userprofile", None)
    theme_name = profile.theme if profile else "system"
    if theme_name == "system":
        return "dark light"
    return theme_name


@register.simple_tag
def js_translation_strings():
    warn(
        "The `js_translation_strings` template tag will be removed in a future release.",
        category=RemovedInWagtail70Warning,
    )
    return mark_safe(json.dumps(get_js_translation_strings()))


@register.simple_tag
def notification_static(path):
    """
    Variant of the {% static %}` tag for use in notification emails - tries to form
    a full URL using WAGTAILADMIN_BASE_URL if the static URL isn't already a full URL.
    """
    return urljoin(base_url_setting(), static(path))