@@ -38,6 +38,8 @@ exports[`addStyle should work with "insert" option 1`] = `"<head><title>Title</t
38
38
39
39
exports[`addStyle should work with " nonce" attribute and " __webpack_nonce__" variable 1`] = `"<head><title>Title</title><style nonce =\\"87654321\\">.foo { color : red } </style></head><body><h1>Hello world</h1></body>"`;
40
40
41
+ exports[`addStyle should work with empty layer 1`] = `"<head><title>Title</title></head><body><h1>Hello world</h1></body>"`;
42
+
41
43
exports[`addStyle should work with empty modules list #2 1`] = `"<head><title>Title</title></head><body><h1>Hello world</h1></body>"`;
42
44
43
45
exports[`addStyle should work with empty modules list #2 2`] = `"<head><title>Title</title></head><body><h1>Hello world</h1></body>"`;
@@ -56,7 +58,9 @@ exports[`addStyle should work with empty modules list 1`] = `"<head><title>Title
56
58
57
59
exports[`addStyle should work with empty modules list 2`] = `"<head><title>Title</title></head><body><h1>Hello world</h1></body>"`;
58
60
59
- exports[`addStyle should work with media 1`] = `"<head><title>Title</title><style media =\\"screen and (min-width:320px)\\">.foo { color : red } </style></head><body><h1>Hello world</h1></body>"`;
61
+ exports[`addStyle should work with layer 1`] = `"<head><title>Title</title></head><body><h1>Hello world</h1></body>"`;
62
+
63
+ exports[`addStyle should work with media 1`] = `"<head><title>Title</title><style>@media screen and (min-width:320px) { .foo { color: red }} </style></head><body><h1>Hello world</h1></body>"`;
60
64
61
65
exports[`addStyle should work with multiple styles 1`] = `"<head><title>Title</title><style>.foo { color : red } </style><style>.bar { color : blue } </style></head><body><h1>Hello world</h1></body>"`;
62
66
@@ -67,6 +71,8 @@ exports[`addStyle should work with source maps 1`] = `
67
71
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLTUuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQXFCLGVBQWUsRUFBRSIsImZpbGUiOiJzdHlsZS01LmNzcyIsInNvdXJjZXNDb250ZW50IjpbIi5mb28geyBjb2xvcjogcmVkIH0iXX0= */</style></head><body><h1>Hello world</h1></body>"
68
72
`;
69
73
74
+ exports[`addStyle should work with supports 1`] = `"<head><title>Title</title></head><body><h1>Hello world</h1></body>"`;
75
+
70
76
exports[`addStyle should work with updates #2 1`] = `"<head><title>Title</title><style>.foo { color : red } </style></head><body><h1>Hello world</h1></body>"`;
71
77
72
78
exports[`addStyle should work with updates #2 2`] = `"<head><title>Title</title><style>.foo { color : blue } </style></head><body><h1>Hello world</h1></body>"`;
@@ -79,9 +85,9 @@ exports[`addStyle should work with updates #4 1`] = `"<head><title>Title</title>
79
85
80
86
exports[`addStyle should work with updates #4 2`] = `"<head><title>Title</title></head><body><h1>Hello world</h1></body>"`;
81
87
82
- exports[`addStyle should work with updates #5 1`] = `"<head><title>Title</title><style media =\\" screen and (min-width:320px)\\"> .foo { color : red } </style></head><body><h1>Hello world</h1></body>"`;
88
+ exports[`addStyle should work with updates #5 1`] = `"<head><title>Title</title><style>@ media screen and (min-width:320px) { .foo { color: red } } </style></head><body><h1>Hello world</h1></body>"`;
83
89
84
- exports[`addStyle should work with updates #5 2`] = `"<head><title>Title</title><style media =\\" screen and (min-width:640px)\\"> .foo { color : blue } </style></head><body><h1>Hello world</h1></body>"`;
90
+ exports[`addStyle should work with updates #5 2`] = `"<head><title>Title</title><style>@ media screen and (min-width:640px) { .foo { color: blue } } </style></head><body><h1>Hello world</h1></body>"`;
85
91
86
92
exports[`addStyle should work with updates #6 1`] = `"<head><title>Title</title><style>.foo { color : red } .bar { color : yellow } </style></head><body><h1>Hello world</h1></body>"`;
87
93
@@ -102,14 +108,14 @@ exports[`addStyle should work with updates #7 1`] = `"<head><title>Title</title>
102
108
exports[`addStyle should work with updates #7 2`] = `"<head><title>Title</title><style>.foo { color : green } </style><style>.bar { color : black } </style></head><body><h1>Hello world</h1></body>"`;
103
109
104
110
exports[`addStyle should work with updates #8 1`] = `
105
- " <head><title>Title</title><style media=\\ " screen and (min-width: 320px)\\"> .foo { color : red }
106
- /* # sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLTI2LTEuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQXFCLGVBQWUsRUFBRSIsImZpbGUiOiJzdHlsZS0yNi0xLmNzcyIsInNvdXJjZXNDb250ZW50IjpbIkBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDMyMHB4KSB7IC5mb28geyBjb2xvcjogcmVkIH0gfSJdfQ== */ </style><style media =\\" screen and (max-width: 240px)\\"> .bar { color : yellow }
111
+ " <head><title>Title</title><style>@ media screen and (min-width: 320px) { .foo { color: red } }
112
+ /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLTI2LTEuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQXFCLGVBQWUsRUFBRSIsImZpbGUiOiJzdHlsZS0yNi0xLmNzcyIsInNvdXJjZXNDb250ZW50IjpbIkBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDMyMHB4KSB7IC5mb28geyBjb2xvcjogcmVkIH0gfSJdfQ== */</style><style>@ media screen and (max-width: 240px) { .bar { color: yellow } }
107
113
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLTI2LTIuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQXFCLGVBQWUsRUFBRSIsImZpbGUiOiJzdHlsZS0yNi0yLmNzcyIsInNvdXJjZXNDb250ZW50IjpbIkBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDI0MHB4KSB7IC5iYXIgeyBjb2xvcjogeWVsbG93IH0gfSJdfQ== */</style></head><body><h1>Hello world</h1></body>"
108
114
`;
109
115
110
116
exports[`addStyle should work with updates #8 2`] = `
111
- " <head><title>Title</title><style media=\\ " screen and (min-width: 640px)\\"> .foo { color : black }
112
- /* # sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLTI2LTEuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJCQkJCLGNBQXFCLGVBQWUsRUFBRSIsImZpbGUiOiJzdHlsZS0yNi0xLmNzcyIsInNvdXJjZXNDb250ZW50IjpbIkBtZWRpYSBzY3JlZW4gYW5kIChtaW4td2lkdGg6IDY0MHB4KSB7IC5mb28geyBjb2xvcjogYmxhY2sgfSB9Il19 */ </style><style media =\\" screen and (max-width: 1240px)\\"> .bar { color : black }
117
+ " <head><title>Title</title><style>@ media screen and (min-width: 640px) { .foo { color: black } }
118
+ /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLTI2LTEuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJCQkJCLGNBQXFCLGVBQWUsRUFBRSIsImZpbGUiOiJzdHlsZS0yNi0xLmNzcyIsInNvdXJjZXNDb250ZW50IjpbIkBtZWRpYSBzY3JlZW4gYW5kIChtaW4td2lkdGg6IDY0MHB4KSB7IC5mb28geyBjb2xvcjogYmxhY2sgfSB9Il19 */</style><style>@ media screen and (max-width: 1240px) { .bar { color: black } }
113
119
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlLTI2LTIuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJCQkJCLGNBQXFCLGVBQWUsRUFBRSIsImZpbGUiOiJzdHlsZS0yNi0yLmNzcyIsInNvdXJjZXNDb250ZW50IjpbIkBtZWRpYSBzY3JlZW4gYW5kIChtYXgtd2lkdGg6IDEyNDBweCkgeyAuYmFyIHsgY29sb3I6IGJsYWNrIH0gfSJdfQ== */</style></head><body><h1>Hello world</h1></body>"
114
120
`;
115
121
@@ -127,9 +133,9 @@ exports[`addStyle should work with updates #11 1`] = `"<head><title>Title</title
127
133
128
134
exports[`addStyle should work with updates #11 2`] = `"<head><title>Title</title><style>.foo { color : black } </style><style>.bar { color : white } </style><script src =\\"https://example.com/script.js\\" id =\\"id\\"></script></head><body><h1>Hello world</h1></body>"`;
129
135
130
- exports[`addStyle should work with updates #12 1`] = `"<head><title>Title</title><style>.order { color : red } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style><style>.order { color : blue } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style><style>.order { color : red } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style><style media =\\" screen and (min-width: 2000px)\\"> .order { color : blue } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style></head><body><h1>Hello world</h1></body>"`;
136
+ exports[`addStyle should work with updates #12 1`] = `"<head><title>Title</title><style>.order { color : red } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style><style>.order { color : blue } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style><style>.order { color : red } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style><style>@ media screen and (min-width: 2000px) { .order { color: blue } } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style></head><body><h1>Hello world</h1></body>"`;
131
137
132
- exports[`addStyle should work with updates #12 2`] = `"<head><title>Title</title><style>.order { color : orange } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style><style>.order { color : blue } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style><style>.order { color : orange } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style><style media =\\" screen and (min-width: 2000px)\\"> .order { color : blue } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style></head><body><h1>Hello world</h1></body>"`;
138
+ exports[`addStyle should work with updates #12 2`] = `"<head><title>Title</title><style>.order { color : orange } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style><style>.order { color : blue } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style><style>.order { color : orange } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style><style>@ media screen and (min-width: 2000px) { .order { color: blue } } </style><style>.@import url(\\"https://fonts.googleapis.com/css?family=Roboto&display=swap\\");</style></head><body><h1>Hello world</h1></body>"`;
133
139
134
140
exports[`addStyle should work with updates #12 3`] = `"<head><title>Title</title><style>.foo { color : red } </style><style>.bar { color : blue } </style></head><body><h1>Hello world</h1></body>"`;
135
141
0 commit comments