Hello,
I need some help for styling the menu bar i want to use the menubar like a header navigation,
but a i cant set the size of the menu bar.
Hello,
I need some help for styling the menu bar i want to use the menubar like a header navigation,
but a i cant set the size of the menu bar.
MenuBar
implements HasSize
, so yes you can set the size of the menu bar, using setWidth()
, setHeight()
, setSizeFull()
, etc.
If you did that and the menu bar items remain like this, have you tried setting the sizes of the individual Components that you add as MenuItems?
When i use setWidth or setHeigt the menu bar dont changes only arroud.
Hi Leo,
You’ll need to do three things:
Call MenuBar::setHeight
.
Create two CSS files: menu-bar.css
and menu-bar-button.css
.
menu-bar.css
[part="container"]
{
height: 100%;
}
menu-bar-button.css
:host {
height: 100%;
}
@CssImport(value = "./styles/components/menu-bar.css", themeFor = "vaadin-menu-bar")
@CssImport(value = "./styles/components/menu-bar-button.css", themeFor = "vaadin-menu-bar-button")