title: How to set global CSS in JavaFX 9+ application?
body: <p>There're couple of questions alerady on SO, however since JPMS support none of the answers are valid.</p>
  
  <p><strong>method 1:</strong> (<a href="https://stackoverflow.com/questions/46559981/javafx-set-default-css-stylesheet-for-the-whole-application">JavaFX - Set default CSS stylesheet for the whole Application</a>)</p>
  
  <pre><code>Application.setUserAgentStylesheet(Application.STYLESHEET_MODENA);
  StyleManager.getInstance().addUserAgentStylesheet(getClass().getResource("/style.css").toString());
  </code></pre>
  
  <p>Doesn't work because <code>StyleManager</code> became the part of private API and JavaFX doesn't export it.</p>
  
  <p><strong>method 2:</strong> (<a href="https://stackoverflow.com/a/51003008/7421700">https://stackoverflow.com/a/51003008/7421700</a>)</p>
  
  <pre><code>@import "com/sun/javafx/scene/control/skin/modena/modena.css";
  /* rest of CSS code */
  </code></pre>
  
  <p>Doesn't work because <code>modena.css</code> became the part of private API and JavaFX doesn't export it.</p>
  
  <p><strong>method 3:</strong> set CSS to the top parent node (<a href="https://stackoverflow.com/a/28880421/7421700">https://stackoverflow.com/a/28880421/7421700</a>)</p>
  
  <p>Doesn't work because CSS will not be applied to modal windows.</p>