Styling
Keen to mix up your report? You can change the font, background colour and text alignment to match your brand guidelines or personal aesthetics. There are two methods for doing this: via the API, and via the Report Settings page.
This feature is available for Datapane version 0.11.11 or later

Python API

When you create a report, you can override the default styling properties by passing in a ReportFormatting object as follows:
1
dp.Report(
2
...
3
).upload(
4
name="test_report",
5
formatting=dp.ReportFormatting(
6
light_prose=False,
7
accent_color="orange",
8
bg_color="#EEE",
9
text_alignment=dp.TextAlignment.RIGHT,
10
font=dp.FontChoice.MONOSPACE
11
width=dp.ReportWidth.MEDIUM
12
)
13
)
Copied!
There are currently six styling properties supported:
1.Light Prose
Boolean which controls whether the text appears as light (good for dark mode), or dark (default).
2. Accent Colour
Controls the colour of certain UI elements e.g. page titles, selects, DataTable headings. Can be any of the 140 CSS colour names or an RGB hex code.
3. Background Colour
Controls the background colour of the page. Can be any of the 140 CSS colour names or an RGB hex code.
4. Text Alignment
Controls how the text is aligned - can be any of JUSTIFY, LEFT (default), RIGHT, CENTER.
5. Font
Controls the font for the prose text - can be any of DEFAULT, SANS, SERIF, MONOSPACE.
6. Width
Controls the horizontal width of the report - can be any of NARROW, MEDIUM (default), FULL.

Report Settings Page

You can also edit these properties through the Visual Settings section of the Report Settings page.
You'll see a CSS block here, where you can edit the default values. The same options apply as specified for the Python API above.
1
:root {
2
--dp-accent-color: #4E46E5;
3
--dp-bg-color: #FFF;
4
--dp-text-align: justify;
5
--dp-font-family: Inter var, ui-sans-serif, system-ui;
6
}
Copied!
Datapane Teams users have additional functionality for loading in custom fonts and header images into a global styling block that applies to all reports. To learn more, check out the section on Styling and Whitelabelling.
Last modified 14d ago