mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
995 B
995 B
Themes
Server-side
- There are three themes embedded in the application:
light
, located insrc\public\stylesheets\theme-light.css
dark
, located insrc\public\stylesheets\theme-dark.css
next
, located insrc\public\stylesheets\theme-next.css
.
- The default theme is set only once, when the database is created and is managed by
options_init#initNotSyncedOptions
.- In the original implementation: On Electron, the choice between
light
anddark
is done based on the OS preference. Otherwise, the theme is alwaysdark
. - Now, we always choose
next
as the default theme.
- In the original implementation: On Electron, the choice between
- The theme is served via
src\routes\index.ts
, in thegetThemeCssUrl
method.
Client-side
- The predefined themes are hard-coded in the client in
src\public\app\widgets\type_widgets\options\appearance\theme.js
. - The user-defined themes are obtained via a call to the server:
options/user-themes
. - The theme retrieval is done via a request.