For the complete documentation index, see llms.txt. This page is also available as Markdown.

Changing themes & colors using JavaScript

You can change the color theme by either using an API or providing a path to a custom CSS file in the constructor.

Setting WebViewer constructor CSS option

The CSS option allows you to set a css file path while instantiating WebViewer. It's great if you have an external stylesheet file, for example.

Example

Using setTheme API

The API allows you to change the theme to another pre-defined theme on the fly. See setTheme for details.

Override CSS variables

Another option is to override CSS color variables. Just like changing the theme, this can be done on the fly (without re-instantiating WebViewer).

Example

You can find the default css variables for both light theme and dark theme in the github repository.

Other properties

See the customizing styles for more information about customizing other properties.

Last updated

Was this helpful?