themes.mdx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. <div className="standalone-container">
  19. <Editor
  20. rootStyle={{ height: '350px' }}
  21. style={{ border: '1px solid #ccc' }}
  22. config={{
  23. placeholder: 'Compose an epic...',
  24. theme: 'bubble',
  25. }}
  26. />
  27. </div>
  28. <a className="standalone-link" href="/standalone/bubble/">
  29. Standalone
  30. </a>
  31. ## Snow
  32. Snow is a clean, flat toolbar theme.
  33. <div className="standalone-container">
  34. <Editor
  35. rootStyle={{ height: '350px' }}
  36. config={{
  37. placeholder: 'Compose an epic...',
  38. modules: {
  39. toolbar: [
  40. [{ header: [] }],
  41. ['bold', 'italic', 'underline', 'link'],
  42. [{ color: [] }, { background: [] }],
  43. [{ list: 'ordered' }, { list: 'bullet' }],
  44. ['clean'],
  45. ],
  46. },
  47. theme: 'snow',
  48. }}
  49. />
  50. </div>
  51. <a className="standalone-link" href="/standalone/snow/">
  52. Standalone
  53. </a>
  54. ### Customization
  55. 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.
  56. 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/).