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: CONTRIBUTING.md
+58-8Lines changed: 58 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,15 +24,54 @@ This is required for building frontend assets, running the dev server, and type
24
24
25
25
## Create and Edit Themes
26
26
27
-
Themes are stored at `src/frontend/css/themes/`. If you want to create a new theme, simply add it to a subfolder. You can also edit existing themes.
27
+
Themes are stored at `src/frontend/css/themes/`. Each theme is a folder containing CSS overrides and optional assets.
28
28
29
-
To build themes, run:
29
+
### Creating a New Theme
30
30
31
-
```bash
32
-
npm run build:themes
33
-
```
31
+
1. Create a new folder in `src/frontend/css/themes/` with your theme name (use underscores for spaces, e.g., `My_Theme`)
32
+
33
+
2. Create a `theme.json` file with metadata:
34
+
35
+
```json
36
+
{
37
+
"name": "My Theme",
38
+
"description": "A brief description of what this theme changes.",
39
+
"mode": "light",
40
+
"highlighting": "Description of word highlighting style",
41
+
"wordBreaking": "Standard"
42
+
}
43
+
```
44
+
45
+
| Field | Description |
46
+
|-------|-------------|
47
+
|`name`| Display name shown in settings |
48
+
|`description`| Explains what the theme changes |
49
+
|`mode`|`"light"` or `"dark"`|
50
+
|`highlighting`| How words are highlighted (e.g., "Background color", "Underline") |
51
+
|`wordBreaking`| Word wrapping behavior (e.g., "Standard", "Modified") |
52
+
53
+
3. Create a `styles.css` file with your CSS overrides. Key classes to customize:
54
+
55
+
```css
56
+
/* Status colors for word learning stages */
57
+
.status0 { /* Unknown words */ }
58
+
.status1 { /* Learning stage 1 */ }
59
+
.status2 { /* Learning stage 2 */ }
60
+
.status3 { /* Learning stage 3 */ }
61
+
.status4 { /* Learning stage 4 */ }
62
+
.status5 { /* Learned */ }
63
+
.status98 { /* Ignored */ }
64
+
.status99 { /* Well-known */ }
65
+
66
+
/* General styling */
67
+
body { background-color: #fff; color: #000; }
68
+
```
69
+
70
+
4. Build your theme:
34
71
35
-
This minifies CSS files and copies assets to `assets/themes/`.
72
+
```bash
73
+
npm run build:themes
74
+
```
36
75
37
76
### Add Images to your Themes
38
77
@@ -41,9 +80,20 @@ You can include images in your theme:
41
80
* Use images from `assets/css/images/` with path `../../../assets/css/images/theimage.png`
42
81
* Add your own files to your theme folder and reference with `./myimage.png`
43
82
44
-
### My theme does not contain all the Skinning Files
83
+
### Theme Fallback System
84
+
85
+
When LWT looks for a file in `assets/themes/{{Theme}}/`, it checks if the file exists. If not, it falls back to `assets/css/`. This means your themes **only need to override files you want to change** - you don't need to copy all files from `src/frontend/css/base/`.
86
+
87
+
### Existing Themes
45
88
46
-
That's not a problem at all. When LWT looks for a file that should be contained in `assets/themes/{{The Theme}}/`, it checks if the file exists. If not, it falls back to `assets/css/` and tries to get the same file. With this system, your themes **do not need to have all the same files as `src/frontend/css/base/`**.
89
+
| Theme | Mode | Description |
90
+
|-------|------|-------------|
91
+
| Default | Light | Standard theme with background color highlighting |
92
+
| Default_Mod | Light | Modified word breaking rules |
0 commit comments