Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

MudBlazor custom css

$
0
0

Why is css not working in MudBlazor?

When I create a server side rendering MudBlazor app from scratch using the Visual Studio MudBlazor project template and I add some custom css styles they wont apply.

The only way to get custom css working is to add them to style attribute.

Is there any way to get this working anyway? Because its getting to its limit if you want to add some more complex css with animations...

CODE

App.razor

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><base href="/" /><link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" /><link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" /><link rel="stylesheet" href="MudBlazorCssTest.styles.css" /><HeadOutlet @rendermode="@InteractiveServer" /></head><body><Routes @rendermode="@InteractiveServer" /><script src="_framework/blazor.web.js"></script><script src="_content/MudBlazor/MudBlazor.min.js"></script></body></html>

wwwroot/app.css

.test ::deep {    background-color: red !important;}

Home.razor

@page "/"<div class="test"><div>This is not red</div></div><div style="background-color: red"><div>This is red</div></div>

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>