hint

Customize the Wagtail CMS admin theme

Rob Moorman

25 januari 2022

While building a lot of Wagtail platforms we often see the need of branding the admin theme, like displaying the name of client or replacing the logo.

Now Wagtail makes better use of CSS variables it becomes quite easy to change the primary (teal) color of the default Wagtail admin theme. With only this change the Wagtail platform integrates way better in the commonly applied brandguide of your client.

In order to achieve this we need to add a Wagtail hook which inserts some CSS rules:

@hooks.register("insert_global_admin_css")
def insert_global_admin_css():
    return mark_safe(
        '<style type="text/css">:root{--color-primary-hue:%s;--color-primary-saturation:%s%%;--color-primary-lightness:%s%%;}</style>'
        % (340, 100, 47)
    )
Customize the Wagtail CMS admin theme

You can read more information about this customization in the documentation of Wagtail.

Meer updates

Dit is wat we recent hebben gedaan.

A Private PyPI server with AWS CodeArtifact

blog

A Private PyPI server with AWS CodeArtifact

Martijn Jacobs

21 juni 2024

Beautiful asserts with your Django Test Client

blog

Beautiful asserts with your Django Test Client

Martijn Jacobs

27 maart 2023

Add Plausible to your Terraform CloudFront distribution

blog

Add Plausible to your Terraform CloudFront distribution

Rob Moorman

2 december 2022