diff --git a/gov_uk_dashboards/components/plotly/header.py b/gov_uk_dashboards/components/plotly/header.py index b0b2524..2475c3b 100644 --- a/gov_uk_dashboards/components/plotly/header.py +++ b/gov_uk_dashboards/components/plotly/header.py @@ -3,14 +3,17 @@ from dash import html -def header(title: str, strong_class: str = ""): +def header(title: str, strong_class: str = "", background_colour: str = None): """ The header component, shared across all dashboard views. Includes optional strong_class parameter to provide extra styling in the form of a class. + Includes optional background_colour parameter to override default black background colour. Based on the header component provided by the GOV.UK Design System. https://design-system.service.gov.uk/components/header/ """ + header_style = {"backgroundColor": background_colour} if background_colour else {} + return html.Header( html.Div( html.Div( @@ -56,5 +59,6 @@ def header(title: str, strong_class: str = ""): ), className="govuk-header", role="banner", + style=header_style, **{"data-module": "govuk-header"}, ) diff --git a/setup.py b/setup.py index c53702d..ba5bfbf 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ author="Department for Levelling Up, Housing and Communities", description="Provides access to functionality common to creating a data dashboard.", name="gov_uk_dashboards", - version="9.41.1", + version="9.42.0", long_description=long_description, long_description_content_type="text/markdown", packages=find_packages(),