diff --git a/src/Web/AdminPanel/Components/App.razor b/src/Web/AdminPanel/Components/App.razor index 55f285156..885e14167 100644 --- a/src/Web/AdminPanel/Components/App.razor +++ b/src/Web/AdminPanel/Components/App.razor @@ -1,7 +1,16 @@ @using MUnique.OpenMU.Web.AdminPanel.Components.Layout +@using MUnique.OpenMU.Web.Shared.Services + +@code { + [CascadingParameter] + public HttpContext? HttpContext { get; set; } + + private string CurrentTheme => + ThemeController.NormalizeTheme(this.HttpContext?.Request.Cookies[ThemeController.CookieName]); +} - + diff --git a/src/Web/AdminPanel/Components/Layout/ConfigurationSearch.razor.css b/src/Web/AdminPanel/Components/Layout/ConfigurationSearch.razor.css index 4330a2f3e..0f9834f6f 100644 --- a/src/Web/AdminPanel/Components/Layout/ConfigurationSearch.razor.css +++ b/src/Web/AdminPanel/Components/Layout/ConfigurationSearch.razor.css @@ -36,7 +36,7 @@ .configuration-search__result-path { font-size: 0.78rem; - color: #5f6368; + color: var(--omu-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; @@ -45,7 +45,7 @@ .configuration-search__result:hover .configuration-search__result-path, .configuration-search__result:focus .configuration-search__result-path { - color: rgba(0, 0, 0, 0.7); + color: var(--omu-text); } @media (max-width: 640.98px) { diff --git a/src/Web/AdminPanel/Components/Layout/CreationPanel.razor.css b/src/Web/AdminPanel/Components/Layout/CreationPanel.razor.css index 65f4099ac..f1505d24c 100644 --- a/src/Web/AdminPanel/Components/Layout/CreationPanel.razor.css +++ b/src/Web/AdminPanel/Components/Layout/CreationPanel.razor.css @@ -6,8 +6,9 @@ flex-shrink: 0; display: flex; flex-direction: row; - background-color: #fff; - border-left: 1px solid #d6d5d5; + background-color: var(--omu-surface-2); + color: var(--omu-text); + border-left: 1px solid var(--omu-border); box-shadow: -2px 0 5px rgba(0, 0, 0, 0.08); overflow: hidden; z-index: 2; @@ -22,14 +23,14 @@ width: 1.75rem; padding: 0; border: none; - border-right: 1px solid #d6d5d5; - background-color: #f7f7f7; + border-right: 1px solid var(--omu-border); + background-color: var(--omu-surface-muted); cursor: pointer; - color: #333; + color: var(--omu-text); } .collapse-toggle:hover { - background-color: #e9e9e9; + background-color: var(--omu-surface-hover); } .creation-panel-body { diff --git a/src/Web/AdminPanel/Components/Layout/MainLayout.razor b/src/Web/AdminPanel/Components/Layout/MainLayout.razor index 0d915160d..6001649ef 100644 --- a/src/Web/AdminPanel/Components/Layout/MainLayout.razor +++ b/src/Web/AdminPanel/Components/Layout/MainLayout.razor @@ -1,7 +1,18 @@ @using MUnique.OpenMU.Web.AdminPanel.Properties +@using MUnique.OpenMU.Web.Shared.Services @inherits LayoutComponentBase +@code { + [CascadingParameter] + public HttpContext? HttpContext { get; set; } + + private bool IsDarkTheme => string.Equals( + this.HttpContext?.Request.Cookies[ThemeController.CookieName], + "dark", + StringComparison.OrdinalIgnoreCase); +} +
-