@@ -949,16 +949,23 @@ const tests = [
949
949
options : { mode : "pure" } ,
950
950
input : `/* cssmodules-pure-ignore */
951
951
:global(.foo) { color: blue; }` ,
952
- expected : `/* cssmodules-pure-ignore */
952
+ expected : `.foo { color: blue; }` ,
953
+ } ,
954
+ {
955
+ name : "should suppress errors for global selectors after ignore comment #2" ,
956
+ options : { mode : "pure" } ,
957
+ input : `/* cssmodules-pure-ignore */
958
+ /* another comment */
959
+ :global(.foo) { color: blue; }` ,
960
+ expected : `/* another comment */
953
961
.foo { color: blue; }` ,
954
962
} ,
955
963
{
956
964
name : "should allow additional text in ignore comment" ,
957
965
options : { mode : "pure" } ,
958
966
input : `/* cssmodules-pure-ignore - needed for third party integration */
959
967
:global(#foo) { color: blue; }` ,
960
- expected : `/* cssmodules-pure-ignore - needed for third party integration */
961
- #foo { color: blue; }` ,
968
+ expected : `#foo { color: blue; }` ,
962
969
} ,
963
970
{
964
971
name : "should not affect rules after the ignored block" ,
@@ -985,9 +992,7 @@ const tests = [
985
992
/* cssmodules-pure-ignore */
986
993
:global(.bar) { color: blue; }
987
994
}` ,
988
- expected : `/* cssmodules-pure-ignore */
989
- .foo {
990
- /* cssmodules-pure-ignore */
995
+ expected : `.foo {
991
996
.bar { color: blue; }
992
997
}` ,
993
998
} ,
@@ -998,8 +1003,7 @@ const tests = [
998
1003
::view-transition-group(modal) {
999
1004
animation-duration: 300ms;
1000
1005
}` ,
1001
- expected : `/* cssmodules-pure-ignore */
1002
- ::view-transition-group(modal) {
1006
+ expected : `::view-transition-group(modal) {
1003
1007
animation-duration: 300ms;
1004
1008
}` ,
1005
1009
} ,
@@ -1011,8 +1015,7 @@ const tests = [
1011
1015
from { opacity: 1; }
1012
1016
to { opacity: 0; }
1013
1017
}` ,
1014
- expected : `/* cssmodules-pure-ignore */
1015
- @keyframes fadeOut {
1018
+ expected : `@keyframes fadeOut {
1016
1019
from { opacity: 1; }
1017
1020
to { opacity: 0; }
1018
1021
}` ,
@@ -1025,7 +1028,6 @@ const tests = [
1025
1028
:global(.foo) { color: blue; }
1026
1029
}` ,
1027
1030
expected : `@media (min-width: 768px) {
1028
- /* cssmodules-pure-ignore */
1029
1031
.foo { color: blue; }
1030
1032
}` ,
1031
1033
} ,
@@ -1037,10 +1039,8 @@ const tests = [
1037
1039
.local { color: green; }
1038
1040
/* cssmodules-pure-ignore */
1039
1041
:global(.bar) { color: red; }` ,
1040
- expected : `/* cssmodules-pure-ignore */
1041
- .foo { color: blue; }
1042
+ expected : `.foo { color: blue; }
1042
1043
:local(.local) { color: green; }
1043
- /* cssmodules-pure-ignore */
1044
1044
.bar { color: red; }` ,
1045
1045
} ,
1046
1046
{
@@ -1050,8 +1050,7 @@ const tests = [
1050
1050
:global(.foo):hover > :global(.bar) + :global(.baz) {
1051
1051
color: blue;
1052
1052
}` ,
1053
- expected : `/* cssmodules-pure-ignore */
1054
- .foo:hover > .bar + .baz {
1053
+ expected : `.foo:hover > .bar + .baz {
1055
1054
color: blue;
1056
1055
}` ,
1057
1056
} ,
@@ -1064,8 +1063,7 @@ const tests = [
1064
1063
:global(.baz) {
1065
1064
color: blue;
1066
1065
}` ,
1067
- expected : `/* cssmodules-pure-ignore */
1068
- .foo,
1066
+ expected : `.foo,
1069
1067
.bar,
1070
1068
.baz {
1071
1069
color: blue;
@@ -1079,8 +1077,7 @@ const tests = [
1079
1077
:global(.foo)::after {
1080
1078
content: '';
1081
1079
}` ,
1082
- expected : `/* cssmodules-pure-ignore */
1083
- .foo::before,
1080
+ expected : `.foo::before,
1084
1081
.foo::after {
1085
1082
content: '';
1086
1083
}` ,
0 commit comments