Add learner-defined custom themes to the EPUB reader
Summary
Brings the EPUB reader's custom themes feature — originally a GSoC contribution — to merge-readiness on the current codebase. Alongside the six fixed themes, learners can create, edit, and delete their own themes (background, text, and link colors), picked via a color picker and persisted per-device in localStorage.
The feature was functional in the GSoC branch; this branch modernises and hardens it.
| State | Screenshot |
|---|---|
| Add / edit theme modal | ![]() |
| Color picker | ![]() |
| Custom theme applied (My themes list) | ![]() |
| Dark fixed theme — accessible link color | ![]() |
References
Continues the custom-themes work from the GSoC-era epub-custom-themes branch (merge base ~July 2023). No tracking issue was filed for the original work.
Reviewer guidance
How to test: Open any EPUB and open the reader settings (sliders icon). Under Themes, switch the six fixed themes — check link contrast on the dark ones (Black / Grey / Yellow). Under My themes (signed in), add a theme: name it, pick background/text/link colors, save; confirm it applies, appears in the list, and that rename/edit and delete work.
Deliberate convention departure: the six fixed themes are hardcoded hex in EpubConstants.js rather than $themeTokens/$themePalette, so EPUB reading palettes don't shift with Kolibri's app theme. Intentional, but it diverges from the "use theme tokens" guideline and is worth a deliberate decision.
Two maintenance notes:
- The
alwanaccessibility patch inColorPickerModal.vuekeys off the library's internal class/attribute names, so analwanupgrade could silently turn it into a no-op. - The focus-restore calls in
SettingsSideBar.vueuse$refs.<button>.$el.focus(). KButton gained a publicfocus()method in KDS 5.8.0, which internally just callsthis.$el.focus(); we're pinned to 5.7.0, so we focus$eldirectly for now. Switch these to the publicfocus()when KDS is upgraded.
AI usage
Used Claude Code throughout. It reviewed the GSoC-derived branch and, under my direction, modernised and hardened it — converting the components from Options (and mixed) API to Composition API, extracting persistence into the useCustomThemes composable, and adding stable theme ids, accessible link colors, CSS-ellipsis names, an alwan accessibility patch, and the test suite — then drove a headless browser to verify rendering and run axe audits on the new UI. I made the design decisions (theme identity, hardcoded vs token colors, auditing color-picker alternatives before keeping alwan) and critically reviewed and revised its output.
Build Artifacts
| Asset type | Download link |
|---|---|
| PEX file | kolibri-0.19.6.dev1706_ge8bb2eef5.d20260716.pex |
| Windows Installer (EXE) | kolibri-0.19.6.dev1706+ge8bb2eef5.d20260716-windows-setup-unsigned.exe |
| Debian Package | kolibri_0.19.6.dev1706+ge8bb2eef5-0ubuntu1_all.deb |
| Debian Package | kolibri-server_0.19.6~dev1706+ge8bb2eef5.d20260716-0ubuntu1_all.deb |
| Mac Installer (DMG) | kolibri-0.19.6.dev1706+ge8bb2eef5.d20260716.dmg |
| Android Package (APK) | kolibri-0.19.6.dev1706+ge8bb2eef5-debug.apk |
| Raspberry Pi Image | kolibri-pi-image-0.19.6.dev1706+ge8bb2eef5.zip |
| TAR file | kolibri-0.19.6.dev1706+ge8bb2eef5.d20260716.tar.gz |
| WHL file | kolibri-0.19.6.dev1706+ge8bb2eef5.d20260716-py3-none-any.whl |
Smoke test screenshot
Your delta review is inaccurate. Multiple items are resolved, contrary to your assertions.
You're right — I apologize for the error. The June 22 delta review (02:41 UTC) incorrectly listed 11 items as UNADDRESSED that had already been confirmed RESOLVED in the June 14 full-pipeline review (review 4493785041). The delta's finding-tracking logic went back through multiple prior review rounds and miscalculated resolution status, resurrecting issues that were closed. Withdrawing all 11 UNADDRESSED claims from that review.
Really nice to see the learner-defined themes! In addition to what's already been mentioned by Marcella I noticed the following issues:
- In both Safari (26.5.2) and the Mac app the 'Add new theme' and the 'Delete Theme' modal get partially covered by the epub content when the vertical size of the window gets shrunk:
https://github.com/user-attachments/assets/b79ae55e-4098-4154-ba0e-6d7481804f69
- The title of the 'Delete Theme' modal should be changed to 'Delete theme' for consistency
- Both the ✔️ of the selected custom theme (and the theme name in some edge cases) become invisible or hard to see if the custom theme is too dark:
https://github.com/user-attachments/assets/897fa640-ee05-48c2-846b-c4d1d35f43ac
- The 'previous' and 'next' arrows of the epub reader also remain black when I have applied a custom dark theme which makes them invisible:
https://github.com/user-attachments/assets/23ce11d6-60a8-4093-91fa-0f635601c98f
- Improvement suggestion: in the 'Add new theme' modal the button is labeled 'Save' while I would expect it to be called 'Add' or 'Apply theme' because the newly added theme is actually immediately added and applied and not just saved.
🔵 Review posted
Last updated: 2026-07-16 00:56 UTC
Thanks @marcellamaki and @pcenov — all points addressed, absorbed into the existing three commits.
| Fix | Screenshot |
|---|---|
| Colour-pick flash — picker now swaps inside one modal, so no second overlay fades in. | ![]() |
| Active ✔ overflowed the swatch — now centered, with a bold active ring that contrasts the background. | ![]() |
| ✔ lost on dark themes — ✔ and ring now contrast the swatch, whatever the theme's own colours. | ![]() |
| Arrows stayed black on dark themes — colour now from background luminance. | ![]() |
| "Save" on an immediate add — add says "Add", edit keeps "Save". | ![]() |
| "Delete Theme" — now "Delete theme". | ![]() |
Modals clipped by the book on Safari — translateZ lifts the overlay onto its own layer. Needs a Safari QA pass. |
— |
Thanks, @rtibbles the clipped modals issue remains unresolved in both the Mac app and Safari:
https://github.com/user-attachments/assets/de89c4dd-ef21-40d2-9208-62948212c548
The rest of the issues are fixed.








