Skip to content

Commit

Permalink
sidebar 100% fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
phasephasephase committed Jan 1, 2024
1 parent 73835e4 commit 3f1f11e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions JiayiLauncher/Shared/Sidebar.razor
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@

protected override void OnInitialized()
{
UpdateCurrentTab();
NavigationManager.LocationChanged += (_, _) => UpdateCurrentTab();
}

Expand All @@ -80,6 +81,11 @@
private void UpdateCurrentTab()
{
_currentTab = NavigationManager.ToBaseRelativePath(NavigationManager.Uri).Split('/').First();

if (_currentTab == string.Empty) // dashboard
{
_currentTab = "Dashboard";
}

foreach (var tab in _tabs)
{
Expand Down
3 changes: 1 addition & 2 deletions JiayiLauncher/Shared/Sidebar.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@
}

.sticky:hover {
/* TODO: un-hardcode this */
background-color: rgba(255, 0, 0, 0.2);
background-color: color-mix(in srgb, var(--accent) 20%, var(--background-secondary));
}

/* styles when sidebar[data-sticky] is "yes" */
Expand Down

0 comments on commit 3f1f11e

Please sign in to comment.