GoogleChromeLabs / GoogleChromeLabs/container-query-polyfill

Breaks Blazor

Open
#79 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.1k
Forks
48
PR merge metrics
No merged PRs in 30d

Description

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 **** 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);
}




@Body


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

```

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in MainLayout.razor with the shown style and code tags, then add the library reference in _Layout.cshtml and inspect the result on iOS Safari 15.5. Trace why the root variables disappear on first render and verify that the styles remain applied without a visible flicker.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.