Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmo91 committed Oct 12, 2024
1 parent 6a69d3c commit 9dc70f9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion demo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class SchmancyDemo extends $LitElement() {
<demo-nav> </demo-nav>
</schmancy-nav-drawer-navbar>
<schmancy-nav-drawer-content class="pl-2">
<schmancy-nav-drawer-appbar class="py-2">
<schmancy-nav-drawer-appbar .toggler=${true} class="py-2">
<schmancy-typography>Title</schmancy-typography>
</schmancy-nav-drawer-appbar>
<schmancy-surface type="surface" rounded="left">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mhmo91/schmancy",
"version": "0.0.267",
"version": "0.0.268",
"description": "UI library build with web components",
"main": "./dist/index.js",
"repository": {
Expand Down
8 changes: 5 additions & 3 deletions src/nav-drawer/appbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
TSchmancyDrawerNavbarMode,
} from '@schmancy/nav-drawer/context'
import { css, html } from 'lit'
import { customElement, state } from 'lit/decorators.js'
import { customElement, property, state } from 'lit/decorators.js'
import { when } from 'lit/directives/when.js'
import { SchmancyEvents } from '..'

Expand All @@ -29,6 +29,8 @@ export class SchmancyDrawerAppbar extends TailwindElement(css`
@state()
sidebarOpen

@property({ type: Boolean }) toggler = true

render() {
const appbarClasses = {
'block z-50': true,
Expand All @@ -39,14 +41,14 @@ export class SchmancyDrawerAppbar extends TailwindElement(css`
}
return html`
<schmancy-grid
cols=${this.sidebarMode === 'push' ? '1fr' : 'auto 1fr'}
cols=${this.sidebarMode === 'overlay' && this.toggler ? 'auto 1fr' : '1fr'}
flow="col"
class=${this.classMap(appbarClasses)}
gap="sm"
align="center"
>
${when(
this.sidebarMode === 'overlay',
this.sidebarMode === 'overlay' && this.toggler,
() =>
html`<slot name="toggler">
<div class="${this.classMap(sidebarToggler)}">
Expand Down

0 comments on commit 9dc70f9

Please sign in to comment.