Customising themes

Color themes

Hybiscus uses named color variables to set the colors across all the components in a report. To customize the color theme, you can override the theme color variables using the config.override_color_theme key. You can now customise the variables for any theme, not just the default theme.

These variables can also be referenced by various components, to customise their appearance. A centralised list of color theme variables ensures consistency across your report, making the reports look more professional and aesthetically pleasing.

Customising the color theme is only supported with a paid plan. See here for more details.

The list of color theme variables are listed below. You can see examples of them here.

VariableDescription
headlineUsed for main headings i.e. Heading One
sub-headlineUsed for subtitles / sub-headings i.e. Heading Two
accentUsed sparingly in components as an accent color
paragraphColor used for paragraph text
background-defaultThe reference theme variable for white.
background-mutedThe background color of some components e.g. Card
background-subtleA slightly darker version of the background-muted color. e.g. used in Table.
highlighte.g. background color for Card component when highlighted is set to true.
highlight-texte.g. text color for Card component when highlighted is set to true.

An example of customising these color variables is shown below. You can use hex values, or named CSS colors e.g. yellowgreen.

{
    "type": "Report",
    "options": {
        "report_title": "Report title"
    },
    "config": {
        "color_theme": "purples",
        "override_color_theme": {
            "accent": "#FB76E8",
            "background-muted": "#ECECEC",
        }
    },
    ...,
}

You can also define 3 custom color theme variables, which can be referenced throughout in the options of different components of your report JSON.

VariableDescription
custom-1Custom color theme variable.
custom-2Custom color theme variable.
custom-3Custom color theme variable.

Color variables inside highlighted components

If the Section component has higlighted set to true, the color variables used by the component and it's children are assigned different values, which can be defined inside the highlighted key.

This applies for not only the Section component itself, but also it's children, such as the Card component.

{
    "type": "Report",
    "options": {
        "report_title": "Report title"
    },
    "config": {
        "color_theme": "default",
        "override_color_theme": {
            "accent": "#FB76E8",
            "background-muted": "#ECECEC",
            "highlighted": {
                "background-default": "green",
                "highlight": "yellow",
                "highlight-text": "black"
            }
        }
    },
    ...,
}

In the above example, we're overriding highlighted.background-default which means the background of the Section will be green, whilst any Card component inside the section with highlighted set to true, will have a yellow background.

Missing something?

Hybiscus is continuously improving and adding new features. If you think we are missing a critical feature, please do not hesitate to contact us and offer your feedback at info@hybiscus.dev