question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Look into ways to pre-render styles in SSB

See original GitHub issue

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?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
chanancommented, Jun 16, 2020

I will take a look, thanks for the links!

Also, I forgot to mention, be sure to run development: false in production.

1reaction
esso23commented, Jun 16, 2020

OK thanks, I’ll try that. Also, I’m not sure if you’re aware, but there’s this issue in Blazor repo https://github.com/dotnet/aspnetcore/issues/10170 and this tag https://github.com/dotnet/aspnetcore/labels/feature-blazor-css-isolation They plan to release it in preview7 of Blazor. Should be worth monitoring.

Also not sure if helpful but you can look into Skclusive’s library and how he handles styles there. https://github.com/skclusive/Skclusive.Core.Component/blob/master/src/Component/Styled.cs https://github.com/skclusive/Skclusive.Material.Component

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Secrets Behind Smash Bros. Renders - YouTube
64 CSS Origins ... Check my videos going into the history of characters and their evolution! ... Funny Super Smash Bros trivia and...
Read more >
Render Request Stream (Get your Own Smash ... - YouTube
#2: One request at a time, and no multiple render requests in a row unless the turn-out is low #3: Be civil and...
Read more >
HOW TO CHANGE CHARACTER'S COLORS IN Super Smash ...
In this video I'm gonna show you how you can change the appearance of your characters in Super Smash Bros ultimate by changing...
Read more >
Super Smash Bros. Characters Archetypes Explained - YouTube
In this video, I discuss some of the common archetypes that smash characters fall into and how to most effetely use them in...
Read more >
How to Create YOUR Playstyle in Smash Ultimate! - YouTube
Struggling with finding a main or playstyle to adapt? Here I give a step by step guide on how to determine if a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found