On Mon, 29 Jun 2026 15:45:41 GMT, Andy Goryachev <[email protected]> wrote:

> I agree with the sentiment, my question was "what happens". It will not 
> evaluate the `@media` block with any of the declared values, correct? Should 
> it be mentioned in the `cssref.html`, or is it self-evident?

Ahh got you, yes, it will match none in this case. Similar as for 
`-fx-supports-conditional-feature`, where they can be media queries that will 
not match (like `web`, if it is not on the classpath).

I think thats why Michael said it should not be excessively used. 
If no platform match, good default values should be used.

Btw., adding to what I wrote above regarding theming the application based on 
the OS and this comment, there is actually one usecase in JavaFX where things 
are different depending of the OS:

https://github.com/openjdk/jfx/blob/edf20b532fa9eeff14c06f9e041c93babf82bbe3/modules/javafx.controls/src/main/java/javafx/scene/control/ButtonBar.java#L475-L487

Which shows how I think `-fx-platform` should be used as well: Have a good 
default and may change the theming inside specialized platform media queries 
when needed.

@mstr2 unrelated to this PR, do you think the code in `ButtonBar` is a 
candidate that we should rather solve with the platform media queries instead?

-------------

PR Comment: https://git.openjdk.org/jfx/pull/2193#issuecomment-4834647136

Reply via email to