github.com/evanw/esbuild@v0.21.4/internal/bundler_tests/snapshots/snapshots_css.txt (about) 1 TestBase64ImportURLInCSS 2 ---------- /out/entry.css ---------- 3 /* entry.css */ 4 a { 5 background: url(data:image/png;base64,iVBORw0KGgo=); 6 } 7 8 ================================================================================ 9 TestBinaryImportURLInCSS 10 ---------- /out/entry.css ---------- 11 /* entry.css */ 12 a { 13 background: url(data:application/octet-stream;base64,iVBORw0KGgo=); 14 } 15 16 ================================================================================ 17 TestCSSAndJavaScriptCodeSplittingIssue1064 18 ---------- /out/a.js ---------- 19 import { 20 shared_default 21 } from "./chunk-XTGNVFM6.js"; 22 23 // a.js 24 console.log(shared_default() + 1); 25 26 ---------- /out/b.js ---------- 27 import { 28 shared_default 29 } from "./chunk-XTGNVFM6.js"; 30 31 // b.js 32 console.log(shared_default() + 2); 33 34 ---------- /out/chunk-XTGNVFM6.js ---------- 35 // shared.js 36 function shared_default() { 37 return 3; 38 } 39 40 export { 41 shared_default 42 }; 43 44 ---------- /out/c.css ---------- 45 /* shared.css */ 46 body { 47 background: black; 48 } 49 50 /* c.css */ 51 body { 52 color: red; 53 } 54 55 ---------- /out/d.css ---------- 56 /* shared.css */ 57 body { 58 background: black; 59 } 60 61 /* d.css */ 62 body { 63 color: blue; 64 } 65 66 ================================================================================ 67 TestCSSAssetPathsWithSpacesBundle 68 ---------- /foo-AKINYSFH.copy ---------- 69 ... 70 ---------- /foo-AKINYSFH.file ---------- 71 ... 72 ---------- /foo 2-AKINYSFH.copy ---------- 73 ... 74 ---------- /foo 2-AKINYSFH.file ---------- 75 ... 76 ---------- /out.css ---------- 77 /* entry.css */ 78 a { 79 background: url("./foo-AKINYSFH.copy"); 80 background: url("./foo-AKINYSFH.file"); 81 } 82 /*! The URLs for "foo 2" files must have quotes in the final CSS */ 83 b { 84 background: url("./foo 2-AKINYSFH.copy"); 85 background: url("./foo 2-AKINYSFH.file"); 86 } 87 88 ================================================================================ 89 TestCSSAtImport 90 ---------- /out.css ---------- 91 /* a.css */ 92 .a { 93 color: green; 94 } 95 96 /* shared.css */ 97 .shared { 98 color: black; 99 } 100 101 /* b.css */ 102 .b { 103 color: blue; 104 } 105 106 /* entry.css */ 107 .entry { 108 color: red; 109 } 110 111 ================================================================================ 112 TestCSSAtImportConditionsAtLayerBundle 113 ---------- /out/case1.css ---------- 114 @layer first.one; 115 116 /* case1-foo.css */ 117 @layer last.one { 118 body { 119 color: red; 120 } 121 } 122 123 /* case1-foo.css */ 124 @layer first.one { 125 body { 126 color: red; 127 } 128 } 129 130 /* case1.css */ 131 132 ---------- /out/case2.css ---------- 133 @layer first.one; 134 135 /* case2-bar.css */ 136 @layer last.one { 137 body { 138 color: green; 139 } 140 } 141 142 /* case2-foo.css */ 143 @layer first.one { 144 body { 145 color: red; 146 } 147 } 148 149 /* case2.css */ 150 151 ---------- /out/case3.css ---------- 152 /* case3-bar.css */ 153 @layer only.one { 154 body { 155 color: green; 156 } 157 } 158 159 /* case3-foo.css */ 160 @layer { 161 body { 162 color: red; 163 } 164 } 165 166 /* case3.css */ 167 168 ---------- /out/case4.css ---------- 169 @layer first { 170 @layer one, one.two, one.three.four; 171 } 172 173 /* case4-foo.css */ 174 @layer last { 175 @layer one { 176 @layer two, three.four; 177 body { 178 color: red; 179 } 180 } 181 } 182 183 /* case4-foo.css */ 184 @layer first { 185 @layer one { 186 @layer two, three.four; 187 body { 188 color: red; 189 } 190 } 191 } 192 193 /* case4.css */ 194 195 ---------- /out/case5.css ---------- 196 /* case5-foo.css */ 197 @layer middle { 198 @layer one { 199 @layer two, three.four; 200 body { 201 color: red; 202 } 203 } 204 } 205 206 /* case5-foo.css */ 207 @layer { 208 @layer one { 209 @layer two, three.four; 210 body { 211 color: red; 212 } 213 } 214 } 215 216 /* case5.css */ 217 218 ---------- /out/case6.css ---------- 219 @layer first; 220 221 /* case6-foo.css */ 222 @layer last { 223 @layer { 224 @layer two, three.four; 225 body { 226 color: red; 227 } 228 } 229 } 230 231 /* case6-foo.css */ 232 @layer first { 233 @layer { 234 @layer two, three.four; 235 body { 236 color: red; 237 } 238 } 239 } 240 241 /* case6.css */ 242 243 ================================================================================ 244 TestCSSAtImportConditionsAtLayerBundleAlternatingLayerInFile 245 ---------- /out/case1.css ---------- 246 /* a.css */ 247 @layer first { 248 body { 249 color: red; 250 } 251 } 252 253 /* case1.css */ 254 255 ---------- /out/case2.css ---------- 256 @layer first; 257 258 /* b.css */ 259 @layer last { 260 body { 261 color: green; 262 } 263 } 264 265 /* a.css */ 266 @layer first { 267 body { 268 color: red; 269 } 270 } 271 272 /* case2.css */ 273 274 ---------- /out/case3.css ---------- 275 @layer first, last; 276 277 /* a.css */ 278 @layer first { 279 body { 280 color: red; 281 } 282 } 283 284 /* b.css */ 285 @layer last { 286 body { 287 color: green; 288 } 289 } 290 291 /* case3.css */ 292 293 ---------- /out/case4.css ---------- 294 @layer first; 295 296 /* b.css */ 297 @layer last { 298 body { 299 color: green; 300 } 301 } 302 303 /* a.css */ 304 @layer first { 305 body { 306 color: red; 307 } 308 } 309 310 /* case4.css */ 311 312 ---------- /out/case5.css ---------- 313 @layer first, last; 314 315 /* a.css */ 316 @layer first { 317 body { 318 color: red; 319 } 320 } 321 322 /* b.css */ 323 @layer last { 324 body { 325 color: green; 326 } 327 } 328 329 /* case5.css */ 330 331 ---------- /out/case6.css ---------- 332 @layer first; 333 334 /* b.css */ 335 @layer last { 336 body { 337 color: green; 338 } 339 } 340 341 /* a.css */ 342 @layer first { 343 body { 344 color: red; 345 } 346 } 347 348 /* case6.css */ 349 350 ================================================================================ 351 TestCSSAtImportConditionsAtLayerBundleAlternatingLayerOnImport 352 ---------- /out/case1.css ---------- 353 /* a.css */ 354 @layer first { 355 body { 356 color: red; 357 } 358 } 359 360 /* case1.css */ 361 362 ---------- /out/case2.css ---------- 363 @layer first; 364 365 /* b.css */ 366 @layer last { 367 body { 368 color: green; 369 } 370 } 371 372 /* a.css */ 373 @layer first { 374 body { 375 color: red; 376 } 377 } 378 379 /* case2.css */ 380 381 ---------- /out/case3.css ---------- 382 @layer first; 383 @layer last; 384 385 /* a.css */ 386 @layer first { 387 body { 388 color: red; 389 } 390 } 391 392 /* b.css */ 393 @layer last { 394 body { 395 color: green; 396 } 397 } 398 399 /* case3.css */ 400 401 ---------- /out/case4.css ---------- 402 @layer first; 403 404 /* b.css */ 405 @layer last { 406 body { 407 color: green; 408 } 409 } 410 411 /* a.css */ 412 @layer first { 413 body { 414 color: red; 415 } 416 } 417 418 /* case4.css */ 419 420 ---------- /out/case5.css ---------- 421 @layer first; 422 @layer last; 423 424 /* a.css */ 425 @layer first { 426 body { 427 color: red; 428 } 429 } 430 431 /* b.css */ 432 @layer last { 433 body { 434 color: green; 435 } 436 } 437 438 /* case5.css */ 439 440 ---------- /out/case6.css ---------- 441 @layer first; 442 443 /* b.css */ 444 @layer last { 445 body { 446 color: green; 447 } 448 } 449 450 /* a.css */ 451 @layer first { 452 body { 453 color: red; 454 } 455 } 456 457 /* case6.css */ 458 459 ================================================================================ 460 TestCSSAtImportConditionsBundle 461 ---------- /out.css ---------- 462 @import "http://example.com/foo.css"; 463 @import "http://example.com/foo.css" layer; 464 @import "http://example.com/foo.css" layer(layer-name); 465 @import "http://example.com/foo.css" layer(layer-name) supports(supports-condition); 466 @import "http://example.com/foo.css" layer(layer-name) list-of-media-queries; 467 @import "http://example.com/foo.css" supports(supports-condition); 468 @import "http://example.com/foo.css" list-of-media-queries; 469 470 /* foo.css */ 471 body { 472 color: red; 473 } 474 475 /* foo.css */ 476 @layer { 477 body { 478 color: red; 479 } 480 } 481 482 /* foo.css */ 483 @layer layer-name { 484 body { 485 color: red; 486 } 487 } 488 489 /* foo.css */ 490 @supports (supports-condition) { 491 @layer layer-name { 492 body { 493 color: red; 494 } 495 } 496 } 497 498 /* foo.css */ 499 @media list-of-media-queries { 500 @layer layer-name { 501 body { 502 color: red; 503 } 504 } 505 } 506 507 /* foo.css */ 508 @supports (supports-condition) { 509 body { 510 color: red; 511 } 512 } 513 514 /* foo.css */ 515 @media list-of-media-queries { 516 body { 517 color: red; 518 } 519 } 520 521 /* empty-1.css */ 522 @layer empty-1; 523 524 /* empty-2.css */ 525 526 /* empty-3.css */ 527 528 /* foo.css */ 529 @layer outer { 530 @layer inner { 531 body { 532 color: red; 533 } 534 } 535 } 536 537 /* nested-layer.css */ 538 @layer outer; 539 540 /* foo.css */ 541 @supports (outer: true) { 542 @layer inner { 543 body { 544 color: red; 545 } 546 } 547 } 548 549 /* nested-layer.css */ 550 551 /* foo.css */ 552 @media (outer: true) { 553 @layer inner { 554 body { 555 color: red; 556 } 557 } 558 } 559 560 /* nested-layer.css */ 561 562 /* foo.css */ 563 @layer outer { 564 @supports (inner: true) { 565 body { 566 color: red; 567 } 568 } 569 } 570 571 /* nested-supports.css */ 572 @layer outer; 573 574 /* foo.css */ 575 @supports (outer: true) { 576 @supports (inner: true) { 577 body { 578 color: red; 579 } 580 } 581 } 582 583 /* nested-supports.css */ 584 585 /* foo.css */ 586 @media (outer: true) { 587 @supports (inner: true) { 588 body { 589 color: red; 590 } 591 } 592 } 593 594 /* nested-supports.css */ 595 596 /* foo.css */ 597 @layer outer { 598 @media (inner: true) { 599 body { 600 color: red; 601 } 602 } 603 } 604 605 /* nested-media.css */ 606 @layer outer; 607 608 /* foo.css */ 609 @supports (outer: true) { 610 @media (inner: true) { 611 body { 612 color: red; 613 } 614 } 615 } 616 617 /* nested-media.css */ 618 619 /* foo.css */ 620 @media (outer: true) { 621 @media (inner: true) { 622 body { 623 color: red; 624 } 625 } 626 } 627 628 /* nested-media.css */ 629 630 /* entry.css */ 631 632 ================================================================================ 633 TestCSSAtImportConditionsBundleExternal 634 ---------- /out.css ---------- 635 @import "https://example.com/print.css" print; 636 637 /* entry.css */ 638 639 ================================================================================ 640 TestCSSAtImportConditionsBundleExternalConditionWithURL 641 ---------- /out.css ---------- 642 @import "https://example.com/foo.css" (foo: url(foo.png)) and (bar: url(bar.png)); 643 644 /* entry.css */ 645 646 ================================================================================ 647 TestCSSAtImportConditionsChainExternal 648 ---------- /out.css ---------- 649 @import "http://example.com/external1.css" layer(a) not print; 650 @import 'data:text/css,@import "http://example.com/external3.css" layer(b) not tv;' layer(a) not print; 651 @import "data:text/css,@import 'data:text/css,@import \"http://example.com/external4.css\" layer(b2);' layer(b) not tv;" layer(a) not print; 652 @import 'data:text/css,@import "http://example.com/external2.css" layer(a2);' layer(a) not print; 653 654 /* b.css */ 655 @media not print { 656 @layer a { 657 @media not tv { 658 @layer b; 659 } 660 } 661 } 662 663 /* a.css */ 664 @media not print { 665 @layer a; 666 } 667 668 /* entry.css */ 669 670 ================================================================================ 671 TestCSSAtImportConditionsFromExternalRepo 672 ---------- /out/001/default/style.css ---------- 673 /* 001/default/a.css */ 674 .box { 675 background-color: green; 676 } 677 678 /* 001/default/style.css */ 679 680 ---------- /out/001/relative-url/style.css ---------- 681 /* 001/relative-url/a.css */ 682 .box { 683 background-color: green; 684 } 685 686 /* 001/relative-url/style.css */ 687 688 ---------- /out/at-charset/001/style.css ---------- 689 @charset "UTF-8"; 690 691 /* at-charset/001/a.css */ 692 .box { 693 background-color: red; 694 } 695 696 /* at-charset/001/b.css */ 697 .box { 698 background-color: green; 699 } 700 701 /* at-charset/001/style.css */ 702 703 ---------- /out/at-keyframes/001/style.css ---------- 704 /* at-keyframes/001/a.css */ 705 @media screen { 706 .box { 707 animation: BOX; 708 animation-duration: 0s; 709 animation-fill-mode: both; 710 } 711 @keyframes BOX { 712 0%, 100% { 713 background-color: green; 714 } 715 } 716 } 717 718 /* at-keyframes/001/b.css */ 719 @media print { 720 .box { 721 animation: BOX; 722 animation-duration: 0s; 723 animation-fill-mode: both; 724 } 725 @keyframes BOX { 726 0%, 100% { 727 background-color: red; 728 } 729 } 730 } 731 732 /* at-keyframes/001/style.css */ 733 734 ---------- /out/at-layer/001/style.css ---------- 735 @layer a; 736 737 /* at-layer/001/b.css */ 738 @layer b { 739 .box { 740 background-color: green; 741 } 742 } 743 744 /* at-layer/001/a.css */ 745 @layer a { 746 .box { 747 background-color: red; 748 } 749 } 750 751 /* at-layer/001/style.css */ 752 753 ---------- /out/at-layer/002/style.css ---------- 754 @media print { 755 @layer a; 756 } 757 758 /* at-layer/002/b.css */ 759 @layer b { 760 .box { 761 background-color: red; 762 } 763 } 764 765 /* at-layer/002/a.css */ 766 @layer a { 767 .box { 768 background-color: green; 769 } 770 } 771 772 /* at-layer/002/style.css */ 773 774 ---------- /out/at-layer/003/style.css ---------- 775 @layer a; 776 777 /* at-layer/003/b.css */ 778 @layer b { 779 .box { 780 background-color: green; 781 } 782 } 783 784 /* at-layer/003/a.css */ 785 @layer a { 786 .box { 787 background-color: red; 788 } 789 } 790 791 /* at-layer/003/style.css */ 792 793 ---------- /out/at-layer/004/style.css ---------- 794 /* at-layer/004/b.css */ 795 @layer { 796 .box { 797 background-color: red; 798 } 799 } 800 801 /* at-layer/004/a.css */ 802 @layer { 803 .box { 804 background-color: green; 805 } 806 } 807 808 /* at-layer/004/style.css */ 809 810 ---------- /out/at-layer/005/style.css ---------- 811 /* at-layer/005/b.css */ 812 @media (min-width: 1px) { 813 @layer a { 814 @media (width: 1px) { 815 @layer b { 816 .box { 817 background-color: red; 818 } 819 } 820 } 821 } 822 } 823 824 /* at-layer/005/a.css */ 825 @media (min-width: 1px) { 826 @layer a; 827 } 828 829 /* at-layer/005/style.css */ 830 @layer a.c { 831 .box { 832 background-color: red; 833 } 834 } 835 @layer a.b { 836 .box { 837 background-color: green; 838 } 839 } 840 841 ---------- /out/at-layer/006/style.css ---------- 842 /* at-layer/006/b.css */ 843 @media (min-width: 1px) { 844 @layer a { 845 @media (min-width: 1px) { 846 @layer b { 847 .box { 848 background-color: red; 849 } 850 } 851 } 852 } 853 } 854 855 /* at-layer/006/a.css */ 856 @media (min-width: 1px) { 857 @layer a; 858 } 859 860 /* at-layer/006/style.css */ 861 @layer a.c { 862 .box { 863 background-color: green; 864 } 865 } 866 @layer a.b { 867 .box { 868 background-color: red; 869 } 870 } 871 872 ---------- /out/at-layer/007/style.css ---------- 873 /* at-layer/007/style.css */ 874 @layer foo { 875 } 876 @layer bar { 877 } 878 @layer bar { 879 .box { 880 background-color: green; 881 } 882 } 883 @layer foo { 884 .box { 885 background-color: red; 886 } 887 } 888 889 ---------- /out/at-layer/008/style.css ---------- 890 /* at-layer/008/b.css */ 891 @layer { 892 @layer { 893 .box { 894 background-color: red; 895 } 896 } 897 } 898 899 /* at-layer/008/a.css */ 900 @layer { 901 .box { 902 background-color: green; 903 } 904 } 905 906 /* at-layer/008/style.css */ 907 908 ---------- /out/at-media/001/default/style.css ---------- 909 /* at-media/001/default/a.css */ 910 @media screen { 911 .box { 912 background-color: green; 913 } 914 } 915 916 /* at-media/001/default/style.css */ 917 918 ---------- /out/at-media/002/style.css ---------- 919 /* at-media/002/a.css */ 920 @media screen { 921 .box { 922 background-color: green; 923 } 924 } 925 926 /* at-media/002/b.css */ 927 @media print { 928 .box { 929 background-color: red; 930 } 931 } 932 933 /* at-media/002/style.css */ 934 935 ---------- /out/at-media/003/style.css ---------- 936 /* at-media/003/b.css */ 937 @media screen { 938 @media (min-width: 1px) { 939 .box { 940 background-color: green; 941 } 942 } 943 } 944 945 /* at-media/003/a.css */ 946 947 /* at-media/003/style.css */ 948 949 ---------- /out/at-media/004/style.css ---------- 950 /* at-media/004/c.css */ 951 .box { 952 background-color: green; 953 } 954 955 /* at-media/004/b.css */ 956 @media print { 957 @media print { 958 .box { 959 background-color: red; 960 } 961 } 962 } 963 964 /* at-media/004/a.css */ 965 966 /* at-media/004/style.css */ 967 968 ---------- /out/at-media/005/style.css ---------- 969 /* at-media/005/c.css */ 970 .box { 971 background-color: green; 972 } 973 974 /* at-media/005/b.css */ 975 @media (max-width: 1px) { 976 @media (max-width: 1px) { 977 .box { 978 background-color: red; 979 } 980 } 981 } 982 983 /* at-media/005/a.css */ 984 985 /* at-media/005/style.css */ 986 987 ---------- /out/at-media/006/style.css ---------- 988 /* at-media/006/b.css */ 989 @media (min-height: 1px) { 990 @media (min-width: 1px) { 991 .box { 992 background-color: green; 993 } 994 } 995 } 996 997 /* at-media/006/a.css */ 998 999 /* at-media/006/style.css */ 1000 1001 ---------- /out/at-media/007/style.css ---------- 1002 /* at-media/007/b.css */ 1003 @media all { 1004 @media screen { 1005 .box { 1006 background-color: green; 1007 } 1008 } 1009 } 1010 1011 /* at-media/007/a.css */ 1012 1013 /* at-media/007/style.css */ 1014 1015 ---------- /out/at-media/008/style.css ---------- 1016 /* at-media/008/green.css */ 1017 @media all { 1018 @layer alpha { 1019 @media print { 1020 @layer alpha { 1021 .box { 1022 background-color: green; 1023 } 1024 } 1025 } 1026 } 1027 } 1028 1029 /* at-media/008/a.css */ 1030 @media all { 1031 @layer alpha; 1032 } 1033 1034 /* at-media/008/red.css */ 1035 @media all { 1036 @layer beta { 1037 @media print { 1038 @layer beta { 1039 .box { 1040 background-color: red; 1041 } 1042 } 1043 } 1044 } 1045 } 1046 1047 /* at-media/008/b.css */ 1048 @media all { 1049 @layer beta; 1050 } 1051 1052 /* at-media/008/style.css */ 1053 @layer beta { 1054 .box { 1055 background-color: green; 1056 } 1057 } 1058 @layer alpha { 1059 .box { 1060 background-color: red; 1061 } 1062 } 1063 1064 ---------- /out/at-supports/001/style.css ---------- 1065 /* at-supports/001/a.css */ 1066 @supports (display: block) { 1067 .box { 1068 background-color: green; 1069 } 1070 } 1071 1072 /* at-supports/001/style.css */ 1073 1074 ---------- /out/at-supports/002/style.css ---------- 1075 /* at-supports/002/b.css */ 1076 @supports (display: block) { 1077 @supports (width: 10px) { 1078 .box { 1079 background-color: green; 1080 } 1081 } 1082 } 1083 1084 /* at-supports/002/a.css */ 1085 1086 /* at-supports/002/style.css */ 1087 1088 ---------- /out/at-supports/003/style.css ---------- 1089 /* at-supports/003/b.css */ 1090 @supports ((display: block) or (display: inline)) { 1091 @supports (width: 10px) { 1092 .box { 1093 background-color: green; 1094 } 1095 } 1096 } 1097 1098 /* at-supports/003/a.css */ 1099 1100 /* at-supports/003/style.css */ 1101 1102 ---------- /out/at-supports/004/style.css ---------- 1103 /* at-supports/004/b.css */ 1104 @supports (display: block) { 1105 @layer a { 1106 @supports (width: 10px) { 1107 @layer b { 1108 .box { 1109 background-color: green; 1110 } 1111 } 1112 } 1113 } 1114 } 1115 1116 /* at-supports/004/a.css */ 1117 @supports (display: block) { 1118 @layer a; 1119 } 1120 1121 /* at-supports/004/style.css */ 1122 1123 ---------- /out/at-supports/005/style.css ---------- 1124 /* at-supports/005/green.css */ 1125 @supports (display: block) { 1126 @layer alpha { 1127 @supports (foo: bar) { 1128 @layer alpha { 1129 .box { 1130 background-color: green; 1131 } 1132 } 1133 } 1134 } 1135 } 1136 1137 /* at-supports/005/a.css */ 1138 @supports (display: block) { 1139 @layer alpha; 1140 } 1141 1142 /* at-supports/005/red.css */ 1143 @supports (display: block) { 1144 @layer beta { 1145 @supports (foo: bar) { 1146 @layer beta { 1147 .box { 1148 background-color: red; 1149 } 1150 } 1151 } 1152 } 1153 } 1154 1155 /* at-supports/005/b.css */ 1156 @supports (display: block) { 1157 @layer beta; 1158 } 1159 1160 /* at-supports/005/style.css */ 1161 @layer beta { 1162 .box { 1163 background-color: green; 1164 } 1165 } 1166 @layer alpha { 1167 .box { 1168 background-color: red; 1169 } 1170 } 1171 1172 ---------- /out/cycles/001/style.css ---------- 1173 /* cycles/001/style.css */ 1174 .box { 1175 background-color: green; 1176 } 1177 1178 ---------- /out/cycles/002/style.css ---------- 1179 /* cycles/002/red.css */ 1180 .box { 1181 background-color: red; 1182 } 1183 1184 /* cycles/002/green.css */ 1185 .box { 1186 background-color: green; 1187 } 1188 1189 /* cycles/002/b.css */ 1190 1191 /* cycles/002/a.css */ 1192 1193 /* cycles/002/style.css */ 1194 1195 ---------- /out/cycles/003/style.css ---------- 1196 /* cycles/003/b.css */ 1197 .box { 1198 background-color: red; 1199 } 1200 1201 /* cycles/003/a.css */ 1202 .box { 1203 background-color: green; 1204 } 1205 1206 /* cycles/003/style.css */ 1207 1208 ---------- /out/cycles/004/style.css ---------- 1209 /* cycles/004/a.css */ 1210 .box { 1211 background-color: red; 1212 } 1213 1214 /* cycles/004/b.css */ 1215 .box { 1216 background-color: green; 1217 } 1218 1219 /* cycles/004/style.css */ 1220 1221 ---------- /out/cycles/005/style.css ---------- 1222 /* cycles/005/b.css */ 1223 .box { 1224 background-color: red; 1225 } 1226 1227 /* cycles/005/a.css */ 1228 .box { 1229 background-color: green; 1230 } 1231 1232 /* cycles/005/style.css */ 1233 1234 ---------- /out/cycles/006/style.css ---------- 1235 /* cycles/006/red.css */ 1236 .box { 1237 background-color: red; 1238 } 1239 1240 /* cycles/006/green.css */ 1241 .box { 1242 background-color: green; 1243 } 1244 1245 /* cycles/006/b.css */ 1246 1247 /* cycles/006/a.css */ 1248 1249 /* cycles/006/c.css */ 1250 1251 /* cycles/006/style.css */ 1252 1253 ---------- /out/cycles/007/style.css ---------- 1254 /* cycles/007/green.css */ 1255 .box { 1256 background-color: green; 1257 } 1258 1259 /* cycles/007/red.css */ 1260 @media all { 1261 .box { 1262 background-color: red; 1263 } 1264 } 1265 1266 /* cycles/007/a.css */ 1267 1268 /* cycles/007/b.css */ 1269 1270 /* cycles/007/red.css */ 1271 @media not print { 1272 .box { 1273 background-color: red; 1274 } 1275 } 1276 1277 /* cycles/007/green.css */ 1278 @media not print { 1279 @media screen { 1280 .box { 1281 background-color: green; 1282 } 1283 } 1284 } 1285 1286 /* cycles/007/b.css */ 1287 1288 /* cycles/007/a.css */ 1289 1290 /* cycles/007/c.css */ 1291 1292 /* cycles/007/style.css */ 1293 1294 ---------- /out/cycles/008/style.css ---------- 1295 /* cycles/008/green.css */ 1296 @layer { 1297 .box { 1298 background-color: green; 1299 } 1300 } 1301 1302 /* cycles/008/red.css */ 1303 @layer { 1304 .box { 1305 background-color: red; 1306 } 1307 } 1308 1309 /* cycles/008/a.css */ 1310 1311 /* cycles/008/b.css */ 1312 1313 /* cycles/008/red.css */ 1314 @layer { 1315 @layer { 1316 .box { 1317 background-color: red; 1318 } 1319 } 1320 } 1321 1322 /* cycles/008/green.css */ 1323 @layer { 1324 @layer { 1325 .box { 1326 background-color: green; 1327 } 1328 } 1329 } 1330 1331 /* cycles/008/b.css */ 1332 1333 /* cycles/008/a.css */ 1334 1335 /* cycles/008/c.css */ 1336 1337 /* cycles/008/style.css */ 1338 1339 ---------- /out/data-urls/002/style.css ---------- 1340 /* <data:text/css;plain,.box%20%7B%0A%09background-color%3A%20green%...> */ 1341 .box { 1342 background-color: green; 1343 } 1344 1345 /* data-urls/002/style.css */ 1346 1347 ---------- /out/data-urls/003/style.css ---------- 1348 /* <data:text/css,.box%20%7B%0A%09background-color%3A%20green%3B%0A%...> */ 1349 .box { 1350 background-color: green; 1351 } 1352 1353 /* data-urls/003/style.css */ 1354 1355 ---------- /out/duplicates/001/style.css ---------- 1356 /* duplicates/001/b.css */ 1357 .box { 1358 background-color: red; 1359 } 1360 1361 /* duplicates/001/a.css */ 1362 .box { 1363 background-color: green; 1364 } 1365 1366 /* duplicates/001/style.css */ 1367 1368 ---------- /out/duplicates/002/style.css ---------- 1369 /* duplicates/002/b.css */ 1370 .box { 1371 background-color: red; 1372 } 1373 1374 /* duplicates/002/a.css */ 1375 .box { 1376 background-color: green; 1377 } 1378 1379 /* duplicates/002/style.css */ 1380 1381 ---------- /out/empty/001/style.css ---------- 1382 /* empty/001/empty.css */ 1383 /* empty/001/style.css */ 1384 .box { 1385 background-color: green; 1386 } 1387 1388 ---------- /out/relative-paths/001/style.css ---------- 1389 /* relative-paths/001/b/b.css */ 1390 .box { 1391 background-color: green; 1392 } 1393 1394 /* relative-paths/001/a/a.css */ 1395 1396 /* relative-paths/001/style.css */ 1397 1398 ---------- /out/relative-paths/002/style.css ---------- 1399 /* relative-paths/002/b/b.css */ 1400 .box { 1401 background-color: green; 1402 } 1403 1404 /* relative-paths/002/a/a.css */ 1405 1406 /* relative-paths/002/style.css */ 1407 1408 ---------- /out/subresource/001/style.css ---------- 1409 /* subresource/001/something/styles/green.css */ 1410 .box { 1411 background-image: url(data:image/png;base64,Li4u); 1412 } 1413 1414 /* subresource/001/style.css */ 1415 1416 ---------- /out/subresource/002/style.css ---------- 1417 /* subresource/002/styles/green.css */ 1418 .box { 1419 background-image: url(data:image/png;base64,Li4u); 1420 } 1421 1422 /* subresource/002/style.css */ 1423 1424 ---------- /out/subresource/004/style.css ---------- 1425 /* subresource/004/styles/green.css */ 1426 .box { 1427 background-image: url(data:image/png;base64,Li4u); 1428 } 1429 1430 /* subresource/004/style.css */ 1431 1432 ---------- /out/subresource/005/style.css ---------- 1433 /* subresource/005/styles/green.css */ 1434 .box { 1435 background-image: url(data:image/png;base64,Li4u); 1436 } 1437 1438 /* subresource/005/style.css */ 1439 1440 ---------- /out/subresource/007/style.css ---------- 1441 /* subresource/007/style.css */ 1442 .box { 1443 background-image: url(data:image/png;base64,Li4u); 1444 } 1445 1446 ---------- /out/url-format/001/default/style.css ---------- 1447 /* url-format/001/default/a.css */ 1448 .box { 1449 background-color: green; 1450 } 1451 1452 /* url-format/001/default/style.css */ 1453 1454 ---------- /out/url-format/001/relative-url/style.css ---------- 1455 /* url-format/001/relative-url/a.css */ 1456 .box { 1457 background-color: green; 1458 } 1459 1460 /* url-format/001/relative-url/style.css */ 1461 1462 ---------- /out/url-format/002/default/style.css ---------- 1463 /* url-format/002/default/a.css */ 1464 .box { 1465 background-color: green; 1466 } 1467 1468 /* url-format/002/default/style.css */ 1469 1470 ---------- /out/url-format/002/relative-url/style.css ---------- 1471 /* url-format/002/relative-url/a.css */ 1472 .box { 1473 background-color: green; 1474 } 1475 1476 /* url-format/002/relative-url/style.css */ 1477 1478 ---------- /out/url-format/003/default/style.css ---------- 1479 /* url-format/003/default/a.css */ 1480 .box { 1481 background-color: green; 1482 } 1483 1484 /* url-format/003/default/style.css */ 1485 1486 ---------- /out/url-format/003/relative-url/style.css ---------- 1487 /* url-format/003/relative-url/a.css */ 1488 .box { 1489 background-color: green; 1490 } 1491 1492 /* url-format/003/relative-url/style.css */ 1493 1494 ---------- /out/url-fragments/001/style.css ---------- 1495 /* url-fragments/001/a.css#foo */ 1496 .box { 1497 background-color: green; 1498 } 1499 1500 /* url-fragments/001/style.css */ 1501 1502 ---------- /out/url-fragments/002/style.css ---------- 1503 /* url-fragments/002/a.css#1 */ 1504 .box { 1505 background-color: green; 1506 } 1507 1508 /* url-fragments/002/b.css#2 */ 1509 .box { 1510 background-color: red; 1511 } 1512 1513 /* url-fragments/002/a.css#3 */ 1514 .box { 1515 background-color: green; 1516 } 1517 1518 /* url-fragments/002/style.css */ 1519 1520 ================================================================================ 1521 TestCSSAtImportConditionsNoBundle 1522 ---------- /out.css ---------- 1523 @import "./print.css" print; 1524 1525 ================================================================================ 1526 TestCSSAtImportConditionsWithImportRecordsBundle 1527 ---------- /out.css ---------- 1528 /* foo.css */ 1529 @supports (background: url(a.png)) { 1530 body { 1531 color: red; 1532 } 1533 } 1534 1535 /* foo.css */ 1536 @media list-of-media-queries { 1537 @supports (background: url(b.png)) { 1538 body { 1539 color: red; 1540 } 1541 } 1542 } 1543 1544 /* foo.css */ 1545 @supports (background: url(a.png)) { 1546 @layer layer-name { 1547 body { 1548 color: red; 1549 } 1550 } 1551 } 1552 1553 /* foo.css */ 1554 @media list-of-media-queries { 1555 @supports (background: url(b.png)) { 1556 @layer layer-name { 1557 body { 1558 color: red; 1559 } 1560 } 1561 } 1562 } 1563 1564 /* entry.css */ 1565 1566 ================================================================================ 1567 TestCSSAtImportExtensionOrderCollision 1568 ---------- /out.css ---------- 1569 /* test.css */ 1570 .css { 1571 color: red; 1572 } 1573 1574 /* entry.css */ 1575 1576 ================================================================================ 1577 TestCSSAtImportExternal 1578 ---------- /out/entry.css ---------- 1579 @charset "UTF-8"; 1580 @import "../external1.css"; 1581 @import "../external2.css"; 1582 @import "../external4.css"; 1583 @import "../external5.css"; 1584 @import "https://www.example.com/style2.css"; 1585 @import "../external3.css"; 1586 @import "https://www.example.com/style1.css"; 1587 @import "https://www.example.com/style3.css"; 1588 @import "../external5.css" screen; 1589 1590 /* internal.css */ 1591 .before { 1592 color: red; 1593 } 1594 1595 /* charset1.css */ 1596 .middle { 1597 color: green; 1598 } 1599 1600 /* charset2.css */ 1601 .after { 1602 color: blue; 1603 } 1604 1605 /* entry.css */ 1606 1607 ================================================================================ 1608 TestCSSAtLayerBeforeImportBundle 1609 ---------- /out/entry.css ---------- 1610 @layer layer1, layer2.layer3; 1611 1612 /* a.css */ 1613 @layer layer4 { 1614 a { 1615 color: red; 1616 } 1617 } 1618 1619 /* b.css */ 1620 @layer layer5 { 1621 b { 1622 color: red; 1623 } 1624 } 1625 1626 /* entry.css */ 1627 @layer layer6.layer7, layer8; 1628 1629 ================================================================================ 1630 TestCSSAtLayerBeforeImportNoBundle 1631 ---------- /out/entry.css ---------- 1632 @layer layer1, layer2.layer3; 1633 @import "a.css"; 1634 @import "b.css"; 1635 @layer layer6.layer7, layer8; 1636 1637 ================================================================================ 1638 TestCSSAtLayerMergingWithImportConditions 1639 ---------- /out/entry.css ---------- 1640 @supports (color: first) { 1641 @layer a; 1642 } 1643 @import "http://example.com/a.css" supports(color: first); 1644 @import "http://example.com/a.css" supports(color: second); 1645 @import "http://example.com/b.css" supports(color: second); 1646 @import "http://example.com/b.css" supports(color: first); 1647 @supports (color: second) { 1648 @layer a, b; 1649 } 1650 1651 /* a.css */ 1652 @supports (color: first) { 1653 @layer b; 1654 } 1655 1656 /* a.css */ 1657 1658 /* b.css */ 1659 1660 /* b.css */ 1661 1662 /* entry.css */ 1663 1664 ================================================================================ 1665 TestCSSCaseInsensitivity 1666 ---------- /image-AKINYSFH.png ---------- 1667 ... 1668 ---------- /out.css ---------- 1669 /* nested.css */ 1670 @media list-of-media-queries { 1671 @supports (supports-condition) { 1672 @layer layer-name { 1673 @KeyFrames Foo { 1674 0% { 1675 OPAcity: 0; 1676 } 1677 tO { 1678 opaCITY: 1; 1679 } 1680 } 1681 body { 1682 BACKGROUND-color: red; 1683 width: 50Px; 1684 background-IMAGE: url("./image-AKINYSFH.png"); 1685 } 1686 } 1687 } 1688 } 1689 1690 /* entry.css */ 1691 1692 ================================================================================ 1693 TestCSSEntryPoint 1694 ---------- /out.css ---------- 1695 /* entry.css */ 1696 body { 1697 background: white; 1698 color: black; 1699 } 1700 1701 ================================================================================ 1702 TestCSSExternalQueryAndHashMatchIssue1822 1703 ---------- /out.css ---------- 1704 /* entry.css */ 1705 a { 1706 background: url(foo/bar.png?baz); 1707 } 1708 b { 1709 background: url(foo/bar.png#baz); 1710 } 1711 1712 ================================================================================ 1713 TestCSSFromJSMissingStarImport 1714 ---------- /out/entry.js ---------- 1715 // entry.js 1716 console.log(void 0); 1717 1718 ---------- /out/entry.css ---------- 1719 /* a.css */ 1720 .a { 1721 color: red; 1722 } 1723 1724 ================================================================================ 1725 TestCSSMalformedAtImport 1726 ---------- /out/entry.css ---------- 1727 @import "https://example.com/url-token-eof.css"; 1728 @import "https://example.com/url-token-whitespace-eof.css"; 1729 @import "https://example.com/function-token-eof.css"; 1730 @import "https://example.com/function-token-whitespace-eof.css"; 1731 1732 /* url-token-eof.css */ 1733 1734 /* url-token-whitespace-eof.css */ 1735 1736 /* function-token-eof.css */ 1737 1738 /* function-token-whitespace-eof.css */ 1739 1740 /* entry.css */ 1741 1742 ================================================================================ 1743 TestCSSNestingOldBrowser 1744 ---------- /out/two-type-selectors.css ---------- 1745 /* two-type-selectors.css */ 1746 .c a:is(b) { 1747 color: red; 1748 } 1749 1750 ---------- /out/two-parent-selectors.css ---------- 1751 /* two-parent-selectors.css */ 1752 .c :is(a b) { 1753 color: red; 1754 } 1755 1756 ---------- /out/only-one-warning.css ---------- 1757 /* only-one-warning.css */ 1758 .a > .a, 1759 .a > :is(.b .c), 1760 .a > .d, 1761 .b .c > .a, 1762 .b .c > :is(.b .c), 1763 .b .c > .d, 1764 .d > .a, 1765 .d > :is(.b .c), 1766 .d > .d { 1767 color: red; 1768 } 1769 1770 ---------- /out/nested-@layer.css ---------- 1771 /* nested-@layer.css */ 1772 @layer base { 1773 a { 1774 color: red; 1775 } 1776 } 1777 1778 ---------- /out/nested-@media.css ---------- 1779 /* nested-@media.css */ 1780 @media screen { 1781 a { 1782 color: red; 1783 } 1784 } 1785 1786 ---------- /out/nested-ampersand-twice.css ---------- 1787 /* nested-ampersand-twice.css */ 1788 a, 1789 a { 1790 color: red; 1791 } 1792 1793 ---------- /out/nested-ampersand-first.css ---------- 1794 /* nested-ampersand-first.css */ 1795 a, 1796 a b { 1797 color: red; 1798 } 1799 1800 ---------- /out/nested-attribute.css ---------- 1801 /* nested-attribute.css */ 1802 a [href] { 1803 color: red; 1804 } 1805 1806 ---------- /out/nested-colon.css ---------- 1807 /* nested-colon.css */ 1808 a :hover { 1809 color: red; 1810 } 1811 1812 ---------- /out/nested-dot.css ---------- 1813 /* nested-dot.css */ 1814 a .cls { 1815 color: red; 1816 } 1817 1818 ---------- /out/nested-greaterthan.css ---------- 1819 /* nested-greaterthan.css */ 1820 a > b { 1821 color: red; 1822 } 1823 1824 ---------- /out/nested-hash.css ---------- 1825 /* nested-hash.css */ 1826 a #id { 1827 color: red; 1828 } 1829 1830 ---------- /out/nested-plus.css ---------- 1831 /* nested-plus.css */ 1832 a + b { 1833 color: red; 1834 } 1835 1836 ---------- /out/nested-tilde.css ---------- 1837 /* nested-tilde.css */ 1838 a ~ b { 1839 color: red; 1840 } 1841 1842 ---------- /out/toplevel-ampersand-twice.css ---------- 1843 /* toplevel-ampersand-twice.css */ 1844 :scope, 1845 :scope { 1846 color: red; 1847 } 1848 1849 ---------- /out/toplevel-ampersand-first.css ---------- 1850 /* toplevel-ampersand-first.css */ 1851 :scope, 1852 a { 1853 color: red; 1854 } 1855 1856 ---------- /out/toplevel-ampersand-second.css ---------- 1857 /* toplevel-ampersand-second.css */ 1858 a, 1859 :scope { 1860 color: red; 1861 } 1862 1863 ---------- /out/toplevel-attribute.css ---------- 1864 /* toplevel-attribute.css */ 1865 [href] { 1866 color: red; 1867 } 1868 1869 ---------- /out/toplevel-colon.css ---------- 1870 /* toplevel-colon.css */ 1871 :hover { 1872 color: red; 1873 } 1874 1875 ---------- /out/toplevel-dot.css ---------- 1876 /* toplevel-dot.css */ 1877 .cls { 1878 color: red; 1879 } 1880 1881 ---------- /out/toplevel-greaterthan.css ---------- 1882 /* toplevel-greaterthan.css */ 1883 > b { 1884 color: red; 1885 } 1886 1887 ---------- /out/toplevel-hash.css ---------- 1888 /* toplevel-hash.css */ 1889 #id { 1890 color: red; 1891 } 1892 1893 ---------- /out/toplevel-plus.css ---------- 1894 /* toplevel-plus.css */ 1895 + b { 1896 color: red; 1897 } 1898 1899 ---------- /out/toplevel-tilde.css ---------- 1900 /* toplevel-tilde.css */ 1901 ~ b { 1902 color: red; 1903 } 1904 1905 ---------- /out/media-ampersand-twice.css ---------- 1906 /* media-ampersand-twice.css */ 1907 @media screen { 1908 :scope, 1909 :scope { 1910 color: red; 1911 } 1912 } 1913 1914 ---------- /out/media-ampersand-first.css ---------- 1915 /* media-ampersand-first.css */ 1916 @media screen { 1917 :scope, 1918 a { 1919 color: red; 1920 } 1921 } 1922 1923 ---------- /out/media-ampersand-second.css ---------- 1924 /* media-ampersand-second.css */ 1925 @media screen { 1926 a, 1927 :scope { 1928 color: red; 1929 } 1930 } 1931 1932 ---------- /out/media-attribute.css ---------- 1933 /* media-attribute.css */ 1934 @media screen { 1935 [href] { 1936 color: red; 1937 } 1938 } 1939 1940 ---------- /out/media-colon.css ---------- 1941 /* media-colon.css */ 1942 @media screen { 1943 :hover { 1944 color: red; 1945 } 1946 } 1947 1948 ---------- /out/media-dot.css ---------- 1949 /* media-dot.css */ 1950 @media screen { 1951 .cls { 1952 color: red; 1953 } 1954 } 1955 1956 ---------- /out/media-greaterthan.css ---------- 1957 /* media-greaterthan.css */ 1958 @media screen { 1959 > b { 1960 color: red; 1961 } 1962 } 1963 1964 ---------- /out/media-hash.css ---------- 1965 /* media-hash.css */ 1966 @media screen { 1967 #id { 1968 color: red; 1969 } 1970 } 1971 1972 ---------- /out/media-plus.css ---------- 1973 /* media-plus.css */ 1974 @media screen { 1975 + b { 1976 color: red; 1977 } 1978 } 1979 1980 ---------- /out/media-tilde.css ---------- 1981 /* media-tilde.css */ 1982 @media screen { 1983 ~ b { 1984 color: red; 1985 } 1986 } 1987 1988 ---------- /out/page-no-warning.css ---------- 1989 /* page-no-warning.css */ 1990 @page { 1991 @top-left { 1992 background: red; 1993 } 1994 } 1995 1996 ================================================================================ 1997 TestDataURLImportURLInCSS 1998 ---------- /out/entry.css ---------- 1999 /* entry.css */ 2000 a { 2001 background: url(data:image/png;base64,iVBORw0KGgo=); 2002 } 2003 2004 ================================================================================ 2005 TestDeduplicateRules 2006 ---------- /out/yes0.css ---------- 2007 /* yes0.css */ 2008 a { 2009 color: green; 2010 color: red; 2011 } 2012 2013 ---------- /out/yes1.css ---------- 2014 /* yes1.css */ 2015 a { 2016 color: green; 2017 } 2018 a { 2019 color: red; 2020 } 2021 2022 ---------- /out/yes2.css ---------- 2023 /* yes2.css */ 2024 @media screen { 2025 a { 2026 color: red; 2027 } 2028 } 2029 2030 ---------- /out/yes3.css ---------- 2031 /* yes3.css */ 2032 @media screen { 2033 a { 2034 color: red; 2035 } 2036 } 2037 2038 ---------- /out/no0.css ---------- 2039 /* no0.css */ 2040 @media screen { 2041 a { 2042 color: red; 2043 } 2044 } 2045 @media screen { 2046 b a& { 2047 color: red; 2048 } 2049 } 2050 2051 ---------- /out/no1.css ---------- 2052 /* no1.css */ 2053 @media screen { 2054 a { 2055 color: red; 2056 } 2057 } 2058 @media screen { 2059 a[x] { 2060 color: red; 2061 } 2062 } 2063 2064 ---------- /out/no2.css ---------- 2065 /* no2.css */ 2066 @media screen { 2067 a { 2068 color: red; 2069 } 2070 } 2071 @media screen { 2072 a.x { 2073 color: red; 2074 } 2075 } 2076 2077 ---------- /out/no3.css ---------- 2078 /* no3.css */ 2079 @media screen { 2080 a { 2081 color: red; 2082 } 2083 } 2084 @media screen { 2085 a#x { 2086 color: red; 2087 } 2088 } 2089 2090 ---------- /out/no4.css ---------- 2091 /* no4.css */ 2092 @media screen { 2093 a { 2094 color: red; 2095 } 2096 } 2097 @media screen { 2098 a:x { 2099 color: red; 2100 } 2101 } 2102 2103 ---------- /out/no5.css ---------- 2104 /* no5.css */ 2105 @media screen { 2106 a:x { 2107 color: red; 2108 } 2109 } 2110 @media screen { 2111 a:x(y) { 2112 color: red; 2113 } 2114 } 2115 2116 ---------- /out/no6.css ---------- 2117 /* no6.css */ 2118 @media screen { 2119 a b { 2120 color: red; 2121 } 2122 } 2123 @media screen { 2124 a + b { 2125 color: red; 2126 } 2127 } 2128 2129 ---------- /out/across-files.css ---------- 2130 /* across-files-0.css */ 2131 /* across-files-1.css */ 2132 a { 2133 color: green; 2134 } 2135 2136 /* across-files-2.css */ 2137 a { 2138 color: red; 2139 } 2140 2141 /* across-files.css */ 2142 2143 ---------- /out/across-files-url.css ---------- 2144 @import "http://example.com/some.css"; 2145 2146 /* across-files-url-0.css */ 2147 2148 /* across-files-url-1.css */ 2149 @font-face { 2150 src: url(http://example.com/some.other.font); 2151 } 2152 2153 /* across-files-url-2.css */ 2154 @font-face { 2155 src: url(http://example.com/some.font); 2156 } 2157 2158 /* across-files-url.css */ 2159 2160 ================================================================================ 2161 TestDeduplicateRulesGlobalVsLocalNames 2162 ---------- /out/entry.css ---------- 2163 /* a.css */ 2164 b { 2165 color: green; 2166 } 2167 .bar { 2168 color: green; 2169 } 2170 .a_foo { 2171 color: red; 2172 } 2173 .a_bar { 2174 color: green; 2175 } 2176 div { 2177 animation-name: a_anim_local; 2178 } 2179 2180 /* b.css */ 2181 a { 2182 color: red; 2183 } 2184 b { 2185 color: #00f; 2186 } 2187 .foo { 2188 color: red; 2189 } 2190 .bar { 2191 color: #00f; 2192 } 2193 .b_foo { 2194 color: red; 2195 } 2196 .b_bar { 2197 color: #00f; 2198 } 2199 div { 2200 animation-name: anim_global; 2201 } 2202 div { 2203 animation-name: b_anim_local; 2204 } 2205 2206 /* entry.css */ 2207 2208 ================================================================================ 2209 TestExternalImportURLInCSS 2210 ---------- /out/entry.css ---------- 2211 /* src/entry.css */ 2212 div:after { 2213 content: 'If this is recognized, the path should become "../src/external.png"'; 2214 background: url(../src/external.png); 2215 } 2216 a { 2217 background: url(http://example.com/images/image.png); 2218 } 2219 b { 2220 background: url(https://example.com/images/image.png); 2221 } 2222 c { 2223 background: url(//example.com/images/image.png); 2224 } 2225 d { 2226 background: url(data:image/png;base64,iVBORw0KGgo=); 2227 } 2228 path { 2229 fill: url(#filter); 2230 } 2231 2232 ================================================================================ 2233 TestFileImportURLInCSS 2234 ---------- /out/example-GDKWWYFY.data ---------- 2235 This is some data. 2236 ---------- /out/entry.css ---------- 2237 /* one.css */ 2238 a { 2239 background: url("./example-GDKWWYFY.data"); 2240 } 2241 2242 /* two.css */ 2243 b { 2244 background: url("./example-GDKWWYFY.data"); 2245 } 2246 2247 /* entry.css */ 2248 2249 ================================================================================ 2250 TestIgnoreURLsInAtRulePrelude 2251 ---------- /out/entry.css ---------- 2252 /* entry.css */ 2253 @supports (background: url(ignored.png)) { 2254 a { 2255 color: red; 2256 } 2257 } 2258 2259 ================================================================================ 2260 TestImportCSSFromJSComposes 2261 ---------- /out/entry.js ---------- 2262 // styles.module.css 2263 var styles_default = { 2264 local0: "GLOBAL1 GLOBAL2 styles_local4 styles_local3 styles_local1 GLOBAL3 styles_local2 GLOBAL4 styles_local0", 2265 local1: "styles_local4 styles_local3 styles_local1", 2266 local2: "styles_local2", 2267 local3: "styles_local4 styles_local3", 2268 local4: "styles_local4", 2269 fromOtherFile: "base_base1 base_base2 other1_local0 base_base3 other2_local0 styles_fromOtherFile" 2270 }; 2271 2272 // entry.js 2273 console.log(styles_default); 2274 2275 ---------- /out/entry.css ---------- 2276 /* global.css */ 2277 .GLOBAL1 { 2278 color: black; 2279 } 2280 2281 /* other1.module.css */ 2282 .other1_local0 { 2283 color: blue; 2284 } 2285 2286 /* base.module.css */ 2287 .base_base1 { 2288 cursor: pointer; 2289 } 2290 .base_base2 { 2291 display: inline; 2292 } 2293 .base_base3 { 2294 float: left; 2295 } 2296 2297 /* other2.module.css */ 2298 .other2_local0 { 2299 background: purple; 2300 } 2301 2302 /* styles.module.css */ 2303 .styles_local0 { 2304 } 2305 .styles_local0 { 2306 background: green; 2307 } 2308 .styles_local0 { 2309 } 2310 .styles_local3 { 2311 border: 1px solid black; 2312 } 2313 .styles_local4 { 2314 opacity: 0.5; 2315 } 2316 .styles_local1 { 2317 color: red; 2318 } 2319 .styles_fromOtherFile { 2320 } 2321 2322 ================================================================================ 2323 TestImportCSSFromJSComposesCircular 2324 ---------- /out/entry.js ---------- 2325 // styles.css 2326 var styles_default = { 2327 foo: "styles_bar styles_foo", 2328 bar: "styles_foo styles_bar", 2329 baz: "styles_baz" 2330 }; 2331 2332 // entry.js 2333 console.log(styles_default); 2334 2335 ---------- /out/entry.css ---------- 2336 /* styles.css */ 2337 .styles_foo { 2338 } 2339 .styles_bar { 2340 } 2341 .styles_baz { 2342 } 2343 2344 ================================================================================ 2345 TestImportCSSFromJSComposesFromCircular 2346 ---------- /out/entry.js ---------- 2347 // styles.css 2348 var styles_default = { 2349 foo: "other_bar styles_foo", 2350 bar: "styles_bar" 2351 }; 2352 2353 // entry.js 2354 console.log(styles_default); 2355 2356 ---------- /out/entry.css ---------- 2357 /* other.css */ 2358 .other_bar { 2359 } 2360 2361 /* styles.css */ 2362 .styles_foo { 2363 } 2364 .styles_bar { 2365 } 2366 2367 ================================================================================ 2368 TestImportCSSFromJSComposesFromUndefined 2369 ---------- /out/entry.js ---------- 2370 // styles.css 2371 var styles_default = {}; 2372 2373 // entry.js 2374 console.log(styles_default); 2375 2376 ---------- /out/entry.css ---------- 2377 /* well-defined.css */ 2378 .well_defined_z1 { 2379 zoom: 1; 2380 } 2381 .well_defined_z2 { 2382 zoom: 2; 2383 } 2384 .well_defined_z4 { 2385 zoom: 4; 2386 } 2387 .well_defined_z3 { 2388 zoom: 3; 2389 } 2390 .well_defined_z5 { 2391 } 2392 2393 /* undefined/case1.css */ 2394 .case1_foo { 2395 zoom: 2; 2396 } 2397 2398 /* undefined/case2.css */ 2399 .case2_foo { 2400 } 2401 2402 /* undefined/case3.css */ 2403 .case3_foo { 2404 } 2405 .case3_nested1 { 2406 zoom: 3; 2407 } 2408 .case3_nested2 { 2409 } 2410 2411 /* undefined/case4.css */ 2412 .case4_foo { 2413 } 2414 .case4_nested1 { 2415 } 2416 .case4_nested2 { 2417 zoom: 3; 2418 } 2419 2420 /* file-1.css */ 2421 .file_1_foo { 2422 zoom: 1; 2423 } 2424 .file_1_bar { 2425 zoom: 2; 2426 } 2427 2428 /* file-2.css */ 2429 .file_2_foo { 2430 zoom: 2; 2431 } 2432 2433 /* undefined/case5.css */ 2434 .case5_foo { 2435 } 2436 .case5_nested1 { 2437 } 2438 .case5_nested2 { 2439 } 2440 2441 /* styles.css */ 2442 2443 ================================================================================ 2444 TestImportCSSFromJSLocalAtContainer 2445 ---------- /out/entry.js ---------- 2446 // styles.css 2447 var styles_default = { 2448 local: "styles_local", 2449 local1: "styles_local1", 2450 local2: "styles_local2" 2451 }; 2452 2453 // entry.js 2454 console.log(styles_default); 2455 2456 ---------- /out/entry.css ---------- 2457 /* styles.css */ 2458 @container not (max-width: 100px) { 2459 div { 2460 color: red; 2461 } 2462 } 2463 @container styles_local (max-width: 100px) { 2464 div { 2465 color: red; 2466 } 2467 } 2468 @container styles_local not (max-width: 100px) { 2469 div { 2470 color: red; 2471 } 2472 } 2473 @container styles_local (max-width: 100px) or (min-height: 100px) { 2474 div { 2475 color: red; 2476 } 2477 } 2478 @container styles_local (max-width: 100px) and (min-height: 100px) { 2479 div { 2480 color: red; 2481 } 2482 } 2483 @container general_enclosed(max-width: 100px) { 2484 div { 2485 color: red; 2486 } 2487 } 2488 @container styles_local general_enclosed(max-width: 100px) { 2489 div { 2490 color: red; 2491 } 2492 } 2493 div { 2494 container-name: NONE initial; 2495 } 2496 div { 2497 container-name: none INITIAL; 2498 } 2499 div { 2500 container-name: GLOBAL1 GLOBAL2; 2501 } 2502 div { 2503 container-name: styles_local1 styles_local2; 2504 } 2505 div { 2506 container: none; 2507 } 2508 div { 2509 container: NONE; 2510 } 2511 div { 2512 container: NONE / size; 2513 } 2514 div { 2515 container: none / size; 2516 } 2517 div { 2518 container: GLOBAL1 GLOBAL2; 2519 } 2520 div { 2521 container: styles_local1 styles_local2; 2522 } 2523 div { 2524 container: GLOBAL1 GLOBAL2 / size; 2525 } 2526 div { 2527 container: styles_local1 styles_local2 / size; 2528 } 2529 2530 ================================================================================ 2531 TestImportCSSFromJSLocalAtCounterStyle 2532 ---------- /out/entry.js ---------- 2533 // list_style_type.css 2534 var list_style_type_default = { 2535 local: "list_style_type_local" 2536 }; 2537 2538 // list_style.css 2539 var list_style_default = { 2540 local: "list_style_local", 2541 inside: "list_style_inside", 2542 outside: "list_style_outside" 2543 }; 2544 2545 // entry.js 2546 console.log(list_style_type_default, list_style_default); 2547 2548 ---------- /out/entry.css ---------- 2549 /* list_style_type.css */ 2550 @counter-style list_style_type_local { 2551 symbols: A B C; 2552 } 2553 div { 2554 list-style-type: GLOBAL; 2555 } 2556 div { 2557 list-style-type: list_style_type_local; 2558 } 2559 div { 2560 list-style-type: none; 2561 } 2562 div { 2563 list-style-type: INITIAL; 2564 } 2565 div { 2566 list-style-type: decimal; 2567 } 2568 div { 2569 list-style-type: disc; 2570 } 2571 div { 2572 list-style-type: SQUARE; 2573 } 2574 div { 2575 list-style-type: circle; 2576 } 2577 div { 2578 list-style-type: disclosure-OPEN; 2579 } 2580 div { 2581 list-style-type: DISCLOSURE-closed; 2582 } 2583 div { 2584 list-style-type: LAO; 2585 } 2586 div { 2587 list-style-type: "👍"; 2588 } 2589 2590 /* list_style.css */ 2591 @counter-style list_style_local { 2592 symbols: A B C; 2593 } 2594 div { 2595 list-style: GLOBAL; 2596 } 2597 div { 2598 list-style: list_style_local; 2599 } 2600 div { 2601 list-style: list_style_local none; 2602 } 2603 div { 2604 list-style: list_style_local url(http://); 2605 } 2606 div { 2607 list-style: list_style_local linear-gradient(red, green); 2608 } 2609 div { 2610 list-style: list_style_local inside; 2611 } 2612 div { 2613 list-style: list_style_local outside; 2614 } 2615 div { 2616 list-style: none list_style_local; 2617 } 2618 div { 2619 list-style: url(http://) list_style_local; 2620 } 2621 div { 2622 list-style: linear-gradient(red, green) list_style_local; 2623 } 2624 div { 2625 list-style: list_style_local inside; 2626 } 2627 div { 2628 list-style: list_style_local outside; 2629 } 2630 div { 2631 list-style: inside list_style_inside; 2632 } 2633 div { 2634 list-style: inside list_style_outside; 2635 } 2636 div { 2637 list-style: outside list_style_inside; 2638 } 2639 div { 2640 list-style: outside list_style_outside; 2641 } 2642 div { 2643 list-style: url(http://) none invalid; 2644 } 2645 div { 2646 list-style: linear-gradient(red, green) none invalid; 2647 } 2648 div { 2649 list-style: INITIAL; 2650 } 2651 div { 2652 list-style: decimal; 2653 } 2654 div { 2655 list-style: disc; 2656 } 2657 div { 2658 list-style: SQUARE; 2659 } 2660 div { 2661 list-style: circle; 2662 } 2663 div { 2664 list-style: disclosure-OPEN; 2665 } 2666 div { 2667 list-style: DISCLOSURE-closed; 2668 } 2669 div { 2670 list-style: LAO; 2671 } 2672 2673 ================================================================================ 2674 TestImportCSSFromJSLocalAtKeyframes 2675 ---------- /out/entry.js ---------- 2676 // styles.css 2677 var styles_default = { 2678 local_name: "styles_local_name", 2679 local_name1: "styles_local_name1", 2680 local_name2: "styles_local_name2", 2681 none: "styles_none" 2682 }; 2683 2684 // entry.js 2685 console.log(styles_default); 2686 2687 ---------- /out/entry.css ---------- 2688 /* styles.css */ 2689 @keyframes styles_local_name { 2690 to { 2691 color: red; 2692 } 2693 } 2694 div { 2695 animation-name: none; 2696 } 2697 div { 2698 animation-name: none; 2699 } 2700 div { 2701 animation-name: global_name; 2702 } 2703 div { 2704 animation-name: styles_local_name; 2705 } 2706 div { 2707 animation-name: 2708 global_name1, 2709 none, 2710 global_name2, 2711 Inherit, 2712 INITIAL, 2713 revert, 2714 revert-layer, 2715 unset; 2716 } 2717 div { 2718 animation-name: 2719 styles_local_name1, 2720 none, 2721 styles_local_name2, 2722 Inherit, 2723 INITIAL, 2724 revert, 2725 revert-layer, 2726 unset; 2727 } 2728 div { 2729 animation: 2s infinite global_name; 2730 } 2731 div { 2732 animation: 2s infinite styles_local_name; 2733 } 2734 @keyframes styles_none { 2735 to { 2736 color: red; 2737 } 2738 } 2739 div { 2740 animation-name: "none"; 2741 } 2742 div { 2743 animation-name: styles_none; 2744 } 2745 2746 ================================================================================ 2747 TestImportCSSFromJSLocalVsGlobal 2748 ---------- /out/entry.js ---------- 2749 // normal.css 2750 var normal_default = {}; 2751 2752 // LOCAL.global-css 2753 var LOCAL_default = { 2754 local: "LOCAL_local", 2755 local_a: "LOCAL_local_a", 2756 local_b: "LOCAL_local_b", 2757 local_c: "LOCAL_local_c" 2758 }; 2759 2760 // LOCAL.local-css 2761 var LOCAL_default2 = { 2762 top_level: "LOCAL_top_level", 2763 local: "LOCAL_local2", 2764 local_a: "LOCAL_local_a2", 2765 local_b: "LOCAL_local_b2", 2766 local_c: "LOCAL_local_c2", 2767 nested: "LOCAL_nested" 2768 }; 2769 2770 // entry.js 2771 console.log("should be empty:", normal_default); 2772 console.log("fewer local names:", LOCAL_default); 2773 console.log("more local names:", LOCAL_default2); 2774 2775 ---------- /out/entry.css ---------- 2776 /* normal.css */ 2777 .top_level { 2778 color: #000; 2779 } 2780 :global(.GLOBAL) { 2781 color: #001; 2782 } 2783 :local(.local) { 2784 color: #002; 2785 } 2786 div:global(.GLOBAL) { 2787 color: #003; 2788 } 2789 div:local(.local) { 2790 color: #004; 2791 } 2792 .top_level:global(div) { 2793 color: #005; 2794 } 2795 .top_level:local(div) { 2796 color: #006; 2797 } 2798 :global(div.GLOBAL) { 2799 color: #007; 2800 } 2801 :local(div.local) { 2802 color: #008; 2803 } 2804 div:global(span.GLOBAL) { 2805 color: #009; 2806 } 2807 div:local(span.local) { 2808 color: #00A; 2809 } 2810 div:global(#GLOBAL_A.GLOBAL_B.GLOBAL_C):local(.local_a.local_b#local_c) { 2811 color: #00B; 2812 } 2813 div:global(#GLOBAL_A .GLOBAL_B .GLOBAL_C):local(.local_a .local_b #local_c) { 2814 color: #00C; 2815 } 2816 .nested { 2817 :global(&.GLOBAL) { 2818 color: #00D; 2819 } 2820 :local(&.local) { 2821 color: #00E; 2822 } 2823 &:global(.GLOBAL) { 2824 color: #00F; 2825 } 2826 &:local(.local) { 2827 color: #010; 2828 } 2829 } 2830 :global(.GLOBAL_A .GLOBAL_B) { 2831 color: #011; 2832 } 2833 :local(.local_a .local_b) { 2834 color: #012; 2835 } 2836 div:global(.GLOBAL_A .GLOBAL_B):hover { 2837 color: #013; 2838 } 2839 div:local(.local_a .local_b):hover { 2840 color: #014; 2841 } 2842 div :global(.GLOBAL_A .GLOBAL_B) span { 2843 color: #015; 2844 } 2845 div :local(.local_a .local_b) span { 2846 color: #016; 2847 } 2848 div > :global(.GLOBAL_A ~ .GLOBAL_B) + span { 2849 color: #017; 2850 } 2851 div > :local(.local_a ~ .local_b) + span { 2852 color: #018; 2853 } 2854 div:global(+ .GLOBAL_A):hover { 2855 color: #019; 2856 } 2857 div:local(+ .local_a):hover { 2858 color: #01A; 2859 } 2860 :global.GLOBAL:local.local { 2861 color: #01B; 2862 } 2863 :global .GLOBAL :local .local { 2864 color: #01C; 2865 } 2866 :global { 2867 .GLOBAL { 2868 before: outer; 2869 :local { 2870 before: inner; 2871 .local { 2872 color: #01D; 2873 } 2874 after: inner; 2875 } 2876 after: outer; 2877 } 2878 } 2879 2880 /* LOCAL.global-css */ 2881 .top_level { 2882 color: #000; 2883 } 2884 .GLOBAL { 2885 color: #001; 2886 } 2887 .LOCAL_local { 2888 color: #002; 2889 } 2890 div.GLOBAL { 2891 color: #003; 2892 } 2893 div.LOCAL_local { 2894 color: #004; 2895 } 2896 div.top_level { 2897 color: #005; 2898 } 2899 div.top_level { 2900 color: #006; 2901 } 2902 div.GLOBAL { 2903 color: #007; 2904 } 2905 div.LOCAL_local { 2906 color: #008; 2907 } 2908 div:is(span).GLOBAL { 2909 color: #009; 2910 } 2911 div:is(span).LOCAL_local { 2912 color: #00A; 2913 } 2914 div#GLOBAL_A.GLOBAL_B.GLOBAL_C.LOCAL_local_a.LOCAL_local_b#LOCAL_local_c { 2915 color: #00B; 2916 } 2917 div#GLOBAL_A .GLOBAL_B .GLOBAL_C.LOCAL_local_a .LOCAL_local_b #LOCAL_local_c { 2918 color: #00C; 2919 } 2920 .nested { 2921 &.GLOBAL { 2922 color: #00D; 2923 } 2924 &.LOCAL_local { 2925 color: #00E; 2926 } 2927 &.GLOBAL { 2928 color: #00F; 2929 } 2930 &.LOCAL_local { 2931 color: #010; 2932 } 2933 } 2934 .GLOBAL_A .GLOBAL_B { 2935 color: #011; 2936 } 2937 .LOCAL_local_a .LOCAL_local_b { 2938 color: #012; 2939 } 2940 div.GLOBAL_A .GLOBAL_B:hover { 2941 color: #013; 2942 } 2943 div.LOCAL_local_a .LOCAL_local_b:hover { 2944 color: #014; 2945 } 2946 div .GLOBAL_A .GLOBAL_B span { 2947 color: #015; 2948 } 2949 div .LOCAL_local_a .LOCAL_local_b span { 2950 color: #016; 2951 } 2952 div > .GLOBAL_A ~ .GLOBAL_B + span { 2953 color: #017; 2954 } 2955 div > .LOCAL_local_a ~ .LOCAL_local_b + span { 2956 color: #018; 2957 } 2958 div + .GLOBAL_A:hover { 2959 color: #019; 2960 } 2961 div + .LOCAL_local_a:hover { 2962 color: #01A; 2963 } 2964 .GLOBAL.LOCAL_local { 2965 color: #01B; 2966 } 2967 .GLOBAL .LOCAL_local { 2968 color: #01C; 2969 } 2970 & { 2971 .GLOBAL { 2972 before: outer; 2973 before: inner; 2974 .LOCAL_local { 2975 color: #01D; 2976 } 2977 after: inner; 2978 after: outer; 2979 } 2980 } 2981 2982 /* LOCAL.local-css */ 2983 .LOCAL_top_level { 2984 color: #000; 2985 } 2986 .GLOBAL { 2987 color: #001; 2988 } 2989 .LOCAL_local2 { 2990 color: #002; 2991 } 2992 div.GLOBAL { 2993 color: #003; 2994 } 2995 div.LOCAL_local2 { 2996 color: #004; 2997 } 2998 div.LOCAL_top_level { 2999 color: #005; 3000 } 3001 div.LOCAL_top_level { 3002 color: #006; 3003 } 3004 div.GLOBAL { 3005 color: #007; 3006 } 3007 div.LOCAL_local2 { 3008 color: #008; 3009 } 3010 div:is(span).GLOBAL { 3011 color: #009; 3012 } 3013 div:is(span).LOCAL_local2 { 3014 color: #00A; 3015 } 3016 div#GLOBAL_A.GLOBAL_B.GLOBAL_C.LOCAL_local_a2.LOCAL_local_b2#LOCAL_local_c2 { 3017 color: #00B; 3018 } 3019 div#GLOBAL_A .GLOBAL_B .GLOBAL_C.LOCAL_local_a2 .LOCAL_local_b2 #LOCAL_local_c2 { 3020 color: #00C; 3021 } 3022 .LOCAL_nested { 3023 &.GLOBAL { 3024 color: #00D; 3025 } 3026 &.LOCAL_local2 { 3027 color: #00E; 3028 } 3029 &.GLOBAL { 3030 color: #00F; 3031 } 3032 &.LOCAL_local2 { 3033 color: #010; 3034 } 3035 } 3036 .GLOBAL_A .GLOBAL_B { 3037 color: #011; 3038 } 3039 .LOCAL_local_a2 .LOCAL_local_b2 { 3040 color: #012; 3041 } 3042 div.GLOBAL_A .GLOBAL_B:hover { 3043 color: #013; 3044 } 3045 div.LOCAL_local_a2 .LOCAL_local_b2:hover { 3046 color: #014; 3047 } 3048 div .GLOBAL_A .GLOBAL_B span { 3049 color: #015; 3050 } 3051 div .LOCAL_local_a2 .LOCAL_local_b2 span { 3052 color: #016; 3053 } 3054 div > .GLOBAL_A ~ .GLOBAL_B + span { 3055 color: #017; 3056 } 3057 div > .LOCAL_local_a2 ~ .LOCAL_local_b2 + span { 3058 color: #018; 3059 } 3060 div + .GLOBAL_A:hover { 3061 color: #019; 3062 } 3063 div + .LOCAL_local_a2:hover { 3064 color: #01A; 3065 } 3066 .GLOBAL.LOCAL_local2 { 3067 color: #01B; 3068 } 3069 .GLOBAL .LOCAL_local2 { 3070 color: #01C; 3071 } 3072 & { 3073 .GLOBAL { 3074 before: outer; 3075 before: inner; 3076 .LOCAL_local2 { 3077 color: #01D; 3078 } 3079 after: inner; 3080 after: outer; 3081 } 3082 } 3083 3084 ================================================================================ 3085 TestImportCSSFromJSLowerBareLocalAndGlobal 3086 ---------- /out/entry.js ---------- 3087 // styles.css 3088 var styles_default = { 3089 before: "styles_before", 3090 button: "styles_button", 3091 after: "styles_after" 3092 }; 3093 3094 // entry.js 3095 console.log(styles_default); 3096 3097 ---------- /out/entry.css ---------- 3098 /* styles.css */ 3099 .styles_before { 3100 color: #000; 3101 } 3102 :scope .styles_button { 3103 color: #000; 3104 } 3105 .styles_after { 3106 color: #000; 3107 } 3108 .styles_before { 3109 color: #001; 3110 } 3111 :scope .button { 3112 color: #001; 3113 } 3114 .styles_after { 3115 color: #001; 3116 } 3117 div .styles_button { 3118 color: #002; 3119 } 3120 div .button { 3121 color: #003; 3122 } 3123 :scope { 3124 color: #004; 3125 } 3126 :scope { 3127 color: #005; 3128 } 3129 :scope .styles_button { 3130 color: #006; 3131 } 3132 :scope .styles_button { 3133 color: #007; 3134 } 3135 3136 ================================================================================ 3137 TestImportCSSFromJSNthIndexLocal 3138 ---------- /out/entry.js ---------- 3139 // styles.css 3140 var styles_default = { 3141 local: "styles_local", 3142 local1: "styles_local1", 3143 local2: "styles_local2" 3144 }; 3145 3146 // entry.js 3147 console.log(styles_default); 3148 3149 ---------- /out/entry.css ---------- 3150 /* styles.css */ 3151 :nth-child(2n of .styles_local) { 3152 color: #000; 3153 } 3154 :nth-child(2n of #styles_local, .GLOBAL) { 3155 color: #001; 3156 } 3157 :nth-child(2n of .styles_local1 .GLOBAL1, .GLOBAL2 .styles_local2) { 3158 color: #002; 3159 } 3160 .styles_local1, 3161 :nth-child(2n of .GLOBAL), 3162 .styles_local2 { 3163 color: #003; 3164 } 3165 :nth-last-child(2n of .styles_local) { 3166 color: #000; 3167 } 3168 :nth-last-child(2n of #styles_local, .GLOBAL) { 3169 color: #001; 3170 } 3171 :nth-last-child(2n of .styles_local1 .GLOBAL1, .GLOBAL2 .styles_local2) { 3172 color: #002; 3173 } 3174 .styles_local1, 3175 :nth-last-child(2n of .GLOBAL), 3176 .styles_local2 { 3177 color: #003; 3178 } 3179 3180 ================================================================================ 3181 TestImportGlobalCSSFromJS 3182 ---------- /out/entry.js ---------- 3183 // a.css 3184 var a_default = {}; 3185 3186 // a.js 3187 console.log("a", void 0, a_default.a); 3188 3189 // b.css 3190 var b_default = {}; 3191 3192 // b.js 3193 console.log("b", void 0, b_default.b); 3194 3195 ---------- /out/entry.css ---------- 3196 /* a.css */ 3197 .a { 3198 color: red; 3199 } 3200 3201 /* b.css */ 3202 .b { 3203 color: blue; 3204 } 3205 3206 ================================================================================ 3207 TestImportLocalCSSFromJS 3208 ---------- /out/entry.js ---------- 3209 // dir1/style.css 3210 var button = "style_button"; 3211 var style_default = { 3212 a: "style_a", 3213 button 3214 }; 3215 3216 // a.js 3217 console.log("file 1", button, style_default.a); 3218 3219 // dir2/style.css 3220 var button2 = "style_button2"; 3221 var style_default2 = { 3222 b: "style_b", 3223 button: button2 3224 }; 3225 3226 // b.js 3227 console.log("file 2", button2, style_default2.b); 3228 3229 ---------- /out/entry.css ---------- 3230 /* dir1/style.css */ 3231 .style_a { 3232 color: red; 3233 } 3234 .style_button { 3235 display: none; 3236 } 3237 3238 /* dir2/style.css */ 3239 .style_b { 3240 color: blue; 3241 } 3242 .style_button2 { 3243 display: none; 3244 } 3245 3246 ================================================================================ 3247 TestImportLocalCSSFromJSMinifyIdentifiers 3248 ---------- /out/entry.js ---------- 3249 // dir1/style.css 3250 var t = "l"; 3251 var l = { 3252 a: "o", 3253 button: t 3254 }; 3255 3256 // a.js 3257 console.log("file 1", t, l.a); 3258 3259 // dir2/style.css 3260 var e = "n"; 3261 var n = { 3262 b: "e", 3263 button: e 3264 }; 3265 3266 // b.js 3267 console.log("file 2", e, n.b); 3268 3269 ---------- /out/entry.css ---------- 3270 /* dir1/style.css */ 3271 .o { 3272 color: red; 3273 } 3274 .l { 3275 display: none; 3276 } 3277 3278 /* dir2/style.css */ 3279 .e { 3280 color: blue; 3281 } 3282 .n { 3283 display: none; 3284 } 3285 3286 ================================================================================ 3287 TestImportLocalCSSFromJSMinifyIdentifiersAvoidGlobalNames 3288 ---------- /out/entry.js ---------- 3289 3290 ---------- /out/entry.css ---------- 3291 /* global.css */ 3292 :is(.a, .b, .c, .d, .e, .f, .g, .h, .i, .j, .k, .l, .m, .n, .o, .p, .q, .r, .s, .t, .u, .v, .w, .x, .y, .z), 3293 :is(.A, .B, .C, .D, .E, .F, .G, .H, .I, .J, .K, .L, .M, .N, .O, .P, .Q, .R, .S, .T, .U, .V, .W, .X, .Y, .Z), 3294 ._ { 3295 color: red; 3296 } 3297 3298 /* local.module.css */ 3299 .oo { 3300 color: blue; 3301 } 3302 3303 ================================================================================ 3304 TestImportLocalCSSFromJSMinifyIdentifiersMultipleEntryPoints 3305 ---------- /out/a.js ---------- 3306 // a.module.css 3307 var r = "o"; 3308 var l = "c"; 3309 3310 // a.js 3311 console.log(r, l); 3312 3313 ---------- /out/a.css ---------- 3314 /* a.module.css */ 3315 .o { 3316 color: #001; 3317 } 3318 .c { 3319 color: #002; 3320 } 3321 3322 ---------- /out/b.js ---------- 3323 // b.module.css 3324 var r = "l"; 3325 var l = "r"; 3326 3327 // b.js 3328 console.log(r, l); 3329 3330 ---------- /out/b.css ---------- 3331 /* b.module.css */ 3332 .l { 3333 color: #003; 3334 } 3335 .r { 3336 color: #004; 3337 } 3338 3339 ================================================================================ 3340 TestMetafileCSSBundleTwoToOne 3341 ---------- /out/js/2PSDKYWE.js ---------- 3342 // foo/entry.js 3343 console.log("foo"); 3344 3345 ---------- /out/css/DIO3TRUB.css ---------- 3346 /* common.css */ 3347 body { 3348 color: red; 3349 } 3350 3351 ---------- /out/js/MA6C7ZBK.js ---------- 3352 // bar/entry.js 3353 console.log("bar"); 3354 ---------- metafile.json ---------- 3355 { 3356 "inputs": { 3357 "common.css": { 3358 "bytes": 28, 3359 "imports": [] 3360 }, 3361 "foo/entry.js": { 3362 "bytes": 54, 3363 "imports": [ 3364 { 3365 "path": "common.css", 3366 "kind": "import-statement", 3367 "original": "../common.css" 3368 } 3369 ], 3370 "format": "esm" 3371 }, 3372 "bar/entry.js": { 3373 "bytes": 54, 3374 "imports": [ 3375 { 3376 "path": "common.css", 3377 "kind": "import-statement", 3378 "original": "../common.css" 3379 } 3380 ], 3381 "format": "esm" 3382 } 3383 }, 3384 "outputs": { 3385 "out/js/2PSDKYWE.js": { 3386 "imports": [], 3387 "exports": [], 3388 "entryPoint": "foo/entry.js", 3389 "cssBundle": "out/css/DIO3TRUB.css", 3390 "inputs": { 3391 "common.css": { 3392 "bytesInOutput": 0 3393 }, 3394 "foo/entry.js": { 3395 "bytesInOutput": 20 3396 } 3397 }, 3398 "bytes": 36 3399 }, 3400 "out/css/DIO3TRUB.css": { 3401 "imports": [], 3402 "inputs": { 3403 "common.css": { 3404 "bytesInOutput": 23 3405 } 3406 }, 3407 "bytes": 40 3408 }, 3409 "out/js/MA6C7ZBK.js": { 3410 "imports": [], 3411 "exports": [], 3412 "entryPoint": "bar/entry.js", 3413 "cssBundle": "out/css/DIO3TRUB.css", 3414 "inputs": { 3415 "common.css": { 3416 "bytesInOutput": 0 3417 }, 3418 "bar/entry.js": { 3419 "bytesInOutput": 20 3420 } 3421 }, 3422 "bytes": 36 3423 } 3424 } 3425 } 3426 3427 ================================================================================ 3428 TestPackageURLsInCSS 3429 ---------- /out/entry.css ---------- 3430 /* test.css */ 3431 .css { 3432 color: red; 3433 } 3434 3435 /* entry.css */ 3436 a { 3437 background: url(data:image/png;base64,YS0x); 3438 } 3439 b { 3440 background: url(data:image/png;base64,Yi0yLW5vZGVfbW9kdWxlcw==); 3441 } 3442 c { 3443 background: url(data:image/png;base64,Yy0z); 3444 } 3445 3446 ================================================================================ 3447 TestTextImportURLInCSSText 3448 ---------- /out/entry.css ---------- 3449 /* entry.css */ 3450 a { 3451 background: url(data:text/plain;base64,VGhpcyBpcyBzb21lIHRleHQu); 3452 } 3453 3454 ================================================================================ 3455 TestUndefinedImportWarningCSS 3456 ---------- /out/entry.js ---------- 3457 // empty.js 3458 var require_empty = __commonJS({ 3459 "empty.js"() { 3460 } 3461 }); 3462 3463 // node_modules/pkg/empty.js 3464 var require_empty2 = __commonJS({ 3465 "node_modules/pkg/empty.js"() { 3466 } 3467 }); 3468 3469 // entry.js 3470 var empty_js2 = __toESM(require_empty()); 3471 var pkg_empty_js = __toESM(require_empty2()); 3472 3473 // node_modules/pkg/index.js 3474 var empty_js = __toESM(require_empty2()); 3475 console.log( 3476 void 0, 3477 void 0, 3478 void 0, 3479 void 0, 3480 void 0, 3481 void 0 3482 ); 3483 3484 // entry.js 3485 console.log( 3486 void 0, 3487 void 0, 3488 void 0, 3489 void 0, 3490 void 0, 3491 void 0 3492 ); 3493 console.log( 3494 void 0, 3495 void 0, 3496 void 0, 3497 void 0, 3498 void 0, 3499 void 0 3500 ); 3501 3502 ---------- /out/entry.css ---------- 3503 /* empty.css */ 3504 /* empty.global-css */ 3505 /* empty.local-css */ 3506 /* node_modules/pkg/empty.css */ 3507 /* node_modules/pkg/empty.global-css */ 3508 /* node_modules/pkg/empty.local-css */