简体   繁体   English

cssnano从css @media查询中删除“ all”属性

[英]cssnano removes “all” attribute from css @media query

I am curious if what cssnano does to media queries is ok. 我很好奇cssnano对媒体查询所做的事情是否还可以。 In my css file, I have. 在我的css文件中,我有。

@media all and ( min-width: 600px) {}

After running my css through cssnano, it turns it to this > 通过cssnano运行我的css之后,将其变为>

@media ( min-width: 600px) {}

Is this safe to use in production? 在生产中使用安全吗? I can't seem to find anywhere where it says not having the "all" attribute makes the browser default to all or if not having it is a bad thing for sending the file to production? 我似乎找不到任何地方显示不具有“ all”属性会使浏览器默认为全部,或者如果不具有该属性,那么将文件发送到生产环境是一件坏事吗?

I'm the author; 我是作者 yes, it's valid. 是的,这是有效的。 I'll refer you to the original issue but in a nutshell: 简而言之,我将向您介绍原始问题:

Per the spec (example 5): 根据规范 (示例5):

Ie these are identical: 即这些是相同的:

 @media all and (min-width:500px) { … } @media (min-width:500px) { … } 

As are these: 这些是:

 @media (orientation: portrait) { … } @media all and (orientation: portrait) { … } 

It seems to me that those could be stripped...[snip] 在我看来,这些东西可能会被剥夺... [snip]

https://github.com/ben-eb/cssnano/issues/215 https://github.com/ben-eb/cssnano/issues/215

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

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