@@ -881,16 +881,23 @@ const tests = [
881
881
options : { mode : "pure" } ,
882
882
input : `/* cssmodules-pure-ignore */
883
883
:global(.foo) { color: blue; }` ,
884
- expected : `/* cssmodules-pure-ignore */
884
+ expected : `.foo { color: blue; }` ,
885
+ } ,
886
+ {
887
+ name : "should suppress errors for global selectors after ignore comment #2" ,
888
+ options : { mode : "pure" } ,
889
+ input : `/* cssmodules-pure-ignore */
890
+ /* another comment */
891
+ :global(.foo) { color: blue; }` ,
892
+ expected : `/* another comment */
885
893
.foo { color: blue; }` ,
886
894
} ,
887
895
{
888
896
name : "should allow additional text in ignore comment" ,
889
897
options : { mode : "pure" } ,
890
898
input : `/* cssmodules-pure-ignore - needed for third party integration */
891
899
:global(#foo) { color: blue; }` ,
892
- expected : `/* cssmodules-pure-ignore - needed for third party integration */
893
- #foo { color: blue; }` ,
900
+ expected : `#foo { color: blue; }` ,
894
901
} ,
895
902
{
896
903
name : "should not affect rules after the ignored block" ,
@@ -917,9 +924,7 @@ const tests = [
917
924
/* cssmodules-pure-ignore */
918
925
:global(.bar) { color: blue; }
919
926
}` ,
920
- expected : `/* cssmodules-pure-ignore */
921
- .foo {
922
- /* cssmodules-pure-ignore */
927
+ expected : `.foo {
923
928
.bar { color: blue; }
924
929
}` ,
925
930
} ,
@@ -930,8 +935,7 @@ const tests = [
930
935
::view-transition-group(modal) {
931
936
animation-duration: 300ms;
932
937
}` ,
933
- expected : `/* cssmodules-pure-ignore */
934
- ::view-transition-group(modal) {
938
+ expected : `::view-transition-group(modal) {
935
939
animation-duration: 300ms;
936
940
}` ,
937
941
} ,
@@ -943,8 +947,7 @@ const tests = [
943
947
from { opacity: 1; }
944
948
to { opacity: 0; }
945
949
}` ,
946
- expected : `/* cssmodules-pure-ignore */
947
- @keyframes fadeOut {
950
+ expected : `@keyframes fadeOut {
948
951
from { opacity: 1; }
949
952
to { opacity: 0; }
950
953
}` ,
@@ -957,7 +960,6 @@ const tests = [
957
960
:global(.foo) { color: blue; }
958
961
}` ,
959
962
expected : `@media (min-width: 768px) {
960
- /* cssmodules-pure-ignore */
961
963
.foo { color: blue; }
962
964
}` ,
963
965
} ,
@@ -969,10 +971,8 @@ const tests = [
969
971
.local { color: green; }
970
972
/* cssmodules-pure-ignore */
971
973
:global(.bar) { color: red; }` ,
972
- expected : `/* cssmodules-pure-ignore */
973
- .foo { color: blue; }
974
+ expected : `.foo { color: blue; }
974
975
:local(.local) { color: green; }
975
- /* cssmodules-pure-ignore */
976
976
.bar { color: red; }` ,
977
977
} ,
978
978
{
@@ -982,8 +982,7 @@ const tests = [
982
982
:global(.foo):hover > :global(.bar) + :global(.baz) {
983
983
color: blue;
984
984
}` ,
985
- expected : `/* cssmodules-pure-ignore */
986
- .foo:hover > .bar + .baz {
985
+ expected : `.foo:hover > .bar + .baz {
987
986
color: blue;
988
987
}` ,
989
988
} ,
@@ -996,8 +995,7 @@ const tests = [
996
995
:global(.baz) {
997
996
color: blue;
998
997
}` ,
999
- expected : `/* cssmodules-pure-ignore */
1000
- .foo,
998
+ expected : `.foo,
1001
999
.bar,
1002
1000
.baz {
1003
1001
color: blue;
@@ -1011,8 +1009,7 @@ const tests = [
1011
1009
:global(.foo)::after {
1012
1010
content: '';
1013
1011
}` ,
1014
- expected : `/* cssmodules-pure-ignore */
1015
- .foo::before,
1012
+ expected : `.foo::before,
1016
1013
.foo::after {
1017
1014
content: '';
1018
1015
}` ,
0 commit comments