How to add StyleSheet programmatically?

How to add StyleSheet programmatically without annotation (@CssImport("..."))? I tried UI.getCurrent().getPage().addStyleSheet("C:/..."), but it´s ignored.
Im using Vaadin 14.3.7

Best Jan

One approach is to implement PageConfigurator interface in your main layout and add it there, see example here

https://github.com/TatuLund/devday-demo-flow/blob/master/src/main/java/com/vaadin/devday/demo/MainLayout.java#L232