You may find you want to customise BookStack to use custom branding or you may just not like the default blue theme. Customising the branding of BookStack is super simple and can be done through the settings interface under ‘App Settings’. Here you can change the application name, logo and the core colours used. Changing the app name will simply update the name displayed in the header and browser tab. Changing the logo updates the logo shown in the header. This can be removed if you only want to display the chosen name. Changing the app color will update the color of the header, links and the majority of buttons within the system.
To change fonts you can make use of the ‘Custom HTML head content’ setting to add some CSS to alter fonts used. Copy the code below and alter the font names to your desired fonts. Then paste this into the ‘Custom HTML head content’ box in the admin settings of BookStack.
Here’s an example of using the ‘Lato’ font from Google Web Fonts:
Note that this won’t change anything in the settings screen for stability purposes.
Changing Code Block Themes
When inserting code into a page or when using the Markdown editor, the text you enter is highlighted by a default codemirror colour scheme. If you’d prefer a different colour scheme for code blocks this can be overridden. BookStack uses CodeMirror to render code blocks. You can try out different themes here. Once you’ve chosen a theme note down the name.
In BookStack settings, Find the ‘Custom HTML head content’ setting and add the following code:
In the above example we are setting the theme to
cobalt to the name of your desired theme on both of the above lines.
The first lines adds the required theme styles, Fetched from cdnjs whom generously host all CodeMirror files.
The second line then sets the theme name which will be picked up when code blocks are rendered.
Default Book View
By default the
/books page displays your books as a list. Users can change this option to list or grid view but if you’d like to set the default for public viewers or new users you can add the following to your
View the Hacking BookStack page for more advanced ways to achieve deeper customisation.