<html class="no-touchevents">向文档的<html>标签添加类。
在我的代码中,我曾经写过这样的代码。
.style { background: green; }
.no-touchevents .style { background: red; }因此,如果支持触摸,元素将为绿色(OK),如果不支持,则为红色(错误)。现在有了CSS模块,我的.style类被定义在一个文件中,并被转换成如下所示。
.xR23A { background: green; }
.hjTT7 .xR23A { background: red; }如果我将类包装在:global子句中,如果我正确理解它,它应该保持不变。但是,这将适用于每个嵌套的类,因此我将继续讨论这一点。
.xR23A { background: green; }
.no-touchevents .style { background: red; }我如何解决这个问题才能得到想要的解决方案?这就是我要找的。
.xR23A { background: green; }
.no-touchevents .xR23A { background: red; }发布于 2017-08-04 06:42:18
您应该能够使用global的paren版本来仅hoise modernizr部分。
即
.style { background: green; }
:global(.no-touchevents) .style { background: red; }https://stackoverflow.com/questions/45494816
复制相似问题