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

Use a directive / conditional to load different stylesheets in app.razor when starting Blazor app

$
0
0

I'm wondering if there is a way in a Blazor app to load a stylesheet using a conditional of some sort? I want to load different css according to a variable or user setting. Less about where the setting will come from, more about how to actually do this in app.razor

Such as:

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><base href="/" />       *** some conditional if here:<link rel="stylesheet" href="condition1.min.css" />    *** else this<link rel="stylesheet" href="condition2.min.css" />< rest of links...><HeadOutlet /></head><body><Routes />    blah blah</body></html>

TYIA


Viewing all articles
Browse latest Browse all 4839

Trending Articles



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