Hello everyone!
I have a problem with Vaadin styling.
I have a WidokGlowny(MainView) class:
@HtmlImport(value = "styles/vaadin-textfield.html")
@HtmlImport(value = "styles/vaadin-textarea.html")
@HtmlImport(value = "styles/vaadin-checkbox.html")
@HtmlImport(value = "styles/vaadin-radiobutton.html")
public class WidokGlowny extends FlexLayout implements RouterLayout {
***
}
I’m importing there a few custom styles for vaadin components.
For example this is a preview of what is inside a vaadin-textfield.html:
<dom-module id="my-text-field-styles" theme-for="vaadin-text-field">
<template>
<style>
:host(.wrap-label) [part="label"]
{
white-space: normal;
}
[part="input-field"]
{
background-color: white;
border: 1px var(--lumo-contrast-5pct) solid;
}
:host([disabled]
) [part="input-field"]
{
background-color: var(--lumo-contrast-10pct);
}
</style>
</template>
</dom-module>
I’m not adding any of vaadin input components to WidokGlowny.
Next I have another class:
@ParentLayout(WidokGlowny.class)
@Route(value = "wnioski", layout = WidokGlowny.class)
public class Wnioski extends Div implements RouterLayout, LocaleChangeObserver {
***
}
I’m only adding here vaadin buttons.
And finally I have:
@Route(value = "wnioski/wymiana", layout = Wnioski.class)
public class WymianaKartyPobytu extends Wniosek implements LocaleChangeObserver {
***
}
I’m adding here vaadin input components, text-fields, text-areas, radiobuttons, checkboxes
Everything on page looks like in attachment Bez tytułu.png
And here goes the problem. When I go directly to page [http://domain.com/wnioski/wymiana]
(http://domain.com/wnioski/wymiana) everything looks good. My styles are added after vaadin styles:
But when I go to [http://domain.com/wnioski]
(http://domain.com/wnioski) and then when I click button, which navigates me to [http://domain.com/wnioski/wymiana]
(http://domain.com/wnioski/wymiana), my styles are added before vaadin styles, so nothing looks like I wanted.
Am I doing something wrong?