Skip to content

Commit

Permalink
add default arg to header comp to change background colour
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellie-Brakoniecki committed May 29, 2024
1 parent b62cb1e commit b5d956a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion gov_uk_dashboards/components/plotly/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -56,5 +59,6 @@ def header(title: str, strong_class: str = ""):
),
className="govuk-header",
role="banner",
style=header_style,
**{"data-module": "govuk-header"},
)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit b5d956a

Please sign in to comment.