themesberg / flowbite-angular

Official Angular components built for Flowbite and Tailwind CSS
https://flowbite-angular.com
Other
189 stars 42 forks source link

fix(sidebar): inherit color from itemgroup/menu (it not provided) #57

Closed bence444 closed 1 month ago

bence444 commented 1 month ago

Added optional parameter to the SidebarItemGroupComponent, so it's possibly to create a "simple" sidebar items without dropdowns (e.g. Logout button). Also removed the check it's existence from the verify() function.

Removed the default value of color input, and created a private computed to use in fetchClass().


<flowbite-sidebar isOpen class="min-h-screen">
    <flowbite-sidebar-menu class="w-64" color="green">
      <flowbite-sidebar-item-group
        isOpen
        title="Group 1"
        color="red">
        <flowbite-sidebar-item>Menu 1</flowbite-sidebar-item>
        <flowbite-sidebar-item color="yellow">Menu 2</flowbite-sidebar-item>
      </flowbite-sidebar-item-group>

      <flowbite-sidebar-item-group
        isOpen
        title="Group 2"
        color="blue">
        <flowbite-sidebar-item>Menu 3</flowbite-sidebar-item>
        <flowbite-sidebar-item color="yellow">Menu 4</flowbite-sidebar-item>
      </flowbite-sidebar-item-group>

      <flowbite-sidebar-item-group
        isOpen
        title="Group 3">
        <flowbite-sidebar-item>Menu 5</flowbite-sidebar-item>
        <flowbite-sidebar-item color="yellow">Menu 6</flowbite-sidebar-item>
      </flowbite-sidebar-item-group>

      <flowbite-sidebar-item>Menu 7</flowbite-sidebar-item>
    </flowbite-sidebar-menu>

    <flowbite-sidebar-page-content class="p-4">
      Hello world!
    </flowbite-sidebar-page-content>
</flowbite-sidebar>

In this example the SidebarItems color's will look like this:

vercel[bot] commented 1 month ago

@bence444 is attempting to deploy a commit to the Themesberg Team on Vercel.

A member of the Team first needs to authorize it.

bence444 commented 1 month ago

Just realized that i overcomplicated with the computed.

bence444 commented 1 month ago

Also removed the check it's existence from the verify() function.

That was a mistake, and made it back.