gaoxiaoliangz/react-scoped-css

:global is not wokring

Closed this issue · 1 comments

How to use :global keyword to make scope global within a file?

.item {
  color:red;
}

:global(.item2) {
    color: blue;
}

Expected result is the item2 class to be global. But the exported css is

.item[data-v-9c56d123] {
  color: red;
}
[data-v-9c56d123]:global(.item2) {
  color: blue;
}

:global is not part of the scoped css syntax. If you want to make the style global, you can put it under non-scoped css files.