Legacy Theme in MPR
Per impostazione predefinita, il theme usato con MPR è "valo" e questo può essere cambiato aggiungendo l’annotazione MprTheme con il nome del theme desiderato alla Sua classe di configurazione AppShellConfigurator.
|
Note
| La modifica del theme a runtime non è supportata. |
Source code
Definizione di esempio del theme
@MprTheme("reindeer")
public class Configuration implements AppShellConfigurator {
}
public class MainLayout extends Div implements RouterLayout {
}
@Route(value = "", layout = MainLayout.class)
public class RootTarget extends Div {
public RootTarget() {
LegacyWrapper addressbookWrapper = new LegacyWrapper(
new AddressbookLayout());
add(addressbookWrapper);
}
}Il theme può essere un vecchio legacy styles.css theme oppure un styles.scss theme. Con un theme basato su Sass, la compilazione on-the-fly funziona out of the box senza alcuna modifica.
Uso di Custom Themes
L’uso del Suo Vaadin legacy theme rimane invariato. Crei il Suo theme seguendo le istruzioni nella documentazione dei themes per Vaadin 7 o Vaadin 8.
Quindi aggiunga l’annotazione @MprTheme con il nome del Suo theme sull’istanza AppShellConfigurator e il Suo theme viene usato per la parte legacy framework.
|
Note
|
Legacy Theme Applied Only to View with Legacy Components
Gli styles per i componenti non-legacy non dovrebbero essere inclusi nel legacy theme.
|
38233D6E-8B3F-4DB4-B5EF-DC0E4785FB91