chanan/BlazorStyled

Look into ways to pre-render styles in SSB

オープン

#3 opened on 2019/07/02

 (14 件のコメント) (1 件のリアクション) (0 人の担当者)C# (19 件のフォーク)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (193 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Right now, SSB works like this:

<p class="@div">If everything is working right, the background of this paragraph tag should be pink.</p>

@code {
    private string div;

    protected override async Task OnAfterRenderAsync()
    {
       div = await Styled.Css("background-color: pink;");
       StateHasChanged();
    }
}

While this works, it will cause a small flicker on the browser side because the plain html will be rendered first then "enhanced" with the css.

Is there a way the all the styles can be "pre-rendered" and set down with the html?

コントリビューターガイド