CSSLayout.getCSS eats my width

I’m overriding the getCSS but for some strange reason, I can’t define the width of the component there. If I return “background:red”, it works. If I return “width:50%”, the result is an empty style element! I’m on 8.1.6.

Thankful for pointers,

Ah, is this the “Also note that client side framework in Vaadin modifies inline style properties width and height. This happens on each update to component. If one wants to set component sizes with CSS, component must have undefined size on server side (which is not the default for all components) and the size must be defined with class styles - not by directly injecting width and height.”?

It’s a bit sneaky since the stuff would render to my needs (tried by editing the DOM attribute) if it would just leave the style attribute alone :-/

Exactly, and also note, that custom components can have what ever logic of their own.