CSS Module 的 :global 和 :global()有什么区别

新手上路,请多包涵

官方是这样解释的:

:global switches to global scope for the current selector resp. identifier. :global(.xxx) resp. @keyframes :global(xxx) declares the stuff in brackets in the global scope.

感觉用法差不多,实验了几次结果都是一样的,请问这两个有什么区别,实在什么情况下使用的?

阅读 12k
1 个回答

:global(xxx) 可以写成 .abc :global(xxx) {...}

:global可以写成
:global {

.a{...}
.b{...}

}

推荐问题