如何将文件名排除在CSS模块中添加的样式中?
当使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要编辑 localIdentName
you need to edit localidentname at webPack config