Fully custom theme vs overriding Modena

John Hendrikx hjohn at xs4all.nl
Wed Mar 31 21:54:37 UTC 2021


I've found that building controls in such a way to limit the 
addition/removal of child Nodes as much as possible (for example by 
making them invisible/unmanaged instead of adding/removing) has a huge 
impact on performance.

If you are seeing a lot of CSS churn, this could be one of the causes.

--John

On 31/03/2021 13:29, Ed Kennard wrote:
> Hi all,
>
> I’m about to embark on some work which will remove our dependency on the Modena theme.  We currently import Modena then override it wherever necessary, but now I want to replace that with our own custom CSS built from the ground up.  The new custom CSS will be simpler and flatter than Modena, using a lot less insets, borders etc on the controls, and will only target the specific controls we need styling for in the app, so the expectation is to have a significantly smaller amount of CSS loading into JavaFX than we currently have.
>
> My questions for the list are:
>
> - Given the CSS styling of controls will be simpler than Modena, and there'll be a reduced amount of CSS that JavaFX will need to load as well as process throughout the app while it's running, I'm expecting to see less CSS churn while profiling the app, and perhaps even some visibly noticeable performance improvements, too.  Is this a reasonable expectation, or is that unlikely in reality?
>
> - To anyone who has experience implementing custom themes, do you have any wisdom to impart, or links to any such advice, to help me prepare for this, design my CSS in the most JavaFX-optimal way possible, or avoid any common mistakes?
>
> Thanks!
>
> Ed
>
>


More information about the openjfx-dev mailing list