简体   繁体   English

我可以在 scss 中不全部使用 @media 吗?

[英]Can I use @media not all in scss?

I'm using scss and I just want to disable hover features on mobile for a very specific section of code.我正在使用 scss,我只想禁用移动设备上非常特定的代码部分的悬停功能。 It's a nested div using the & prefix.它是一个使用 & 前缀的嵌套 div。 So, basically:所以,基本上:

.superclass{

    .subclass{

        @media not all and (pointer: coarse) {
         &hover{
         hover style
         }
    }
}}

Would this work?这行得通吗? Right now I'm dealing with build issues keeping me from deploying my application locally and verifying that way.现在我正在处理构建问题,使我无法在本地部署我的应用程序并以这种方式进行验证。

Why don't you use a traditional size approach for mobile?为什么不使用传统的移动尺寸方法?

@media only screen and (max-width : 320px) {
/* Styles */
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM