bruno55
(bruno dd)
March 4, 2014, 7:04pm
1
i use a custom theme based on reindeer , it is not work but when i inspect the html page i fin
d reindeer.style.css instead of my theme why ?
@Theme (“mesphotos”)
public class AppMenuView implements IAppMenuView {
private HorizontalLayout root;
@Override
@PostConstruct
public void initView() {
root = new HorizontalLayout();
root.setSizeFull();
Label title = new Label("MesPhotos");
title.setStyleName("menulogo");
root.addComponent(title);
in Vaadin/theme/mesphotos/mesphotos.scss
@import “…/reindeer/reindeer.scss”;
@mixin mesphotos {
@include reindeer;
// your styles go here
.menulogo {
display: block;
width: 100%;
height: 60px;
text-indent: 300px;
overflow: hidden;
text-decoration: none;
color: white;
position: relative;
}
}
and i see it my war file but not on the generated html file
what i missed
Rgards
Bruno
Marko1
(Marko Grönroos)
March 4, 2014, 10:33pm
2
You can only use the @Theme annotation for a UI class (that extends com.vaadin.ui.UI). In your code you seem to be trying to use it for some view class. A UI can have only one theme and you can’t change it for different views.
To theme different views differently, you can give each view a different style name with addStyleName() and use a selector matching it in the UI theme.
bruno55
(bruno dd)
March 4, 2014, 10:59pm
3
thx Marko
effectively i use views instead of ui. i use a mvp pattern , can i replace easily view by ui on top interface ?
but my beebie question is more on target style generated.
in the header i saw
…
...
MesPhotos
but none reference to my ./VAADIN/themes/mesphotos/styles.css
why ?
bruno55
(bruno dd)
March 4, 2014, 11:03pm
4
i remove the theme annotation and i replace it by
root = new HorizontalLayout();
root.setSizeFull();
root.setStyleName(“mesphotos”);
Label title = new Label("MesPhotos");
title.setStyleName("menulogo");
none difference
bruno55
(bruno dd)
March 4, 2014, 11:12pm
5
gotcha in my mvp i used an ui and move the @theme to it and my mesphotos.css appear in the generated html
thx Marko