On Mon, 22 Jun 2026 16:57:56 GMT, Andy Goryachev <[email protected]> wrote:

> I am not using these features, preferring to build stylesheets 
> programmatically, so please forgive my silly question:
> 
> Should the platform media query be tied to a particular look and feel instead 
> of the hardware platform? While it makes sense in many areas to have things 
> like `PlatformUtil.isMac()` as a general guidance (like popup trigger on the 
> mouse press instead of mouse release, or the use of `command` key vs `ctrl` 
> key), we might have more than one look and feel per platform. Boomer example: 
> Windows 98 vs Windows Vista vs Windows 10 vs Windows 11 might need somewhat 
> different stylesheets, or various desktop environments on Linux.

Good question. I think that themes shouldn't excessively change styles based on 
the platform, because that's a very broad category. On the web, you'll see a 
trend of moving to finer-grained capabilities (for example, 
`prefers-color-scheme` or `pointer: fine`) instead of using the platform as a 
decision proxy. The reason that I'm proposing to add `-fx-platform` is not so 
much that I think themes should be doing _more_ of these tests, especially not 
new themes. This media query is a relatively crude helper that allows us to 
define the old Caspian and Modena themes in CSS without hard-coded optional 
stylesheets.

In an earlier revision of this media query, I've had sub-categories like 
`windows-11`, `linux-gnome`, and so on. If we find out in the future that 
there's an absolutely compelling need to have these sub-categories, we can add 
them. For the moment, I think that just supporting the minimum feature set that 
Caspian and Modena actually use is the safer choice.

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

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

Reply via email to