Skip to content

Commit d28883f

Browse files
committed
wip
1 parent 653ac7a commit d28883f

File tree

4 files changed

+42
-42
lines changed

4 files changed

+42
-42
lines changed

__tests__/dark-mode.test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ test('only dark variables with default options and `media` mode', async () => {
6969
7070
+ @media (prefers-color-scheme: dark) {
7171
+ :root {
72-
+ --colors-primary: #ffffff
72+
+ --colors-primary: #ffffff
7373
+ }
7474
+
7575
+ .container {
76-
+ --colors-secondary: #000000
76+
+ --colors-secondary: #000000
7777
+ }
7878
+ }
7979
@@ -115,11 +115,11 @@ test('if the `darkMode` is set to `media`, the `darkSelector` and `darkToRoot` o
115115
116116
+ @media (prefers-color-scheme: dark) {
117117
+ :root {
118-
+ --colors-primary: #ffffff
118+
+ --colors-primary: #ffffff
119119
+ }
120120
+
121121
+ .container {
122-
+ --colors-secondary: #000000
122+
+ --colors-secondary: #000000
123123
+ }
124124
+ }
125125
@@ -248,11 +248,11 @@ test('only dark variables with variablePrefix and `media` mode', async () => {
248248
249249
+ @media (prefers-color-scheme: dark) {
250250
+ :root {
251-
+ --my-prefix-colors-primary: #ffffff
251+
+ --my-prefix-colors-primary: #ffffff
252252
+ }
253253
+
254254
+ .container {
255-
+ --my-prefix-colors-secondary: #000000
255+
+ --my-prefix-colors-secondary: #000000
256256
+ }
257257
+ }
258258
@@ -372,11 +372,11 @@ test('variables and dark variables with default options and `media` mode', async
372372
+
373373
+ @media (prefers-color-scheme: dark) {
374374
+ :root {
375-
+ --colors-primary: #ffffff
375+
+ --colors-primary: #ffffff
376376
+ }
377377
+
378378
+ .container {
379-
+ --colors-secondary: #000000
379+
+ --colors-secondary: #000000
380380
+ }
381381
+ }
382382

__tests__/plugin-api.test.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ test('simple example with dark mode set to `media`', async () => {
3535
+
3636
+ @media (prefers-color-scheme: dark) {
3737
+ :root {
38-
+ --prefix2-colors-primary: yellow;
39-
+ --prefix2-colors-secondary: white;
40-
+ --prefix2-colors-warning: pink
38+
+ --prefix2-colors-primary: yellow;
39+
+ --prefix2-colors-secondary: white;
40+
+ --prefix2-colors-warning: pink
4141
+ }
4242
+
4343
+ .admin {
44-
+ --prefix2-colors-primary: blue;
45-
+ --prefix2-colors-secondary: green;
46-
+ --prefix2-colors-warning: gray
44+
+ --prefix2-colors-primary: blue;
45+
+ --prefix2-colors-secondary: green;
46+
+ --prefix2-colors-warning: gray
4747
+ }
4848
+ }
4949
@@ -178,15 +178,15 @@ test('with-components example with dark mode set to `media`', async () => {
178178
+
179179
+ @media (prefers-color-scheme: dark) {
180180
+ :root {
181-
+ --prefix2-colors-primary: yellow;
182-
+ --prefix2-colors-secondary: white;
183-
+ --prefix2-colors-warning: pink;
181+
+ --prefix2-colors-primary: yellow;
182+
+ --prefix2-colors-secondary: white;
183+
+ --prefix2-colors-warning: pink;
184184
+ }
185185
+
186186
+ .admin {
187-
+ --prefix2-colors-primary: blue;
188-
+ --prefix2-colors-secondary: green;
189-
+ --prefix2-colors-warning: gray;
187+
+ --prefix2-colors-primary: blue;
188+
+ --prefix2-colors-secondary: green;
189+
+ --prefix2-colors-warning: gray;
190190
+ }
191191
+ }
192192
+
@@ -284,15 +284,15 @@ test('with-components-null-selector example with dark mode set to `media`', asyn
284284
+
285285
+ @media (prefers-color-scheme: dark) {
286286
+ :root {
287-
+ --prefix2-colors-primary: yellow;
288-
+ --prefix2-colors-secondary: white;
289-
+ --prefix2-colors-warning: pink;
287+
+ --prefix2-colors-primary: yellow;
288+
+ --prefix2-colors-secondary: white;
289+
+ --prefix2-colors-warning: pink;
290290
+ }
291291
+
292292
+ .admin {
293-
+ --prefix2-colors-primary: blue;
294-
+ --prefix2-colors-secondary: green;
295-
+ --prefix2-colors-warning: gray;
293+
+ --prefix2-colors-primary: blue;
294+
+ --prefix2-colors-secondary: green;
295+
+ --prefix2-colors-warning: gray;
296296
+ }
297297
+ }
298298
+
@@ -338,15 +338,15 @@ test('with-themes example with dark mode set to `media`', async () => {
338338
+
339339
+ @media (prefers-color-scheme: dark) {
340340
+ :root {
341-
+ --prefix2-colors-primary: yellow;
342-
+ --prefix2-colors-secondary: red;
343-
+ --prefix2-colors-warning: purple
341+
+ --prefix2-colors-primary: yellow;
342+
+ --prefix2-colors-secondary: red;
343+
+ --prefix2-colors-warning: purple
344344
+ }
345345
+
346346
+ .admin {
347-
+ --prefix2-colors-primary: green;
348-
+ --prefix2-colors-secondary: orange;
349-
+ --prefix2-colors-warning: teal
347+
+ --prefix2-colors-primary: green;
348+
+ --prefix2-colors-secondary: orange;
349+
+ --prefix2-colors-warning: teal
350350
+ }
351351
+ }
352352
@@ -438,15 +438,15 @@ test('advanced example with dark mode set to `media`', async () => {
438438
+
439439
+ @media (prefers-color-scheme: dark) {
440440
+ :root {
441-
+ --prefix2-colors-primary: yellow;
442-
+ --prefix2-colors-secondary: red;
443-
+ --prefix2-colors-warning: purple;
441+
+ --prefix2-colors-primary: yellow;
442+
+ --prefix2-colors-secondary: red;
443+
+ --prefix2-colors-warning: purple;
444444
+ }
445445
+
446446
+ .admin {
447-
+ --prefix2-colors-primary: green;
448-
+ --prefix2-colors-secondary: orange;
449-
+ --prefix2-colors-warning: teal;
447+
+ --prefix2-colors-primary: green;
448+
+ --prefix2-colors-secondary: orange;
449+
+ --prefix2-colors-warning: teal;
450450
+ }
451451
+ }
452452
+

__tests__/readme.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,11 @@ test('dark mode with `media`', async () => {
270270
+
271271
+ @media (prefers-color-scheme: dark) {
272272
+ :root {
273-
+ --colors-red-50: blue
273+
+ --colors-red-50: blue
274274
+ }
275275
+
276276
+ .container {
277-
+ --colors-red-50: green
277+
+ --colors-red-50: green
278278
+ }
279279
+ }
280280

__tests__/util/_utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ module.exports = (contentFile) => {
4848
.replace(/\n\n@@([^@@]*)@@/g, '') // Top level @@ signs
4949
.replace(/@@([^@@]*)@@/g, '\n---\n') // In between @@ signs
5050
.replace(/[-+] __REMOVE_ME__\n/g, '')
51-
.replace(/\+ /g, '+ ')
52-
// .replace(/\+ \}\n([\s]*)\+/g, '\+ \}\n$1\+')
51+
// .replace(/\+ /g, '+ ')
52+
.replace(/\+ \}\n([\s]*)\+/g, '\+ \}\n$1\+')
5353
.replace(/\+(\s+?)\}\n(\s+?)\+/g, '\\+$1\\}')
5454
.replace(/Snapshot Diff:\n/g, '')
5555
.replace(/"/g, '\'')

0 commit comments

Comments
 (0)