CSS Media Queries

Michael Strauß michaelstrau2 at gmail.com
Mon Dec 2 19:32:14 UTC 2024


> 1. what are the plans / commitments for actually developing the dark mode stylesheet?

I'm thinking a bit bigger than just "Modena Dark". Since JFX 19, we've
added focusVisible, platform preferences, CSS transitions, and now
hopefully media queries. After this is done, I think we should
leverage all of those new features, and create a bold new theme for
JavaFX that feels at home in the year 2025.


> 2. are there plans / necessity of adding more similar properties to the Scene?

Yes, where it makes sense. I think it should also have
persistentScrollBars / prefers-persistent-scrollbars.
After that, we're probably good for a while.


> 3. are there plans to provide a similar proposal for variables, for example to be able to size controls consistently https://bugs.openjdk.org/browse/JDK-8314683 ?

Yes, although this requires a new CSS parser.
Have a look at this proposal, specifically the "Variable substitution"
section: https://gist.github.com/mstr2/f416996caf48e11193f0b6a5883a3926
Variable substitution requires a value resolution algorithm that works
on the level of CSS tokens, not on pre-parsed objects.


> One more tangentially related question: do you think it's possible to be able to determine which selector in which stylesheet was used, for debugging purposes?  For example, be able to enable logging?

Interesting question. I don't have an answer (or a guess) at the
moment, but I'll think about it.


More information about the openjfx-dev mailing list