Use Light/Dark system completely from JavaFX#15545
Conversation
Review Summary by QodoMigrate to JavaFX 25 native light/dark theme system
WalkthroughsDescription• Migrate to JavaFX 25 native light/dark theme system • Remove dependency on external FXThemes library • Consolidate dark theme into Base.css using CSS media queries • Add system preference synchronization option to UI Diagramflowchart LR
A["FXThemes Library"] -->|Remove| B["JavaFX 25 Native System"]
C["Dark.css File"] -->|Merge| D["Base.css with Media Queries"]
E["Theme Type Enum"] -->|Refactor| F["SYSTEM/LIGHT/DARK/CUSTOM"]
B -->|Apply| G["ColorScheme API"]
D -->|Support| G
H["Theme Dialog UI"] -->|Add| I["System Preference Checkbox"]
File Changes1. jabgui/src/main/java/module-info.java
|
Code Review by Qodo
|
362c12b to
3a529a1
Compare
3a529a1 to
ef54aa8
Compare
Relates to #15508 |
|
I totally love your changes. Simplifies dependencies and theming system a lot. I think Qodo already mentioned most important issues. |
I see. What I'm wondering is why we have a separate |
|
We need the extra css to be able to style the popup when running jabsrv standalone and not through the gui, that's also why it worked using standalone and not when running along with the gui but if there's a good solution to that I'm fine with removing or making it the "correct" way. |
Ok, so then I can just rewrite |
ef54aa8 to
d7c4aa7
Compare
|
Note: I'm forcepushing until everything is fixed - to keep the diff managable (for me - mostly, as I compare very often the previous CSS with the current one, so I don't miss anything). |
d7c4aa7 to
2422254
Compare
|
CAYW looks good now as well - but I just tested the standalone version for now. Not sure how I can call it from within the JabRef GUI. Otherwise, this should be good. I removed some unused variables as well and left a TODO I want to resolve after (in Base.css). |
Maybe, we should add this as comment into |
|
Regarding the future base for custom theme, there is a related issue #12352 |
Right now, there is unfortunately not really a way to really override modena as theme. There are ongoing improvements by other contributors, so this might be possible at a future version. With the recent CSS split, we are very well prepared for that! EDIT: |
|
btw., i think we probably need a line on usage of split css files in the devdocs, maybe somewhere here https://devdocs.jabref.org/architecture-and-components.html#theming |
Related issues and pull requests
Closes: #15039
Closes: #15560
PR Description
Since JavaFX 25, we can use the new JavaFX Theme system.
JavaFX CSS now offers media queries (just like normal CSS) and on all OS, the header bar (frame) will change to light or dark automatically as well.
Concrete changes:
com.pixelduke:fxthemesas we don't need the functionality anymoreI'm confused about the.search-dialogstyles in Dark.css. This seems to be related to cayw.css, which is a single standalone CSS and not used inside the main application?JabRef
Aufzeichnung.2026-04-13.230021.mp4
Aufzeichnung.2026-04-13.230551.mp4
CAYW
Will now automatically use the OS theme.
What we can do in the Future:
transparentcolor)windowsListenerand the whole Window CSS logic, as normally or sub Windows will derive the main CSS styleSteps to test
Open JabRef, change the OS theme setting or change the theme manually in JabRef.
Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)