themes.mdx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. ---
  2. title: Themes
  3. ---
  4. Themes allow you to easily make your editor look good with minimal effort. Quill features two officially supported themes: [Snow](#snow) and [Bubble](#bubble).
  5. ### Usage
  6. ```html
  7. <!-- Add the theme's stylesheet -->
  8. <link rel="stylesheet" href="{{site.cdn}}/quill.bubble.css" />
  9. <script src="{{site.cdn}}/quill.js"></script>
  10. <script>
  11. const quill = new Quill('#editor', {
  12. theme: 'bubble', // Specify theme in configuration
  13. });
  14. </script>
  15. ```
  16. ## Bubble
  17. Bubble is a simple tooltip based theme.
  18. <Sandpack
  19. preferPreview
  20. files={{
  21. 'index.html': `
  22. <link href="{{site.cdn}}/quill.bubble.css" rel="stylesheet" />
  23. <div id="editor" style="margin: 50px 0;">
  24. <p>Hello, <strong>World</strong></p>
  25. </div>
  26. <script src="{{site.cdn}}/quill.js"></script>
  27. <script>
  28. const quill = new Quill('#editor', {
  29. placeholder: 'Compose an epic...',
  30. theme: 'bubble',
  31. });
  32. </script>`
  33. }}
  34. />
  35. <a className="standalone-link" href="/standalone/bubble/">
  36. Standalone
  37. </a>
  38. ## Snow
  39. Snow is a clean, flat toolbar theme.
  40. <Sandpack
  41. preferPreview
  42. files={{
  43. 'index.html': `
  44. <link href="{{site.cdn}}/quill.snow.css" rel="stylesheet" />
  45. <div id="editor">
  46. <p>Hello, <strong>World</strong></p>
  47. </div>
  48. <script src="{{site.cdn}}/quill.js"></script>
  49. <script>
  50. const quill = new Quill('#editor', {
  51. placeholder: 'Compose an epic...',
  52. theme: 'snow',
  53. });
  54. </script>`
  55. }}
  56. />
  57. <a className="standalone-link" href="/standalone/snow/">
  58. Standalone
  59. </a>
  60. ### Customization
  61. 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.
  62. 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](/docs/modules/toolbar/).