Back to Quill

Themes

packages/website/content/docs/customization/themes.mdx

2.0.32.0 KB
Original Source

Themes allow you to easily make your editor look good with minimal effort. Quill features two officially supported themes: Snow and Bubble.

Usage

html
<!-- Add the theme's stylesheet -->
<link rel="stylesheet" href="{{site.cdn}}/quill.bubble.css" />

<script src="{{site.cdn}}/quill.js"></script>
<script>
  const quill = new Quill('#editor', {
    theme: 'bubble', // Specify theme in configuration
  });
</script>

Bubble

Bubble is a simple tooltip based theme.

<Sandpack preferPreview files={{ 'index.html': `

<link href="{{site.cdn}}/quill.bubble.css" rel="stylesheet" /> <div id="editor" style="margin: 50px 0;"> <p>Hello, <strong>World</strong></p> </div> <script src="{{site.cdn}}/quill.js"></script> <script> const quill = new Quill('#editor', { placeholder: 'Compose an epic...', theme: 'bubble', }); </script>`

}} /> <a className="standalone-link" href="/standalone/bubble/"> Standalone </a>

Snow

Snow is a clean, flat toolbar theme.

<Sandpack preferPreview files={{ 'index.html': `

<link href="{{site.cdn}}/quill.snow.css" rel="stylesheet" /> <div id="editor"> <p>Hello, <strong>World</strong></p> </div> <script src="{{site.cdn}}/quill.js"></script> <script> const quill = new Quill('#editor', { placeholder: 'Compose an epic...', theme: 'snow', }); </script>`

}} /> <a className="standalone-link" href="/standalone/snow/"> Standalone </a>

Customization

Themes primarily control the visual look of Quill through its CSS stylesheet, and many changes can easily be made by overriding these rules. This is easiest to do, as with any other web application, by simply using your browser developer console to inspect the elements to view the rules affecting them.

Many other customizations can be done through the respective modules. For example, the toolbar is perhaps the most visible user interface, but much of the customization is done through the Toolbar module.