> This means that `setStyle` wins over `getStyleSheets().add`, which wins over a property set by the developer which wins over the default FX Stylesheet.
And binding a property wins even more. On Sun, Dec 17, 2023, 16:49 John Hendrikx <john.hendr...@gmail.com> wrote: > > On 16/12/2023 23:02, Mark Raynsford wrote: > > On Sat, 2023-12-16 at 12:10 -0800, John Neffenger wrote: > >> I would prefer not to have the tyranny of the project default > >> replaced > >> with a new tyranny of the app default. :-) > >> > >> Wouldn't it be nice to allow developers and end users to enable > >> hinting > >> for any JavaFX application just by defining a system property? > > That is a good point. I had forgotten that most applications don't > > allow the user to specify their own CSS. > > > > What's the expected precedence? I assume it's: > > > > * If the CSS specifies a setting, and the corresponding property isn't > > set, the CSS wins. > > * If the property specifies a setting, and the CSS isn't set, the > > property wins. > > * If the CSS specifies a setting, and the corresponding property > > specifies a setting, the property wins. > > It should be INLINE > AUTHOR > USER > USER_AGENT (see StyleOrigin) > > This means that `setStyle` wins over `getStyleSheets().add`, which wins > over a property set by the developer which wins over the default FX > Stylesheet. > > However, there is a bug there. If you set a property at any time, it > will override the value. If however an Author Stylesheet CSS is applied > afterwards, it will override the property again. It effectively makes > AUTHOR and USER the same level, last one wins... > > --John > >