You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/customization.md
+40-10Lines changed: 40 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,30 +15,60 @@ Secure settings such as database credentials, API keys, email settings etc. can
15
15
16
16
## Styles
17
17
18
-
TeSS' UI is built on [Bootstrap 3](https://getbootstrap.com/docs/3.4/). To customize the appearance of TeSS, go into
19
-
the themes folder (`app/assets/stylesheets/themes`) and make a copy of the default theme file (`default.scss`).
20
-
In your copy, you can tweak any of the existing variables, add overrides for any Bootstrap variables
21
-
([reference](https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/bootstrap/_variables.scss)) and add new CSS/Sass styles (look at the other themes in that directory, and the `mixins/_modern_base.scss` mixin for reference).
18
+
TeSS' UI is built on [Bootstrap 3](https://getbootstrap.com/docs/3.4/).
19
+
To customize the appearance of TeSS, you can either select one of the pre-made themes, or create your own.
22
20
23
-
To use your theme as the site default, edit your `config/tess.yml` config file and change
24
-
(or add if not present) the `default_theme` variable under the `site` section to reference your new theme file (sans the `.scss` extension):
21
+
### Switching theme
22
+
23
+
To change the site default theme, edit your `config/tess.yml` config file and change (or add if not present)
24
+
the `default_theme` variable under the `site` section to reference one of the configured themes
25
+
(listed under the `themes` section in `config/tess.yml` or `config/tess.example.yml`):
25
26
26
27
```yml
27
28
default: &default
28
29
# ...
29
30
site:
30
31
# ...
31
-
default_theme: my_theme
32
+
default_theme: green
33
+
```
34
+
35
+
### Creating your own theme
36
+
37
+
1. Go into the themes folder (`app/assets/stylesheets/themes`) and make a copy of the default theme file (`default.scss`).
38
+
39
+
2. Add your theme to the list of themes in `config/tess.yml` (see `config/tess.example.yml` for reference).
40
+
The `primary` and `secondary` properties are colours that will be used in the various SVG icons in TeSS.
41
+
```yml
42
+
default: &default
43
+
# ...
44
+
themes:
45
+
default:
46
+
primary: '#047eaa' # Blue by default
47
+
secondary: '#f47d21' # Orange by default
48
+
# ...
49
+
my_theme:
50
+
primary: '#ff0000'
51
+
secondary: '#ffff00'
32
52
```
33
53
34
-
Additionally, you will need to create a symlink for the theme's images:
54
+
3. Enable your theme as the default them according to the section above.
*Alternatively, if you would like to make changes to the SVG images (beyond the colour changes that are automatically applied),
63
+
you may want to copy the images instead of making a symlink.*
64
+
65
+
In your theme's .scss file you can tweak any of the existing variables, add overrides for any Bootstrap variables ([reference](https://github.com/twbs/bootstrap-sass/blob/master/assets/stylesheets/bootstrap/_variables.scss))
66
+
and add new CSS/Sass styles (look at the other themes in that directory, and the `mixins/_modern_base.scss` mixin for reference).
37
67
38
68
Be sure to recompile assets (`bundle exec rake assets:recompile`), or rebuild your docker image,
39
-
and restart the application to apply the new styles.
69
+
and restart the application to apply the new styles (except in development mode, where CSS changes should be applied automatically).
40
70
41
-
You can visit <http://localhost:3000/theme_showcase> on your local instance to see various Bootstrap elements with the
71
+
You can visit <http://localhost:3000/theme_showcase> on your local instance to see various UI elements with the
42
72
current theme applied.
43
73
44
74
You can also add a query parameter `theme_preview` to the URL of any page to preview different themes, e.g. <http://localhost:3000/theme_showcase?theme_preview=blue>
0 commit comments