Button close = new Button(VaadinIcon.CLOSE.create(), e -> close());
close.addClassNames(Margin.Vertical.NONE, Display.FLEX, Display.Breakpoint.Small.HIDDEN);
This is to hide it in small screens but instead it is showing up in smaller screen but hiding in large. This is what I see in DEV tools
The breakpoint-utilities like Display.Breakpoint.Small each define a minimum viewport widthabove which the style is applied. In the case of Small, the breakpoint is defined as min-width:640px, i.e. it applies when the viewport is 640px or bigger, which is still quite small, but it won’t apply below 640px.
So I think what you need to do is set it to Hidden by default, and then back to visible on Small or Medium or wherever you want it to start showing:
I’m not sure if it’s “correct” that those breakpoints only define a min-width rather than a min/max range, and that the smallest one (that we currently have) doesn’t have its min-width at 0, as I’m not really a big user (or fan) of utility classes in general…