CSS Media Queries

Andy Goryachev andy.goryachev at oracle.com
Mon Dec 2 22:27:56 UTC 2024


Thank you for clarifications!

As Kevin already mentioned, developing a new stylesheet would be a monumental task.  It might be easier to adjust the modena.css, since it's already pretty good (in my opinion).

I wish there was a simpler way to introduce variables - I think the variables might be a better solution from the stylesheet maintainability point of view, and to help with supporting light/dark, compact/roomy variants and simple things like updating the base font size.  Doing a different CSS parser is definitely a much larger project than we can afford, probably.  On the other hand, if it enables programmatic creation of style sheets...

-andy






From: openjfx-dev <openjfx-dev-retn at openjdk.org> on behalf of Michael Strauß <michaelstrau2 at gmail.com>
Date: Monday, December 2, 2024 at 11:32
To:
Cc: openjfx-dev <openjfx-dev at openjdk.org>
Subject: Re: CSS Media Queries
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20241202/60827bc3/attachment-0001.htm>


More information about the openjfx-dev mailing list