Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks Blazor #79

Open
clamchoda opened this issue Nov 30, 2023 · 0 comments
Open

Breaks Blazor #79

clamchoda opened this issue Nov 30, 2023 · 0 comments

Comments

@clamchoda
Copy link

clamchoda commented Nov 30, 2023

This pretty much breaks Blazor on iOS Safari 15.5. Any styles defined by Blazor are removed on first render.

On a blank Blazor Server project add the <style> tag and code tag to MainLayout.razor as seen below. Only after adding the javascript reference to _Layout.cshtml you'll see the background is no longer red on iOS Safari 15.5.

When I inspect the device remotely, I can see the root variables are removed. Sometimes you can see a slight flicker of red before the library kicks in.

@inherits LayoutComponentBase

<PageTitle>MobileContainerPolyfil</PageTitle>


<style type="text/css">
    :root{
        @BackgorundColor
    }

    body{
        background: var(--bg-color);
    }
</style>

<div class="page">
    <div class="sidebar">
        <NavMenu />
    </div>

    <main>
        <div class="top-row px-4">
            <a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
        </div>

        <article class="content px-4">
            @Body
        </article>
    </main>
</div>


@code
{
    public string BackgorundColor { get; set; } = "--bg-color: red";
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant