Skip to content

Commit 392de5a

Browse files
authored
Merge pull request element-hq#11444 from vector-im/dbkr/doc_custom_themes
Add doc for custom themes
2 parents 1b0b3e1 + 9ed4a07 commit 392de5a

1 file changed

Lines changed: 60 additions & 5 deletions

File tree

‎docs/theming.md‎

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,70 @@ As of Jan 2017, skins are not fully supported; riot is the only available skin.
1111
To define a theme for Riot:
1212

1313
1. Pick a name, e.g. `teal`. at time of writing we have `light` and `dark`.
14-
2. Fork `src/skins/vector/css/themes/dark.scss` to be teal.scss
15-
3. Fork `src/skins/vector/css/themes/_base.scss` to be _teal.scss
16-
4. Override variables in _teal.scss as desired. You may wish to delete ones
17-
which don't differ from _base.scss, to make it clear which are being
18-
overridden. If every single colour is being changed (as per _dark.scss)
14+
2. Fork `src/skins/vector/css/themes/dark.scss` to be `teal.scss`
15+
3. Fork `src/skins/vector/css/themes/_base.scss` to be `_teal.scss`
16+
4. Override variables in `_teal.scss` as desired. You may wish to delete ones
17+
which don't differ from `_base.scss`, to make it clear which are being
18+
overridden. If every single colour is being changed (as per `_dark.scss`)
1919
then you might as well keep them all.
2020
5. Add the theme to the list of entrypoints in webpack.config.js
2121
6. Add the theme to the list of themes in matrix-react-sdk's UserSettings.js
2222
7. Sit back and admire your handywork.
2323

2424
In future, the assets for a theme will probably be gathered together into a
2525
single directory tree.
26+
27+
Custom Themes
28+
=============
29+
30+
Themes derived from the built in themes may also be defined in settings.
31+
32+
To avoid name collisions, the internal name of a theme is
33+
`custom-${theme.name}`. So if you want to set the custom theme below as the
34+
default theme, you would use `default_theme: "custom-Electric Blue"`.
35+
36+
eg. in config.json:
37+
38+
```
39+
"settingDefaults": {
40+
"custom_themes": [
41+
{
42+
"name": "Electric Blue",
43+
"is_dark": false,
44+
"colors": {
45+
"accent-color": "#3596fc",
46+
"primary-color": "#368bd6",
47+
"warning-color": "#ff4b55",
48+
"sidebar-color": "#27303a",
49+
"roomlist-background-color": "#f3f8fd",
50+
"roomlist-text-color": "#2e2f32",
51+
"roomlist-text-secondary-color": "#61708b",
52+
"roomlist-highlights-color": "#ffffff",
53+
"roomlist-separator-color": "#e3e8f0",
54+
"timeline-background-color": "#ffffff",
55+
"timeline-text-color": "#2e2f32",
56+
"timeline-text-secondary-color": "#61708b",
57+
"timeline-highlights-color": "#f3f8fd"
58+
}
59+
}, {
60+
"name": "Deep Purple",
61+
"is_dark": true,
62+
"colors": {
63+
"accent-color": "#6503b3",
64+
"primary-color": "#368bd6",
65+
"warning-color": "#b30356",
66+
"sidebar-color": "#15171B",
67+
"roomlist-background-color": "#22262E",
68+
"roomlist-text-color": "#A1B2D1",
69+
"roomlist-text-secondary-color": "#EDF3FF",
70+
"roomlist-highlights-color": "#343A46",
71+
"roomlist-separator-color": "#a1b2d1",
72+
"timeline-background-color": "#181b21",
73+
"timeline-text-color": "#EDF3FF",
74+
"timeline-text-secondary-color": "#A1B2D1",
75+
"timeline-highlights-color": "#22262E"
76+
}
77+
}
78+
]
79+
}
80+
```

0 commit comments

Comments
 (0)