However it seems it is always loaded before lumo is loaded so the lumo defaults are overriding my values.
I am loading lumo like in the tutorials: @JsModule(value = “./styles/shared-styles.js”)
shared-styles.js :
…
import ‘@vaadin/vaadin-lumo-styles/all-imports’;
…
The only way I found is to change the LoadMode for the override to lazy
You’ll just need to use a more specific CSS selector than what is defined in Lumo. You could, for example, add a custom CSS class name at the root of the UI and thus any variable overrides that acknowledge that custom class name will be stronger than the default Lumo styles.
I had the same problem, only in my case the .css was in a database/string, so what I did was the following:
I had at the LoginView implement the PageConfigurator and then
@Override
public void configurePage(InitialPageSettings initialPageSettings) {
String cssFromDB = dbGet().getCssForClientWithDomain(domain); //Dummy Code that returns the CSS
initialPageSettings.addInlineWithContents(cssFromDB, WrapMode.STYLESHEET);
}
In my case I have the .css setup as a theme and when the UI is attached I