search

Home  >  Q&A  >  body text

How to update restart CSS in Blazor Server

I'm writing an application using Blazor Server. I'm trying to update the CSS but it doesn't seem to be working.

More details: I used MSFT Convert Standard Nav Menu to make a beautiful side menu that supports submenu components. I'm looking to change the padding on an element. Using the Chrome Developer Console, I isolated the CSS and changed it to my liking. However, when I find the exact same CSS in my project, it doesn't work! To be clear, I found the CSS in wwwroot/css/bootstrap/bootstrap.min.css/bootstrap.css.min.map.

What I tried:

  1. clear cache
  2. Use a different browser and incognito mode
  3. Search the CSS thoroughly to make sure nothing else is missed.

I'm not a web developer so any help is appreciated.

P粉041758700P粉041758700493 days ago536

reply all(1)I'll reply

  • P粉265724930

    P粉2657249302023-09-11 09:08:28

    You should not edit files in import libraries directly, as upgrading these files to a newer version may overwrite your code: it will be a pain to remember what you modified/added.

    Additionally, the bootstrap file is often minified, which makes it more unclear but indicates that it should not be edited.

    Just create a custom css file to override bootstrap styles. Make sure to call this file after booting.

    reply
    0
  • Cancelreply