如何将文件名排除在CSS模块中添加的样式中?

发布于 2025-02-08 11:10:32 字数 261 浏览 2 评论 0原文

当使用CSS模块为特定DIV创建样式表时,检查样式​​包括样式起源于位置的文件名。例如,我的标题样式位于名为header.module.css的文件中,当将其应用于我的Header Div时,它会读取Header_header_header-container-34Jk之类的内容。我想知道是否有任何方法可以从样式的正面排除标题_,因此它只是读取header-container-34Jk

When creating a stylesheet for a certain div using CSS Modules, the inspected style includes the filename of where the style originated from. For example, my header styling is in a file named Header.module.css and when it is applied to my header div it would read something like Header_header-container-34jk. I was wondering if there is any way to exclude the Header_ from the front of the style so it just reads header-container-34jk.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

金橙橙 2025-02-15 11:10:32

您需要编辑 localIdentName

you need to edit localidentname at webPack config

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文