diff --git a/Havit.Blazor.Components.Web.Bootstrap.Documentation/Pages/Components/HxSidebarDoc/HxSidebar_Documentation.razor b/Havit.Blazor.Components.Web.Bootstrap.Documentation/Pages/Components/HxSidebarDoc/HxSidebar_Documentation.razor index 8b1ac4b0b..e72885905 100644 --- a/Havit.Blazor.Components.Web.Bootstrap.Documentation/Pages/Components/HxSidebarDoc/HxSidebar_Documentation.razor +++ b/Havit.Blazor.Components.Web.Bootstrap.Documentation/Pages/Components/HxSidebarDoc/HxSidebar_Documentation.razor @@ -70,21 +70,33 @@ Color of the items icons. + + Border radius of the items. + Color of the items on hover. Color of the items icon on hover. - - Border radius of the items. - Background color of the items on hover. Background opacity of the items on hover. + + Color of the active item. + + + Color of the active item icon. + + + Background opacity of the active item. + + + Background opacity of the active item. + Margin of the items. diff --git a/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebar.razor b/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebar.razor index 76b64a326..8e3c51c49 100644 --- a/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebar.razor +++ b/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebar.razor @@ -5,12 +5,12 @@ @if (HeaderTemplate is not null) { -
+
@HeaderTemplate + @if (LogoTemplate != null) { diff --git a/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarBrand.razor.css b/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarBrand.razor.css index f90b94c0b..ceff5e54b 100644 --- a/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarBrand.razor.css +++ b/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarBrand.razor.css @@ -1,4 +1,12 @@ -.hx-sidebar-brand-logo { +.hx-sidebar-brand { + display: flex; + align-items: center; + text-decoration: none; + font-size: .875rem; + flex-grow: 1; +} + +.hx-sidebar-brand-logo { width: var(--hx-sidebar-brand-logo-width); height: var(--hx-sidebar-brand-logo-height); } @@ -15,13 +23,6 @@ justify-content: center; } -a { - display: inline-flex; - align-items: center; - text-decoration: none; - font-size: .875rem; -} - .hx-sidebar-brand-name { font-size: 1.25rem; margin-left: .5rem; diff --git a/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarItem.razor.css b/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarItem.razor.css index cca803def..c3f09d962 100644 --- a/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarItem.razor.css +++ b/Havit.Blazor.Components.Web.Bootstrap/Navigation/HxSidebarItem.razor.css @@ -42,24 +42,31 @@ } ::deep a.nav-link:hover, -::deep a.nav-link.active:hover, -::deep a.nav-link.active, .navbar-desktop-toggler:hover { background-color: rgba(var(--hx-sidebar-item-hover-background-color), var(--hx-sidebar-item-hover-background-opacity)); color: var(--hx-sidebar-item-hover-color); } +::deep a.nav-link.active, +::deep a.nav-link.active:hover { + background-color: rgba(var(--hx-sidebar-item-active-background-color), var(--hx-sidebar-item-active-background-opacity)); + color: var(--hx-sidebar-item-active-color); +} + ::deep i { color: var(--hx-sidebar-item-icon-color); transition: transform .35s ease; transform-origin: .5em 50%; } -::deep a.nav-link:hover i, -::deep a.nav-link.active i { +::deep a.nav-link:hover i { color: var(--hx-sidebar-item-hover-icon-color); } +::deep a.nav-link.active i { + color: var(--hx-sidebar-item-active-icon-color); +} + ::deep .bi-chevron-right { font-size: .75rem; margin-left: .5rem; diff --git a/Havit.Blazor.Components.Web.Bootstrap/wwwroot/defaults.css b/Havit.Blazor.Components.Web.Bootstrap/wwwroot/defaults.css index 73f2226dc..395ae2236 100644 --- a/Havit.Blazor.Components.Web.Bootstrap/wwwroot/defaults.css +++ b/Havit.Blazor.Components.Web.Bootstrap/wwwroot/defaults.css @@ -19,13 +19,17 @@ --hx-sidebar-item-font-size: 1rem; --hx-sidebar-item-padding: .75rem; --hx-sidebar-item-color: var(--bs-body-color); + --hx-sidebar-item-icon-color: var(--bs-primary); + --hx-sidebar-item-border-radius: var(--bs-border-radius-lg); + --hx-sidebar-item-margin: 0 0 .25rem 0; --hx-sidebar-item-hover-color: var(--bs-primary); --hx-sidebar-item-hover-background-color: var(--bs-primary-rgb); --hx-sidebar-item-hover-background-opacity: .05; --hx-sidebar-item-hover-icon-color: var(--bs-primary); - --hx-sidebar-item-icon-color: var(--bs-primary); - --hx-sidebar-item-border-radius: var(--bs-border-radius-lg); - --hx-sidebar-item-margin: 0 0 .25rem 0; + --hx-sidebar-item-active-color: var(--bs-primary); + --hx-sidebar-item-active-background-color: var(--bs-primary-rgb); + --hx-sidebar-item-active-background-opacity: .05; + --hx-sidebar-item-active-icon-color: var(--bs-primary); --hx-sidebar-subitem-font-size: .875rem; --hx-sidebar-subitem-padding: .5rem; --hx-sidebar-subitem-margin: 0 0 .25rem 2rem;