[frontend] Set theme-color meta tag to --background-color
This commit is contained in:
parent
1a39b2856a
commit
bd6972a0c3
1 changed files with 12 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
@using Iceshrimp.Frontend.Components
|
||||
@using Iceshrimp.Frontend.Core.Services
|
||||
@using Microsoft.AspNetCore.Components.Authorization
|
||||
@inject IJSRuntime Js;
|
||||
@* ReSharper disable once UnusedMember.Local *@
|
||||
@inject UpdateService UpdateSvc;
|
||||
<ErrorBoundary>
|
||||
|
@ -28,5 +29,16 @@
|
|||
</ErrorContent>
|
||||
</ErrorBoundary>
|
||||
|
||||
<HeadContent>
|
||||
<meta name="theme-color" content="@_backgroundColor"/>
|
||||
</HeadContent>
|
||||
|
||||
@code {
|
||||
private string? _backgroundColor;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
_backgroundColor = ((IJSInProcessRuntime)Js).Invoke<string>("eval",
|
||||
"getComputedStyle(document.documentElement).getPropertyValue('--background-color')");
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue