如何在Blazor Server中更新重新启动CSS

huangapple go评论60阅读模式
英文:

How to update Reboot CSS in Blazor Server

问题

我正在使用Blazor Server编写一个应用程序。我试图更新CSS,但似乎没有生效。

更多细节:
我使用了MSFT Convert Standard Nav Menu来创建一个漂亮的侧边菜单,支持子菜单组件。我想要更改元素的填充。在Chrome开发者工具中,我已经找到了相应的CSS并按照自己的喜好进行了更改。然而,当我在项目中找到相同的CSS时,它不起作用!明确一下,我在wwwroot/css/bootstrap/bootstrap.min.css/bootstrap.css.min.map中找到了这个CSS。

如何在Blazor Server中更新重新启动CSS

我尝试过的方法:

  1. 清除缓存
  2. 使用不同的浏览器和隐身模式
  3. 仔细搜索CSS,确保没有遗漏的部分。

我不是专业的网页开发者,所以任何帮助都会感激。

英文:

I am using Blazor Server to write an app. I am trying to update the CSS and it does not seem to be taking.

More detail:
I have used MSFT Convert Standard Nav Menu to make a nice-looking side menu that supports sub-menu components. I am looking to change the padding on the elements. Using the Chrome Developer console, I have isolated the CSS and changed it to my liking. However, when I find that very 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.

如何在Blazor Server中更新重新启动CSS

What have I tried:

  1. Clearing the cache
  2. Using different browsers and incognito mode
  3. Searching the CSS exhaustively to ensure there is nothing else I am missing.

I am not a web developer by trade, so all help is appreciated.

答案1

得分: 1

不要直接编辑导入库中的文件,因为将这些文件升级到新版本可能会覆盖您的代码:记住您修改/添加的内容会很麻烦。

此外,引导文件通常是经过缩小的,这使得情况更不明确,但表明不应编辑它们。

只需创建一个自定义CSS文件来覆盖Bootstrap的样式。确保在Bootstrap之后调用该文件。

英文:

You should not edit directly files from imported libraries because upgrading those to newer versions may overwrite your code: remembering what you modified/added would be a pain.

Moreover, bootstrap files are often minified, which makes it even less clear but suggests that it shouldn't be edited.

Simply create a custom css file to override bootstrap styling. Make sure to call the file after bootstrap.

huangapple
  • 本文由 发表于 2023年7月10日 22:51:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/76654937.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定