@alfalab/stylelint-core-vars 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.test.js DELETED
@@ -1,802 +0,0 @@
1
- const vars = require('./utils').vars;
2
- const mixins = require('./utils').mixins;
3
- const {
4
- RULE_USE_VARS,
5
- RULE_USE_ONE_OF_VARS,
6
- RULE_USE_MIXINS,
7
- RULE_USE_ONE_OF_MIXINS,
8
- RULE_DO_NOT_USE_DARK_COLORS,
9
- RULE_DO_NOT_USE_OLD_VARS,
10
- messages,
11
- } = require('.');
12
-
13
- testRule({
14
- plugins: [RULE_USE_VARS],
15
- ruleName: RULE_USE_VARS,
16
- config: true,
17
- fix: true,
18
- accept: [
19
- {
20
- code: `.class {
21
- padding-left: var(--gap-2xs);
22
- }`,
23
- description: 'singleline rule with single value',
24
- },
25
- {
26
- code: `.class {
27
- padding: var(--gap-xs) 0 var(--gap-m) 0;
28
- }`,
29
- description: 'singleline rule with multiple values',
30
- },
31
- {
32
- code: `.class {
33
- margin-top: var(--gap-xs);
34
- margin-bottom: var(--gap-l);
35
- }`,
36
- description: 'multiline rule',
37
- },
38
- {
39
- code: `.class {
40
- padding: var(--gap-xs) 0 var(--gap-m) 0;
41
- margin: var(--gap-l);
42
- }`,
43
- description: 'multiline rule',
44
- },
45
- {
46
- code: `.class {
47
- .inner {
48
- padding: var(--gap-xs) 0 var(--gap-m) 0;
49
- margin: var(--gap-l);
50
- }
51
- }`,
52
- description: 'nested rule',
53
- },
54
- {
55
- code: `.class {
56
- padding-left: 3px;
57
- color: #000;
58
- }`,
59
- description: 'custom value',
60
- },
61
- {
62
- code: `.class {
63
- box-shadow: 0 0 8px #B000B5, 0 0 8px #BADA55,
64
- 0 4px 8px #C0FFEE;
65
- }`,
66
- description: 'singleline rule with multiline value',
67
- },
68
- {
69
- code: `.class {
70
- background-color: var(--color-light-bg-primary);
71
- background: var(--color-light-bg-primary);
72
- color: var(--color-light-text-primary);
73
- }`,
74
- description: 'colors',
75
- },
76
- {
77
- code: `.class {
78
- border-radius: var(--border-radius-s);
79
- border-radius: var(--border-radius-m);
80
- border-radius: var(--border-radius-l);
81
- border-radius: var(--border-radius-xl);
82
- border-radius: var(--border-radius-circle);
83
- border-radius: var(--border-radius-pill);
84
- border-top-left-radius: var(--border-radius-s);
85
- border-top-right-radius: var(--border-radius-s);
86
- border-bottom-left-radius: var(--border-radius-s);
87
- border-bottom-right-radius: var(--border-radius-s);
88
- }`,
89
- description: 'border-radius',
90
- },
91
- {
92
- code: `.class {
93
- background-color: #fff;
94
- background: #fff;
95
- border: 1px solid #0b1f35;
96
- }`,
97
- description: 'not exact match',
98
- },
99
- ],
100
- reject: [
101
- {
102
- code: `.class {\n padding-top: 8px;\n}`,
103
- fixed: `.class {\n padding-top: var(--gap-xs);\n}`,
104
- description: 'hardcode single gap',
105
- message: messages[RULE_USE_VARS].expected(['--gap-xs'], '8px'),
106
- line: 2,
107
- column: 18,
108
- },
109
- {
110
- code: `.class {\n padding: 8px 12px 4px 16px;\n}`,
111
- fixed: `.class {\n padding: var(--gap-xs) var(--gap-s) var(--gap-2xs) var(--gap-m);\n}`,
112
- description: 'hardcode multiple gaps',
113
- warnings: [
114
- {
115
- message: messages[RULE_USE_VARS].expected(['--gap-2xs'], '4px'),
116
- line: 2,
117
- column: 23,
118
- },
119
- {
120
- message: messages[RULE_USE_VARS].expected(['--gap-xs'], '8px'),
121
- line: 2,
122
- column: 14,
123
- },
124
- {
125
- message: messages[RULE_USE_VARS].expected(['--gap-s'], '12px'),
126
- line: 2,
127
- column: 18,
128
- },
129
- {
130
- message: messages[RULE_USE_VARS].expected(['--gap-m'], '16px'),
131
- line: 2,
132
- column: 27,
133
- },
134
- ],
135
- },
136
- {
137
- code: `.class {
138
- .inner {
139
- padding: 8px 12px 4px 16px;
140
- }
141
- }`,
142
- fixed: `.class {
143
- .inner {
144
- padding: var(--gap-xs) var(--gap-s) var(--gap-2xs) var(--gap-m);
145
- }
146
- }`,
147
- description: 'hardcode nested rule',
148
- warnings: [
149
- {
150
- message: messages[RULE_USE_VARS].expected(['--gap-2xs'], '4px'),
151
- line: 3,
152
- column: 39,
153
- },
154
- {
155
- message: messages[RULE_USE_VARS].expected(['--gap-xs'], '8px'),
156
- line: 3,
157
- column: 30,
158
- },
159
- {
160
- message: messages[RULE_USE_VARS].expected(['--gap-s'], '12px'),
161
- line: 3,
162
- column: 34,
163
- },
164
- {
165
- message: messages[RULE_USE_VARS].expected(['--gap-m'], '16px'),
166
- line: 3,
167
- column: 43,
168
- },
169
- ],
170
- },
171
- {
172
- code: `.class {\n box-shadow: 0 0 4px rgba(11, 31, 53, 0.02), 0 2px 4px rgba(11, 31, 53, 0.04);\n}`,
173
- fixed: `.class {\n box-shadow: var(--shadow-xs);\n}`,
174
- description: 'hardcode singleline shadow',
175
- message: messages[RULE_USE_VARS].expected(
176
- ['--shadow-xs'],
177
- '0 0 4px rgba(11, 31, 53, 0.02), 0 2px 4px rgba(11, 31, 53, 0.04)'
178
- ),
179
- line: 2,
180
- column: 17,
181
- },
182
- {
183
- code: `.class {\n box-shadow: 0 0 4px rgba(11, 31, 53, 0.02), 0 2px 4px rgba(11, 31, 53, 0.04),
184
- 0 2px 4px rgba(11, 31, 53, 0.16);\n}`,
185
- fixed: `.class {\n box-shadow: var(--shadow-xs-hard);\n}`,
186
- description: 'hardcode multiline shadow',
187
- message: messages[RULE_USE_VARS].expected(
188
- ['--shadow-xs-hard'],
189
- '0 0 4px rgba(11, 31, 53, 0.02), 0 2px 4px rgba(11, 31, 53, 0.04), 0 2px 4px rgba(11, 31, 53, 0.16)'
190
- ),
191
- line: 2,
192
- column: 17,
193
- },
194
- {
195
- code: `.class {\n color: #0b1f35;\n}`,
196
- fixed: `.class {\n color: var(--color-light-text-primary);\n}`,
197
- description: 'hardcode single color',
198
- message: messages[RULE_USE_VARS].expected(['--color-light-text-primary'], '#0b1f35'),
199
- line: 2,
200
- column: 12,
201
- },
202
- {
203
- code: `.class {\n padding-top: 8px;\n box-shadow: 0 0 4px rgba(11, 31, 53, 0.02), 0 2px 4px rgba(11, 31, 53, 0.04);\n}`,
204
- fixed: `.class {\n padding-top: var(--gap-xs);\n box-shadow: var(--shadow-xs);\n}`,
205
- description: 'hardcode multiple props',
206
- warnings: [
207
- {
208
- message: messages[RULE_USE_VARS].expected(['--gap-xs'], '8px'),
209
- line: 2,
210
- column: 18,
211
- },
212
- {
213
- message: messages[RULE_USE_VARS].expected(
214
- ['--shadow-xs'],
215
- '0 0 4px rgba(11, 31, 53, 0.02), 0 2px 4px rgba(11, 31, 53, 0.04)'
216
- ),
217
- line: 3,
218
- column: 17,
219
- },
220
- ],
221
- },
222
- {
223
- code: `.class {\n border-radius: 8px;\n border-top-left-radius: 4px;\n}`,
224
- fixed: `.class {\n border-radius: var(--border-radius-m);\n border-top-left-radius: var(--border-radius-s);\n}`,
225
- description: 'hardcode border-radius',
226
- warnings: [
227
- {
228
- message: messages[RULE_USE_VARS].expected(['--border-radius-m'], '8px'),
229
- line: 2,
230
- column: 20,
231
- },
232
- {
233
- message: messages[RULE_USE_VARS].expected(['--border-radius-s'], '4px'),
234
- line: 3,
235
- column: 29,
236
- },
237
- ],
238
- },
239
- ...Object.entries(vars.gaps).map(([value, vars]) => {
240
- const gapVar = vars[0];
241
-
242
- const props = [
243
- 'padding',
244
- 'margin',
245
- 'padding-left',
246
- 'padding-right',
247
- 'padding-top',
248
- 'padding-bottom',
249
- 'margin-left',
250
- 'margin-right',
251
- 'margin-top',
252
- 'margin-bottom',
253
- ];
254
-
255
- return {
256
- code: `.class {
257
- ${props.map((prop) => `${prop}: ${value};`).join('\n')}
258
- }`,
259
- fixed: `.class {
260
- ${props.map((prop) => `${prop}: var(${gapVar});`).join('\n')}
261
- }`,
262
- description: `should use ${gapVar}`,
263
- warnings: props.map((_) => ({
264
- message: messages[RULE_USE_VARS].expected([gapVar], value),
265
- })),
266
- };
267
- }),
268
- ...Object.entries(vars.shadows).map(([value, vars]) => {
269
- const shadowVar = vars[0];
270
-
271
- return {
272
- code: `.class {
273
- box-shadow: ${value};
274
- }`,
275
- fixed: `.class {
276
- box-shadow: var(${shadowVar});
277
- }`,
278
- description: `should use ${shadowVar}`,
279
- message: messages[RULE_USE_VARS].expected([shadowVar], value),
280
- };
281
- }),
282
- ],
283
- });
284
-
285
- testRule({
286
- plugins: [RULE_USE_ONE_OF_VARS],
287
- ruleName: RULE_USE_ONE_OF_VARS,
288
- config: true,
289
- fix: true,
290
- accept: [
291
- {
292
- code: `.class {
293
- padding-left: var(--gap-2xs);
294
- }`,
295
- description: 'singleline rule with single value',
296
- },
297
- {
298
- code: `.class {
299
- padding: var(--gap-xs) 0 var(--gap-m) 0;
300
- }`,
301
- description: 'singleline rule with multiple values',
302
- },
303
- {
304
- code: `.class {
305
- margin-top: var(--gap-xs);
306
- margin-bottom: var(--gap-l);
307
- }`,
308
- description: 'multiline rule',
309
- },
310
- {
311
- code: `.class {
312
- padding: var(--gap-xs) 0 var(--gap-m) 0;
313
- margin: var(--gap-l);
314
- }`,
315
- description: 'multiline rule',
316
- },
317
- {
318
- code: `.class {
319
- .inner {
320
- padding: var(--gap-xs) 0 var(--gap-m) 0;
321
- margin: var(--gap-l);
322
- }
323
- }`,
324
- description: 'multiline nested rule',
325
- },
326
- {
327
- code: `.class {
328
- padding-left: 3px;
329
- color: #000;
330
- }`,
331
- description: 'custom value',
332
- },
333
- {
334
- code: `.class {
335
- box-shadow: 0 0 8px #B000B5, 0 0 8px #BADA55,
336
- 0 4px 8px #C0FFEE;
337
- }`,
338
- description: 'singleline rule with multiline value',
339
- },
340
- {
341
- code: `.class {
342
- background-color: var(--color-light-bg-primary);
343
- background: var(--color-light-bg-primary);
344
- color: var(--color-light-text-primary);
345
- }`,
346
- description: 'colors',
347
- },
348
- {
349
- code: `.class {
350
- border-radius: var(--border-radius-s);
351
- border-radius: var(--border-radius-m);
352
- border-radius: var(--border-radius-l);
353
- border-radius: var(--border-radius-xl);
354
- border-radius: var(--border-radius-circle);
355
- border-radius: var(--border-radius-pill);
356
- border-top-left-radius: var(--border-radius-s);
357
- border-top-right-radius: var(--border-radius-s);
358
- border-bottom-left-radius: var(--border-radius-s);
359
- border-bottom-right-radius: var(--border-radius-s);
360
- }`,
361
- description: 'border-radius',
362
- },
363
- ],
364
- reject: [
365
- {
366
- code: `.class {
367
- background-color: #fff;
368
- background: #fff;
369
- border: 1px solid #0b1f35;
370
- }`,
371
- fixed: `.class {
372
- background-color: #fff;
373
- background: #fff;
374
- border: 1px solid #0b1f35;
375
- }`,
376
- unfixable: true,
377
- description: 'hardcode colors',
378
- warnings: [
379
- {
380
- column: 35,
381
- line: 2,
382
- message: messages[RULE_USE_ONE_OF_VARS].expected(
383
- [
384
- '--color-light-bg-primary',
385
- '--color-light-specialbg-secondary-grouped',
386
- '--color-light-graphic-primary-inverted',
387
- ],
388
- '#fff'
389
- ),
390
- },
391
- {
392
- column: 29,
393
- line: 3,
394
- message: messages[RULE_USE_ONE_OF_VARS].expected(
395
- [
396
- '--color-light-bg-primary',
397
- '--color-light-specialbg-secondary-grouped',
398
- '--color-light-graphic-primary-inverted',
399
- ],
400
- '#fff'
401
- ),
402
- },
403
- {
404
- column: 35,
405
- line: 4,
406
- message: messages[RULE_USE_ONE_OF_VARS].expected(
407
- [
408
- '--color-light-border-key',
409
- '--color-light-graphic-primary',
410
- '--color-light-bg-primary-inverted',
411
- ],
412
- '#0b1f35'
413
- ),
414
- },
415
- ],
416
- },
417
- {
418
- code: `.class {
419
- .inner {
420
- background-color: #fff;
421
- background: #fff;
422
- border: 1px solid #0b1f35;
423
- }
424
- }`,
425
- fixed: `.class {
426
- .inner {
427
- background-color: #fff;
428
- background: #fff;
429
- border: 1px solid #0b1f35;
430
- }
431
- }`,
432
- unfixable: true,
433
- description: 'hardcode colors in nested rule',
434
- warnings: [
435
- {
436
- column: 39,
437
- line: 3,
438
- message: messages[RULE_USE_ONE_OF_VARS].expected(
439
- [
440
- '--color-light-bg-primary',
441
- '--color-light-specialbg-secondary-grouped',
442
- '--color-light-graphic-primary-inverted',
443
- ],
444
- '#fff'
445
- ),
446
- },
447
- {
448
- column: 33,
449
- line: 4,
450
- message: messages[RULE_USE_ONE_OF_VARS].expected(
451
- [
452
- '--color-light-bg-primary',
453
- '--color-light-specialbg-secondary-grouped',
454
- '--color-light-graphic-primary-inverted',
455
- ],
456
- '#fff'
457
- ),
458
- },
459
- {
460
- column: 39,
461
- line: 5,
462
- message: messages[RULE_USE_ONE_OF_VARS].expected(
463
- [
464
- '--color-light-border-key',
465
- '--color-light-graphic-primary',
466
- '--color-light-bg-primary-inverted',
467
- ],
468
- '#0b1f35'
469
- ),
470
- },
471
- ],
472
- },
473
- ],
474
- });
475
-
476
- testRule({
477
- plugins: [RULE_DO_NOT_USE_OLD_VARS],
478
- ruleName: RULE_DO_NOT_USE_OLD_VARS,
479
- config: true,
480
- fix: true,
481
- accept: [
482
- {
483
- code: `.class {
484
- color: #000;
485
- }`,
486
- description: 'custom value',
487
- },
488
- {
489
- code: `.class {
490
- background-color: var(--color-light-bg-primary);
491
- background: var(--color-light-bg-primary);
492
- color: var(--color-light-text-primary);
493
- }`,
494
- description: 'colors',
495
- },
496
- ],
497
- reject: [
498
- {
499
- code: `.class {\n background-color: var(--color-dark-indigo-10-flat);\n}`,
500
- fixed: `.class {\n background-color: var(--color-light-bg-tertiary);\n}`,
501
- message: messages[RULE_DO_NOT_USE_OLD_VARS].expected(
502
- ['--color-light-bg-tertiary'],
503
- '--color-dark-indigo-10-flat'
504
- ),
505
- line: 2,
506
- column: 27,
507
- },
508
- {
509
- code: `.class {\n background-color: var(--color-red-brand-85);\n}`,
510
- fixed: `.class {\n background-color: var(--color-red-brand-85);\n}`,
511
- unfixable: true,
512
- message: messages[RULE_DO_NOT_USE_OLD_VARS].expected([], ['--color-red-brand-85']),
513
- line: 2,
514
- column: 27,
515
- },
516
- {
517
- code: `.class {
518
- color: var(--color-red-brand-10-flat);
519
- background: var(--color-red-dark);
520
- fill: var(---color-black-10);
521
- }`,
522
- fixed: `.class {
523
- color: var(--color-red-brand-10-flat);
524
- background: var(--color-light-graphic-negative);
525
- fill: var(---color-black-10);
526
- }`,
527
- description: 'multiple variants',
528
- warnings: [
529
- {
530
- column: 28,
531
- line: 2,
532
- message: messages[RULE_DO_NOT_USE_OLD_VARS].expected(
533
- ['--color-light-bg-negative-muted'],
534
- '--color-red-brand-10-flat',
535
- false
536
- ),
537
- },
538
- {
539
- column: 33,
540
- line: 3,
541
- message: messages[RULE_DO_NOT_USE_OLD_VARS].expected(
542
- ['--color-light-graphic-negative'],
543
- '--color-red-dark',
544
- true
545
- ),
546
- },
547
- ],
548
- },
549
- ],
550
- });
551
-
552
- testRule({
553
- plugins: [RULE_USE_MIXINS],
554
- ruleName: RULE_USE_MIXINS,
555
- config: true,
556
- fix: true,
557
- accept: [
558
- {
559
- code: `.class {
560
- @mixin headline_xlarge;
561
- }`,
562
- description: 'typography',
563
- },
564
- {
565
- code: `.class {
566
- font-size: 14px;
567
- }`,
568
- description: 'not exact match',
569
- },
570
- {
571
- code: `.class {
572
- .inner {
573
- @mixin headline_xlarge;
574
- }
575
- }`,
576
- description: 'typography nested rule',
577
- },
578
- ],
579
- reject: [
580
- {
581
- code: `.class {
582
- background-color: var(--color-light-bg-primary);
583
- font-size: 48px;
584
- line-height: 64px;
585
- background: var(--color-light-bg-primary);
586
- font-weight: 500;
587
- color: var(--color-light-text-primary);
588
- }`,
589
- fixed: `.class {
590
- @mixin headline_xlarge;
591
- background-color: var(--color-light-bg-primary);
592
- background: var(--color-light-bg-primary);
593
- color: var(--color-light-text-primary);
594
- }`,
595
- description: 'typography',
596
- message: messages[RULE_USE_MIXINS].expected([{ name: 'headline_xlarge' }]),
597
- line: 3,
598
- column: 17,
599
- },
600
- {
601
- code: `.class {
602
- font-size: 48px;
603
- line-height: 64px;
604
- font-weight: 500;
605
- }`,
606
- fixed: `.class {
607
- @mixin headline_xlarge;
608
- }`,
609
- description: 'typography',
610
- message: messages[RULE_USE_MIXINS].expected([{ name: 'headline_xlarge' }]),
611
- line: 2,
612
- column: 17,
613
- },
614
- {
615
- code: `.class {
616
- font-size: 14px;
617
- line-height: 20px;
618
- font-weight: 400;
619
- }`,
620
- fixed: `.class {
621
- @mixin paragraph_primary_small;
622
- }`,
623
- description: 'typography',
624
- message: messages[RULE_USE_MIXINS].expected([{ name: 'paragraph_primary_small' }]),
625
- line: 2,
626
- column: 17,
627
- },
628
- {
629
- code: `.class {
630
- .inner {
631
- font-size: 48px;
632
- line-height: 64px;
633
- font-weight: 500;
634
- }
635
- }`,
636
- fixed: `.class {
637
- .inner {
638
- @mixin headline_xlarge;
639
- }
640
- }`,
641
- description: 'typography nested rule',
642
- message: messages[RULE_USE_MIXINS].expected([{ name: 'headline_xlarge' }]),
643
- line: 3,
644
- column: 21,
645
- },
646
- ],
647
- });
648
-
649
- testRule({
650
- plugins: [RULE_USE_ONE_OF_MIXINS],
651
- ruleName: RULE_USE_ONE_OF_MIXINS,
652
- config: true,
653
- fix: true,
654
- accept: [
655
- {
656
- code: `.class {
657
- @mixin headline_xlarge;
658
- }`,
659
- description: 'typography',
660
- },
661
- ],
662
- reject: [
663
- {
664
- code: `.class {
665
- font-size: 14px;
666
- line-height: 20px;
667
- }`,
668
- fixed: `.class {
669
- font-size: 14px;
670
- line-height: 20px;
671
- }`,
672
- unfixable: true,
673
- description: 'typography',
674
- message: messages[RULE_USE_ONE_OF_MIXINS].expected([
675
- {
676
- name: 'paragraph_primary_small',
677
- props: mixins.typography['paragraph_primary_small'],
678
- },
679
- { name: 'accent_primary_small', props: mixins.typography['accent_primary_small'] },
680
- { name: 'action_primary_small', props: mixins.typography['action_primary_small'] },
681
- ]),
682
- line: 2,
683
- column: 17,
684
- },
685
- {
686
- code: `.class {
687
- font-size: 14px;
688
- }`,
689
- fixed: `.class {
690
- font-size: 14px;
691
- }`,
692
- unfixable: true,
693
- description: 'typography',
694
- message: messages[RULE_USE_ONE_OF_MIXINS].expected([
695
- {
696
- name: 'paragraph_primary_small',
697
- props: mixins.typography['paragraph_primary_small'],
698
- },
699
- {
700
- name: 'paragraph_component_secondary',
701
- props: mixins.typography['paragraph_component_secondary'],
702
- },
703
- { name: 'accent_primary_small', props: mixins.typography['accent_primary_small'] },
704
- {
705
- name: 'accent_component_secondary',
706
- props: mixins.typography['accent_component_secondary'],
707
- },
708
- { name: 'action_primary_small', props: mixins.typography['action_primary_small'] },
709
- {
710
- name: 'action_component_secondary',
711
- props: mixins.typography['action_component_secondary'],
712
- },
713
- ]),
714
- line: 2,
715
- column: 17,
716
- },
717
- {
718
- code: `.class {
719
- .inner {
720
- font-size: 14px;
721
- }
722
- }`,
723
- fixed: `.class {
724
- .inner {
725
- font-size: 14px;
726
- }
727
- }`,
728
- unfixable: true,
729
- description: 'typography nested rule',
730
- message: messages[RULE_USE_ONE_OF_MIXINS].expected([
731
- {
732
- name: 'paragraph_primary_small',
733
- props: mixins.typography['paragraph_primary_small'],
734
- },
735
- {
736
- name: 'paragraph_component_secondary',
737
- props: mixins.typography['paragraph_component_secondary'],
738
- },
739
- { name: 'accent_primary_small', props: mixins.typography['accent_primary_small'] },
740
- {
741
- name: 'accent_component_secondary',
742
- props: mixins.typography['accent_component_secondary'],
743
- },
744
- { name: 'action_primary_small', props: mixins.typography['action_primary_small'] },
745
- {
746
- name: 'action_component_secondary',
747
- props: mixins.typography['action_component_secondary'],
748
- },
749
- ]),
750
- line: 3,
751
- column: 21,
752
- },
753
- ],
754
- });
755
-
756
- testRule({
757
- plugins: [RULE_DO_NOT_USE_DARK_COLORS],
758
- ruleName: RULE_DO_NOT_USE_DARK_COLORS,
759
- config: true,
760
- fix: true,
761
- accept: [
762
- {
763
- code: `.class {
764
- color: var(--color-light-text-primary);
765
- border: 1px solid var(--color-light-border-primary);
766
- }`,
767
- description: 'allowed colors',
768
- },
769
- {
770
- code: `.class {
771
- color: var(--color-dark-indigo);
772
- }`,
773
- description: 'old colors',
774
- },
775
- ],
776
- reject: [
777
- {
778
- code: `.class {
779
- color: var(--color-dark-text-primary);
780
- border: 1px solid var(--color-dark-border-primary);
781
- }`,
782
- fixed: `.class {
783
- color: var(--color-dark-text-primary);
784
- border: 1px solid var(--color-dark-border-primary);
785
- }`,
786
- unfixable: true,
787
- description: 'dark colors',
788
- warnings: [
789
- {
790
- column: 28,
791
- line: 2,
792
- message: messages[RULE_DO_NOT_USE_DARK_COLORS].expected(),
793
- },
794
- {
795
- column: 39,
796
- line: 3,
797
- message: messages[RULE_DO_NOT_USE_DARK_COLORS].expected(),
798
- },
799
- ],
800
- },
801
- ],
802
- });