reference_themes_for_users.adoc 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. [#themes]
  2. = Themes (for users)
  3. You can look for themes on the link:http://www.olivetin.app/themes/[OliveTin Theme Site].
  4. == Installing a theme
  5. There are 3 ways to install a theme;
  6. If running inside a Docker container:
  7. 1. Use the `olivetin-get-theme` command to easily Git clone the theme into your `custom-webui/themes/` directory.
  8. If running without using containers:
  9. 1. Download the theme .zip and copy it across to your `custom-webui/themes/` directory.
  10. 2. Git Clone the theme into your `custom-webui/themes/` directory.
  11. [#get-theme]
  12. == How to use the `olivetin-get-theme` command
  13. The default OliveTin configuration comes with an action to get new OliveTin themes. If you deleted it from your configuration, you can add it back in by adding the following to your `config.yaml` file;
  14. [source,yaml]
  15. ----
  16. actions:
  17. - title: Get OliveTin Theme
  18. exec:
  19. - olivetin-get-theme
  20. - "{{ themeGitRepo }}"
  21. - "{{ themeFolderName }}"
  22. icon: theme
  23. arguments:
  24. - name: themeGitRepo
  25. title: Theme's Git Repository
  26. description: Find new themes at https://olivetin.app/themes
  27. type: url
  28. - name: themeFolderName
  29. title: Theme's Folder Name
  30. type: ascii_identifier
  31. ----
  32. When you are browsing the OliveTin Theme Site, you can click on a theme and see it's Git Repository URL. You can then copy this URL and paste it into the `olivetin-get-theme` command.
  33. == Where do I find my themes directory?
  34. When OliveTin starts up, it will try to create a directory called `custom-webui/themes/` in your config directory. This directory is where you can put your own custom themes.
  35. OliveTin will then serve this theme directory at `http://yourserver:1337/custom-webui/themes/`, this means that all theme content should go into `/custom-webui/themes/mytheme/`.
  36. Install Themes into your `custom-webui/themes/` directory, which should be in your config directory. If this directory does not exist, you can create it.
  37. [source,yaml]
  38. ----
  39. ├── config.yaml
  40. ├── custom-webui
  41. │ └── themes
  42. │ └── custom-icons
  43. │ ├── icon.png
  44. │ └── theme.css
  45. ├── entities
  46. │ ├── containers.json
  47. │ ├── heating.yaml
  48. │ ├── servers2.yml
  49. │ ├── servers.yaml
  50. │ └── systemd_units.json
  51. └── installation-id.txt
  52. ----
  53. == Create your own theme (without any intention of publishing it)
  54. Create a sub-directory under your theme directory (eg `custom-webui/themes/mytheme`);
  55. Set your theme in your config
  56. [source,yaml]
  57. .`config.yaml`
  58. ----
  59. themeName: mytheme
  60. ----
  61. Add your css into `custom-webui/themes/mytheme/theme.css`.
  62. Your theme css will be loaded "on top" of the existing stylesheet.
  63. To test it is working, set your theme CSS to something ridiculous like;
  64. ----
  65. body {
  66. background-color: red !important;
  67. }
  68. ----
  69. Profit.
  70. Check out xref:reference/reference_themes_for_developers.adoc[Themes for Developers] for more information on how to develop themes.