diff --git a/components/appbar/appbar.css b/components/appbar/appbar.css index 05c41b5351..60bcb2746b 100644 --- a/components/appbar/appbar.css +++ b/components/appbar/appbar.css @@ -15,7 +15,9 @@ .navbar { color: var(--md-sys-color-on-surface); - height: var(--navbar-height-mobile); + height: var(--navbar-height); + display: flex; + align-items: center; } .navbar ul:not(.dropdown-content) { @@ -53,5 +55,8 @@ .navbar-fixed { position: fixed; + top: 0; + left: 0; + right: 0; z-index: 997; } diff --git a/components/appbar/appbar.mjs b/components/appbar/appbar.mjs index 75feacd8ee..62b3916041 100644 --- a/components/appbar/appbar.mjs +++ b/components/appbar/appbar.mjs @@ -1,51 +1,65 @@ import { Component } from '../atomic/component.mjs'; -// AppBar is the old *Navbar* +// AppBar is the old "Navbar" class AppBar extends Component { - #title = ''; + #title; + #items; + /** + * + * @param {{isFixed: Boolean = false}} options + */ constructor(options) { super(options); - this.setTagName('nav').addClassname('nav navbar'); + this.#title = ''; + this.#items = []; + if (typeof options === 'object' && options.isFixed) { + this.addClassname('navbar-fixed'); + } } + addItem(item) { + this.#items.push(item); + return this; + } + + //////////////////////// unstable api atm + setTitle(title) { this.#title = title; return this; } - setSearch() { return this; } - setLogo() { return this; } - addLeftIcon() { return this; } - addRightIcon() { return this; } + // + toHTML() { - const html = `
`; + /* +