theming.rst 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. .. raw:: html
  2. <div id="banner"><a href="https://github.com/jcbrand/converse.js/blob/master/docs/source/theming.rst">Edit me on GitHub</a></div>
  3. .. _theming:
  4. =======
  5. Theming
  6. =======
  7. Setting up your environment
  8. ===========================
  9. In order to theme converse.js, you first need to set up a :ref:`development` environment.
  10. You'll also want to preview the changes you make in your browser, for which a
  11. webserver will be useful.
  12. To both set up the development environment and also start up a web browser to
  13. serve the files for you, simply run::
  14. make serve
  15. .. note::
  16. To run the "make" commands, you'll need `GNUMake <https://www.gnu.org/software/make>`_
  17. installed on your computer. If you use GNU/Linux or \*BSD, it should be installed or
  18. available via your package manager. For Mac, I think you need to install XCode and in
  19. Windows you can use `Chocolatey <https://chocolatey.org/>`_.
  20. After running ``make serve`` you can open http://localhost:8000 in your webbrowser you'll
  21. see the converse.js website.
  22. However, when developing or changing the theme, you'll want to load all the
  23. unminified JS and CSS resources as separate files. To do this, open http://localhost:8000/dev.html
  24. instead.
  25. Mockups
  26. =======
  27. Converse.js contains some mockups in the ``./mockup`` directory against which you
  28. can preview and tweak your changes.
  29. The ``./mockup/index.html`` file contains the most comprehensive mockup, while
  30. the other files focus on particular UI aspects.
  31. To see it in your browser, simply open: http://localhost:8000/mockup
  32. Modifying the HTML templates of Converse.js
  33. ===========================================
  34. The HTML markup of converse.js is contained in small ``.html`` files in the
  35. ``./src/templates`` directory.
  36. You can modify HTML markup that converse.js generates by modifying these files.
  37. Modifying the CSS
  38. =================
  39. The CSS files are generated from `Sass <http://sass-lang.com>`_ files in the ``./sass`` directory.
  40. To generate the CSS you can run::
  41. make css
  42. Creating dist files
  43. ===================
  44. Once you've themed converse.js, you'll want to create new minified distribution
  45. files of all the JavaScript and CSS.
  46. Please refer to the :doc:`builds` section for information on how this is done.