Coloring/theming
TL;DR: set colors and sizing under a top-level theme in the
configuration section. JBrowse's palette
has four customizable colors (primary, secondary, tertiary, quaternary);
add "mode": "dark" inside a palette for dark mode. configuration.preferences
sets the starting value of the settings users can toggle for themselves.
Color
theme takes a MUI palette plus typography and spacing. tertiary and
quaternary are JBrowse extensions to the standard MUI palette, which has only
primary and secondary:
{
"configuration": {
"theme": {
"palette": {
"primary": { "main": "#311b92" },
"secondary": { "main": "#0097a7" },
"tertiary": { "main": "#f57c00" },
"quaternary": { "main": "#d50000" }
},
"typography": { "fontSize": 10 },
"spacing": 2
}
}
}
Extra themes and dark mode
extraThemes entries show up in the Preferences dialog for the user to select.
"mode": "dark" inside any palette switches it to
MUI's dark mode, on the
top-level theme too:
{
"configuration": {
"extraThemes": {
"myTheme": {
"name": "My theme",
"palette": {
"mode": "dark",
"primary": { "main": "#311b92" }
}
}
}
}
}
Logo
logoPath replaces the JBrowse 2 logo in the top right corner with an SVG from
your server:
{
"configuration": {
"logoPath": { "uri": "path/to/my/custom-logo.svg" }
}
}
The logo fills the toolbar height and keeps its aspect ratio up to 150px wide, so a wide, short logo (roughly 3:1) fills the space best.
User preference defaults
configuration.preferences sets the starting value of each setting in the
Preferences dialog. A user's own choice is stored in localStorage and wins
from then on, so these are defaults for your instance, not a lock:
{
"configuration": {
"preferences": {
"numberGrouping": false,
"scrollZoom": true,
"useWorkspaces": true,
"animationMode": "system"
}
}
}
PreferencesConfigSchema lists each slot. A session that names
useWorkspaces itself still wins over the preference.
Advanced
JBrowse themes through
Material-UI, so most
createTheme
options work in the config. Style overrides that need callback functions come
from a plugin instead; the volvox
umd_plugin.js
adds a theme that way, and the
no-build plugin guide shows how to
load one.