Cnfzh 软件博客

CSS 隔离在 Blazor 里的正确用法

razor.css 不是万能药,什么时候该用工具类。

规则

能用 Bootstrap 工具类解决的,一律不写自定义样式。必须写的,进 .razor.css。

好处

组件删了样式跟着删,不会留下没人敢动的全局 CSS。

陷阱

:deep 只在确有必要时用——它意味着你在改别人的组件。

评论 0

还没有评论,来说两句吧。

提交前需验证邮箱,验证码 10 分钟内有效。

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.