@projectwallace/css-analyzer 7.5.0 → 7.6.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/dist/css-analyzer.js +199 -188
- package/dist/index.d.ts +3 -0
- package/package.json +1 -1
package/dist/css-analyzer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { calculateForAST as
|
|
1
|
+
import ei from "css-tree/parser";
|
|
2
|
+
import v from "css-tree/walker";
|
|
3
|
+
import { calculateForAST as ti } from "@bramus/specificity/core";
|
|
4
4
|
function He(r, t) {
|
|
5
5
|
return t >= 65 && t <= 90 && (t = t | 32), r === t;
|
|
6
6
|
}
|
|
@@ -23,7 +23,7 @@ function O(r, t) {
|
|
|
23
23
|
return !1;
|
|
24
24
|
return !0;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Ke(r, t) {
|
|
27
27
|
if (r === t) return !0;
|
|
28
28
|
let s = r.length;
|
|
29
29
|
if (t.length < s) return !1;
|
|
@@ -32,24 +32,24 @@ function We(r, t) {
|
|
|
32
32
|
return !1;
|
|
33
33
|
return !0;
|
|
34
34
|
}
|
|
35
|
-
const Te = "Atrule",
|
|
36
|
-
function
|
|
35
|
+
const Te = "Atrule", ii = "MediaQuery", Me = "Rule", We = "Selector", Nt = "TypeSelector", G = "PseudoClassSelector", jt = "AttributeSelector", Bt = "PseudoElementSelector", Ve = "Declaration", ri = "Value", R = "Identifier", si = "Nth", li = "Combinator", Yt = "Number", Ne = "Dimension", K = "Operator", ni = "Hash", ai = "Url", je = "Function";
|
|
36
|
+
function Ut(r, t, s) {
|
|
37
37
|
let e = r.value.children.first;
|
|
38
38
|
return S(t, r.property) && e.type === R && S(s, e.name);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function oi(r) {
|
|
41
41
|
let t = !1;
|
|
42
|
-
return
|
|
43
|
-
if (s.type === Ve && (
|
|
42
|
+
return v(r, function(s) {
|
|
43
|
+
if (s.type === Ve && (Ut(s, "-webkit-appearance", "none") || Ut(s, "-moz-appearance", "meterbar")))
|
|
44
44
|
return t = !0, this.break;
|
|
45
45
|
}), t;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function ui(r) {
|
|
48
48
|
let t = !1;
|
|
49
|
-
return
|
|
49
|
+
return v(r, function(s) {
|
|
50
50
|
let e = s.name, n = s.value;
|
|
51
|
-
if (s.type ===
|
|
52
|
-
if (
|
|
51
|
+
if (s.type === ii && s.mediaType !== null) {
|
|
52
|
+
if (Ke("\\0", s.mediaType) || O("\\9 ", s.mediaType))
|
|
53
53
|
return t = !0, this.break;
|
|
54
54
|
} else if (s.type === "Feature" && s.kind === "media") {
|
|
55
55
|
if (n && n.unit && n.unit === "\\0")
|
|
@@ -63,12 +63,12 @@ function oi(r) {
|
|
|
63
63
|
}
|
|
64
64
|
}), t;
|
|
65
65
|
}
|
|
66
|
-
const
|
|
67
|
-
function
|
|
68
|
-
return r.charCodeAt(0) ===
|
|
66
|
+
const Vt = 45;
|
|
67
|
+
function E(r) {
|
|
68
|
+
return r.charCodeAt(0) === Vt && r.charCodeAt(1) !== Vt && r.indexOf("-", 2) !== -1;
|
|
69
69
|
}
|
|
70
70
|
class A {
|
|
71
|
-
/** @param {string[]} items */
|
|
71
|
+
/** @param {Lowercase<string>[]} items */
|
|
72
72
|
constructor(t) {
|
|
73
73
|
this.set = new Set(t);
|
|
74
74
|
}
|
|
@@ -77,16 +77,16 @@ class A {
|
|
|
77
77
|
return this.set.has(t.toLowerCase());
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function Gt(r, t) {
|
|
81
81
|
let s = [];
|
|
82
|
-
return
|
|
83
|
-
visit:
|
|
82
|
+
return v(r, {
|
|
83
|
+
visit: We,
|
|
84
84
|
enter: function(e) {
|
|
85
85
|
s.push(t(e));
|
|
86
86
|
}
|
|
87
87
|
}), s;
|
|
88
88
|
}
|
|
89
|
-
const
|
|
89
|
+
const Qt = new A([
|
|
90
90
|
"nth-child",
|
|
91
91
|
"where",
|
|
92
92
|
"not",
|
|
@@ -97,15 +97,15 @@ const Gt = new A([
|
|
|
97
97
|
"-webkit-any",
|
|
98
98
|
"-moz-any"
|
|
99
99
|
]);
|
|
100
|
-
function
|
|
100
|
+
function Zt(r) {
|
|
101
101
|
let t = !1;
|
|
102
|
-
return
|
|
103
|
-
if (s.type ===
|
|
102
|
+
return v(r, function(s) {
|
|
103
|
+
if (s.type === jt) {
|
|
104
104
|
let e = s.name.name;
|
|
105
|
-
if (S("role", e) ||
|
|
105
|
+
if (S("role", e) || Ke("aria-", e))
|
|
106
106
|
return t = !0, this.break;
|
|
107
|
-
} else if (s.type === G &&
|
|
108
|
-
let e =
|
|
107
|
+
} else if (s.type === G && Qt.has(s.name)) {
|
|
108
|
+
let e = Gt(s, Zt);
|
|
109
109
|
for (let n of e)
|
|
110
110
|
if (n === !0) {
|
|
111
111
|
t = !0;
|
|
@@ -115,29 +115,29 @@ function Qt(r) {
|
|
|
115
115
|
}
|
|
116
116
|
}), t;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function ci(r) {
|
|
119
119
|
let t = !1;
|
|
120
|
-
return
|
|
120
|
+
return v(r, function(s) {
|
|
121
121
|
let e = s.type;
|
|
122
|
-
if ((e ===
|
|
122
|
+
if ((e === Bt || e === Nt || e === G) && E(s.name))
|
|
123
123
|
return t = !0, this.break;
|
|
124
124
|
}), t;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function fi(r) {
|
|
127
127
|
let t = [];
|
|
128
|
-
return
|
|
128
|
+
return v(r, function(s) {
|
|
129
129
|
s.type === G && t.push(s.name);
|
|
130
130
|
}), t.length === 0 ? !1 : t;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function Jt(r) {
|
|
133
133
|
let t = 0;
|
|
134
|
-
return
|
|
134
|
+
return v(r, function(s) {
|
|
135
135
|
let e = s.type;
|
|
136
|
-
if (!(e ===
|
|
137
|
-
if (t++, (e ===
|
|
136
|
+
if (!(e === We || e === si)) {
|
|
137
|
+
if (t++, (e === Bt || e === Nt || e === G) && E(s.name) && t++, e === jt)
|
|
138
138
|
return s.value && t++, this.skip;
|
|
139
|
-
if (e === G &&
|
|
140
|
-
let n =
|
|
139
|
+
if (e === G && Qt.has(s.name)) {
|
|
140
|
+
let n = Gt(s, Jt);
|
|
141
141
|
if (n.length === 0) return;
|
|
142
142
|
for (let a of n)
|
|
143
143
|
t += a;
|
|
@@ -146,12 +146,12 @@ function Zt(r) {
|
|
|
146
146
|
}
|
|
147
147
|
}), t;
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
|
|
151
|
-
if (s.type ===
|
|
149
|
+
function pi(r, t) {
|
|
150
|
+
v(r, function(s, e) {
|
|
151
|
+
if (s.type === li) {
|
|
152
152
|
let n = s.loc, a = s.name;
|
|
153
153
|
if (n === null) {
|
|
154
|
-
let y = e.prev.data.loc.end,
|
|
154
|
+
let y = e.prev.data.loc.end, b = {
|
|
155
155
|
offset: y.offset,
|
|
156
156
|
line: y.line,
|
|
157
157
|
column: y.column
|
|
@@ -159,11 +159,11 @@ function fi(r, t) {
|
|
|
159
159
|
t({
|
|
160
160
|
name: a,
|
|
161
161
|
loc: {
|
|
162
|
-
start:
|
|
162
|
+
start: b,
|
|
163
163
|
end: {
|
|
164
|
-
offset:
|
|
165
|
-
line:
|
|
166
|
-
column:
|
|
164
|
+
offset: b.offset + 1,
|
|
165
|
+
line: b.line,
|
|
166
|
+
column: b.column + 1
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
});
|
|
@@ -175,7 +175,7 @@ function fi(r, t) {
|
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
-
const
|
|
178
|
+
const hi = new A([
|
|
179
179
|
// CSS Named Colors
|
|
180
180
|
// Spec: https://drafts.csswg.org/css-color/#named-colors
|
|
181
181
|
// Heuristic: popular names first for quick finding in set.has()
|
|
@@ -328,7 +328,7 @@ const pi = new A([
|
|
|
328
328
|
"mediumorchid",
|
|
329
329
|
"darksalmon",
|
|
330
330
|
"mediumspringgreen"
|
|
331
|
-
]),
|
|
331
|
+
]), mi = new A([
|
|
332
332
|
// CSS System Colors
|
|
333
333
|
// Spec: https://drafts.csswg.org/css-color/#css-system-colors
|
|
334
334
|
"accentcolor",
|
|
@@ -350,7 +350,7 @@ const pi = new A([
|
|
|
350
350
|
"selecteditem",
|
|
351
351
|
"selecteditemtext",
|
|
352
352
|
"visitedtext"
|
|
353
|
-
]),
|
|
353
|
+
]), gi = new A([
|
|
354
354
|
"rgba",
|
|
355
355
|
"rgb",
|
|
356
356
|
"hsla",
|
|
@@ -361,7 +361,7 @@ const pi = new A([
|
|
|
361
361
|
"lch",
|
|
362
362
|
"lab",
|
|
363
363
|
"oklab"
|
|
364
|
-
]),
|
|
364
|
+
]), di = new A([
|
|
365
365
|
"transparent",
|
|
366
366
|
"currentcolor"
|
|
367
367
|
]), ie = new A([
|
|
@@ -380,23 +380,23 @@ function te(r) {
|
|
|
380
380
|
let e = t.first;
|
|
381
381
|
return e.type === R && ie.has(e.name);
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function Ht(r) {
|
|
384
384
|
return parseFloat(r) === 0;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function yi(r) {
|
|
387
387
|
for (let t of r.children.toArray())
|
|
388
|
-
if (!(t.type ===
|
|
388
|
+
if (!(t.type === Yt && Ht(t.value)) && !(t.type === Ne && Ht(t.value)))
|
|
389
389
|
return !1;
|
|
390
390
|
return !0;
|
|
391
391
|
}
|
|
392
|
-
const
|
|
392
|
+
const wi = new A([
|
|
393
393
|
"caption",
|
|
394
394
|
"icon",
|
|
395
395
|
"menu",
|
|
396
396
|
"message-box",
|
|
397
397
|
"small-caption",
|
|
398
398
|
"status-bar"
|
|
399
|
-
]),
|
|
399
|
+
]), ki = new A([
|
|
400
400
|
/* <absolute-size> values */
|
|
401
401
|
"xx-small",
|
|
402
402
|
"x-small",
|
|
@@ -409,39 +409,41 @@ const yi = new A([
|
|
|
409
409
|
/* <relative-size> values */
|
|
410
410
|
"smaller",
|
|
411
411
|
"larger"
|
|
412
|
-
]), bi = 44,
|
|
412
|
+
]), bi = 44, Kt = 47;
|
|
413
413
|
function Ie(r) {
|
|
414
414
|
let t = r.children.first;
|
|
415
|
-
return t === null ? !1 : t.type === R &&
|
|
415
|
+
return t === null ? !1 : t.type === R && wi.has(t.name);
|
|
416
416
|
}
|
|
417
|
-
function
|
|
418
|
-
var
|
|
419
|
-
let e =
|
|
417
|
+
function xi(r, t, s) {
|
|
418
|
+
var b;
|
|
419
|
+
let e = [,], n, a;
|
|
420
|
+
if (r.children.first.type === "Function" && r.children.first.name.toLowerCase() === "var")
|
|
421
|
+
return null;
|
|
420
422
|
r.children.forEach(function(w, _) {
|
|
421
|
-
let
|
|
423
|
+
let k = _.prev ? _.prev.data : void 0, P = _.next ? _.next.data : void 0;
|
|
422
424
|
if (w.type === R && ie.has(w.name) && s({
|
|
423
425
|
type: "keyword",
|
|
424
426
|
value: w.name
|
|
425
|
-
}), P && P.type ===
|
|
427
|
+
}), P && P.type === K && P.value.charCodeAt(0) === Kt) {
|
|
426
428
|
n = t(w);
|
|
427
429
|
return;
|
|
428
430
|
}
|
|
429
|
-
if (
|
|
431
|
+
if (k && k.type === K && k.value.charCodeAt(0) === Kt) {
|
|
430
432
|
a = t(w);
|
|
431
433
|
return;
|
|
432
434
|
}
|
|
433
|
-
if (P && P.type ===
|
|
434
|
-
e[0] = w, !n &&
|
|
435
|
+
if (P && P.type === K && P.value.charCodeAt(0) === bi && !e[0]) {
|
|
436
|
+
e[0] = w, !n && k && (n = t(k));
|
|
435
437
|
return;
|
|
436
438
|
}
|
|
437
|
-
if (w.type !==
|
|
439
|
+
if (w.type !== Yt) {
|
|
438
440
|
if (_.next === null) {
|
|
439
|
-
e[1] = w, !n && !e[0] &&
|
|
441
|
+
e[1] = w, !n && !e[0] && k && (n = t(k));
|
|
440
442
|
return;
|
|
441
443
|
}
|
|
442
444
|
if (w.type === R) {
|
|
443
445
|
let D = w.name;
|
|
444
|
-
if (
|
|
446
|
+
if (ki.has(D)) {
|
|
445
447
|
n = D;
|
|
446
448
|
return;
|
|
447
449
|
}
|
|
@@ -456,7 +458,7 @@ function ki(r, t, s) {
|
|
|
456
458
|
end: {
|
|
457
459
|
// Either the node we detected as the last node, or the end of the whole value
|
|
458
460
|
// It's never 0 because the first node is always a font-size or font-style
|
|
459
|
-
offset: ((
|
|
461
|
+
offset: ((b = e[1]) == null ? void 0 : b.loc.end.offset) || r.loc.end.offset
|
|
460
462
|
}
|
|
461
463
|
}
|
|
462
464
|
}) : null;
|
|
@@ -466,7 +468,7 @@ function ki(r, t, s) {
|
|
|
466
468
|
font_family: y
|
|
467
469
|
};
|
|
468
470
|
}
|
|
469
|
-
const
|
|
471
|
+
const Ci = new A([
|
|
470
472
|
"linear",
|
|
471
473
|
"ease",
|
|
472
474
|
"ease-in",
|
|
@@ -474,36 +476,36 @@ const xi = new A([
|
|
|
474
476
|
"ease-in-out",
|
|
475
477
|
"step-start",
|
|
476
478
|
"step-end"
|
|
477
|
-
]),
|
|
479
|
+
]), zi = new A([
|
|
478
480
|
"cubic-bezier",
|
|
479
481
|
"steps"
|
|
480
482
|
]);
|
|
481
|
-
function
|
|
483
|
+
function Si(r, t) {
|
|
482
484
|
let s = !1;
|
|
483
485
|
for (let e of r) {
|
|
484
486
|
let n = e.type, a = e.name;
|
|
485
|
-
n ===
|
|
487
|
+
n === K ? s = !1 : n === Ne && s === !1 ? (s = !0, t({
|
|
486
488
|
type: "duration",
|
|
487
489
|
value: e
|
|
488
|
-
})) : n === R ?
|
|
490
|
+
})) : n === R ? Ci.has(a) ? t({
|
|
489
491
|
type: "fn",
|
|
490
492
|
value: e
|
|
491
493
|
}) : ie.has(a) && t({
|
|
492
494
|
type: "keyword",
|
|
493
495
|
value: e
|
|
494
|
-
}) : n === je &&
|
|
496
|
+
}) : n === je && zi.has(a) && t({
|
|
495
497
|
type: "fn",
|
|
496
498
|
value: e
|
|
497
499
|
});
|
|
498
500
|
}
|
|
499
501
|
}
|
|
500
|
-
function
|
|
502
|
+
function Xt(r) {
|
|
501
503
|
let t = r.children;
|
|
502
504
|
if (!t)
|
|
503
505
|
return !1;
|
|
504
506
|
for (let s of t) {
|
|
505
507
|
let { type: e, name: n } = s;
|
|
506
|
-
if (e === R &&
|
|
508
|
+
if (e === R && E(n) || e === je && (E(n) || Xt(s)))
|
|
507
509
|
return !0;
|
|
508
510
|
}
|
|
509
511
|
return !1;
|
|
@@ -552,7 +554,7 @@ class o {
|
|
|
552
554
|
*/
|
|
553
555
|
c() {
|
|
554
556
|
let t = /* @__PURE__ */ new Map(), s = {}, e = this._useLocations, n = this._items, a = this._nodes, y = n.size;
|
|
555
|
-
n.forEach((_,
|
|
557
|
+
n.forEach((_, k) => {
|
|
556
558
|
if (e) {
|
|
557
559
|
let P = _.map(function(D) {
|
|
558
560
|
let T = D * 4;
|
|
@@ -563,15 +565,15 @@ class o {
|
|
|
563
565
|
length: a[T + 3]
|
|
564
566
|
};
|
|
565
567
|
});
|
|
566
|
-
t.set(
|
|
568
|
+
t.set(k, P);
|
|
567
569
|
} else
|
|
568
|
-
s[
|
|
570
|
+
s[k] = _.length;
|
|
569
571
|
});
|
|
570
|
-
let
|
|
571
|
-
total:
|
|
572
|
+
let b = this._total, w = {
|
|
573
|
+
total: b,
|
|
572
574
|
totalUnique: y,
|
|
573
575
|
unique: s,
|
|
574
|
-
uniquenessRatio:
|
|
576
|
+
uniquenessRatio: b === 0 ? 0 : y / b
|
|
575
577
|
};
|
|
576
578
|
return e && (w.uniqueWithLocations = Object.fromEntries(t)), w;
|
|
577
579
|
}
|
|
@@ -599,11 +601,11 @@ class Ue {
|
|
|
599
601
|
});
|
|
600
602
|
}
|
|
601
603
|
}
|
|
602
|
-
function
|
|
604
|
+
function _i(r) {
|
|
603
605
|
let t = /* @__PURE__ */ new Map(), s = -1, e = 0, n = 0, a = r.length;
|
|
604
606
|
for (let y = 0; y < a; y++) {
|
|
605
|
-
let
|
|
606
|
-
t.set(
|
|
607
|
+
let b = r[y], w = (t.get(b) || 0) + 1;
|
|
608
|
+
t.set(b, w), w > s && (s = w, e = 0, n = 0), w >= s && (e++, n += b);
|
|
607
609
|
}
|
|
608
610
|
return n / e;
|
|
609
611
|
}
|
|
@@ -632,7 +634,7 @@ class C {
|
|
|
632
634
|
range: 0,
|
|
633
635
|
sum: 0
|
|
634
636
|
};
|
|
635
|
-
let s = this._items.slice().sort((
|
|
637
|
+
let s = this._items.slice().sort((b, w) => b - w), e = s[0], n = s[t - 1], a = _i(s), y = this._sum;
|
|
636
638
|
return {
|
|
637
639
|
min: e,
|
|
638
640
|
max: n,
|
|
@@ -649,8 +651,8 @@ class C {
|
|
|
649
651
|
return this._items;
|
|
650
652
|
}
|
|
651
653
|
}
|
|
652
|
-
function
|
|
653
|
-
if (Be(r) ||
|
|
654
|
+
function qi(r) {
|
|
655
|
+
if (Be(r) || E(r)) return !1;
|
|
654
656
|
let t = r.charCodeAt(0);
|
|
655
657
|
return t === 47 || t === 42 || t === 95 || t === 43 || t === 38 || t === 36 || t === 35;
|
|
656
658
|
}
|
|
@@ -661,13 +663,13 @@ function m(r, t) {
|
|
|
661
663
|
return Be(t) ? !1 : O(r, t);
|
|
662
664
|
}
|
|
663
665
|
function vi(r) {
|
|
664
|
-
return
|
|
666
|
+
return E(r) ? r.slice(r.indexOf("-", 2) + 1) : r;
|
|
665
667
|
}
|
|
666
|
-
function
|
|
668
|
+
function Ai(r) {
|
|
667
669
|
let t = 5, s = r.indexOf(";"), e = r.indexOf(",");
|
|
668
670
|
return s === -1 || e !== -1 && e < s ? r.substring(t, e) : r.substring(t, s);
|
|
669
671
|
}
|
|
670
|
-
function
|
|
672
|
+
function Pi(r) {
|
|
671
673
|
let t = r.children;
|
|
672
674
|
if (t) {
|
|
673
675
|
let s = t.last;
|
|
@@ -675,7 +677,7 @@ function Ai(r) {
|
|
|
675
677
|
}
|
|
676
678
|
return !1;
|
|
677
679
|
}
|
|
678
|
-
let
|
|
680
|
+
let Li = new A([
|
|
679
681
|
"border-radius",
|
|
680
682
|
"border-top-left-radius",
|
|
681
683
|
"border-top-right-radius",
|
|
@@ -689,11 +691,11 @@ let Pi = new A([
|
|
|
689
691
|
function z(r, t) {
|
|
690
692
|
return t === 0 ? 0 : r / t;
|
|
691
693
|
}
|
|
692
|
-
let
|
|
694
|
+
let Oi = {
|
|
693
695
|
useLocations: !1
|
|
694
696
|
};
|
|
695
697
|
function Ei(r, t = {}) {
|
|
696
|
-
let e = Object.assign({},
|
|
698
|
+
let e = Object.assign({}, Oi, t).useLocations === !0, n = Date.now();
|
|
697
699
|
function a(i) {
|
|
698
700
|
return y(i).trim();
|
|
699
701
|
}
|
|
@@ -701,21 +703,21 @@ function Ei(r, t = {}) {
|
|
|
701
703
|
let Y = i.loc;
|
|
702
704
|
return r.substring(Y.start.offset, Y.end.offset);
|
|
703
705
|
}
|
|
704
|
-
let
|
|
706
|
+
let b = 0, w = 0, _ = 0, k = {
|
|
705
707
|
total: 0,
|
|
706
708
|
/** @type {Map<string, { size: number, count: number } & ({ uniqueWithLocations?: undefined } | ({ uniqueWithLocations: { offset: number, line: number, column: number, length: number }[] })) }>} */
|
|
707
709
|
unique: /* @__PURE__ */ new Map()
|
|
708
|
-
}, P = Date.now(), D =
|
|
710
|
+
}, P = Date.now(), D = ei(r, {
|
|
709
711
|
parseCustomProperty: !0,
|
|
710
712
|
// To find font-families, colors, etc.
|
|
711
713
|
positions: !0,
|
|
712
714
|
// So we can use stringifyNode()
|
|
713
715
|
/** @param {string} comment */
|
|
714
716
|
onComment: function(i) {
|
|
715
|
-
|
|
717
|
+
b++, w += i.length;
|
|
716
718
|
}
|
|
717
|
-
}), T = Date.now(),
|
|
718
|
-
|
|
719
|
+
}), T = Date.now(), $t = D.loc.end.line - D.loc.start.line + 1, Ye = new o(e), re = new C(), se = [], Ge = new o(e), le = new o(e), Qe = new o(e), Ze = new o(e), Je = new o(e), Xe = new o(e), $e = new o(e), ne = new o(e), et = new o(e), ae = new o(e), oe = new o(e), tt = new o(e), Q = new o(e), it = new o(e), ue = new C(), rt = new o(e), ce = 0, fe = 0, pe = new C(), he = new C(), me = new C(), st = new o(e), lt = new o(e), nt = new o(e), ge = new C(), at = new o(e), de = new o(e), ot = /* @__PURE__ */ new Set(), ye = new o(e), M, I, ut = new C(), ct = new C(), ft = new C(), pt = new o(e), Z = new C(), ht = new o(e), mt = [], we = new o(e), ke = new o(e), gt = new o(e), dt = new o(e), be = new C(), yt = new o(e), wt = /* @__PURE__ */ new Set(), W = 0, kt = new C(), J = 0, xe = 0, Ce = new o(e), ze = new C(), bt = new o(e), N = new o(e), Se = new o(e), _e = new o(e), X = new o(e), j = new C(), qe = new C(), xt = new o(e), ve = new o(e), Ct = new o(e), zt = new o(e), St = new o(e), Ae = new o(e), Pe = new o(e), Le = new o(e), $ = new o(e), ee = new o(e), U = new Ue(e), V = new o(e), Oe = new Ue(e), _t = new o(e), B = new o(e), qt = new Ue(e), vt = new o(e), L = 0;
|
|
720
|
+
v(D, {
|
|
719
721
|
enter(i) {
|
|
720
722
|
var Y, Mt;
|
|
721
723
|
switch (i.type) {
|
|
@@ -733,14 +735,14 @@ function Ei(r, t = {}) {
|
|
|
733
735
|
if (i.prelude !== null) {
|
|
734
736
|
let g = i.prelude, c = g && a(i.prelude), f = g.loc;
|
|
735
737
|
if (p === "media")
|
|
736
|
-
Ze.p(c, f),
|
|
738
|
+
Ze.p(c, f), ui(g) && (Je.p(c, f), l++);
|
|
737
739
|
else if (p === "supports")
|
|
738
|
-
ne.p(c, f),
|
|
740
|
+
ne.p(c, f), oi(g) && (et.p(c, f), l++);
|
|
739
741
|
else if (O("keyframes", p)) {
|
|
740
742
|
let u = "@" + p + " " + c;
|
|
741
|
-
|
|
743
|
+
E(p) && (oe.p(u, f), l++), ae.p(u, f);
|
|
742
744
|
} else if (p === "import")
|
|
743
|
-
|
|
745
|
+
v(i, function(u) {
|
|
744
746
|
if (u.type === "Condition" && u.kind === "supports") {
|
|
745
747
|
let h = a(u);
|
|
746
748
|
return ne.p(h, u.loc), this.break;
|
|
@@ -772,20 +774,20 @@ function Ei(r, t = {}) {
|
|
|
772
774
|
pe.push(f + u), st.p(f + u, i.loc), he.push(f), lt.p(f, p.loc), me.push(u), nt.p(u, l.loc), ge.push(L), at.p(L, i.loc), ce++, u === 0 && fe++;
|
|
773
775
|
break;
|
|
774
776
|
}
|
|
775
|
-
case
|
|
777
|
+
case We: {
|
|
776
778
|
let p = a(i);
|
|
777
779
|
if (this.atrule && O("keyframes", this.atrule.name))
|
|
778
780
|
return de.p(p, i.loc), this.skip;
|
|
779
|
-
|
|
780
|
-
let l =
|
|
781
|
+
Zt(i) && ke.p(p, i.loc);
|
|
782
|
+
let l = fi(i);
|
|
781
783
|
if (l !== !1)
|
|
782
784
|
for (let x of l)
|
|
783
785
|
gt.p(x, i.loc);
|
|
784
|
-
let g =
|
|
785
|
-
|
|
786
|
-
let c =
|
|
787
|
-
return pt.p(c.toString(), i.loc), ut.push(f), ct.push(u), ft.push(h), M === void 0 && (M = c), I === void 0 && (I = c), I !== void 0 && Wt(I, c) < 0 && (I = c), M !== void 0 && Wt(M, c) > 0 && (M = c), mt.push(c), f > 0 && we.p(p, i.loc),
|
|
788
|
-
dt.p(
|
|
786
|
+
let g = Jt(i);
|
|
787
|
+
ci(i) && ye.p(p, i.loc), ot.add(p), Z.push(g), ht.p(g, i.loc), be.push(L - 1), yt.p(L - 1, i.loc);
|
|
788
|
+
let c = ti(i).toArray(), [f, u, h] = c;
|
|
789
|
+
return pt.p(c.toString(), i.loc), ut.push(f), ct.push(u), ft.push(h), M === void 0 && (M = c), I === void 0 && (I = c), I !== void 0 && Wt(I, c) < 0 && (I = c), M !== void 0 && Wt(M, c) > 0 && (M = c), mt.push(c), f > 0 && we.p(p, i.loc), pi(i, function(q) {
|
|
790
|
+
dt.p(q.name, q.loc);
|
|
789
791
|
}), this.skip;
|
|
790
792
|
}
|
|
791
793
|
case Ne: {
|
|
@@ -794,10 +796,10 @@ function Ei(r, t = {}) {
|
|
|
794
796
|
let p = i.unit;
|
|
795
797
|
return O("\\9", p) ? Oe.push(p.substring(0, p.length - 2), this.declaration.property, i.loc) : Oe.push(p, this.declaration.property, i.loc), this.skip;
|
|
796
798
|
}
|
|
797
|
-
case
|
|
798
|
-
if (
|
|
799
|
-
let p = i.value, l = p.length, g =
|
|
800
|
-
|
|
799
|
+
case ai: {
|
|
800
|
+
if (Ke("data:", i.value)) {
|
|
801
|
+
let p = i.value, l = p.length, g = Ai(p);
|
|
802
|
+
k.total++, _ += l;
|
|
801
803
|
let c = {
|
|
802
804
|
/** @type {number} */
|
|
803
805
|
line: i.loc.start.line,
|
|
@@ -808,38 +810,41 @@ function Ei(r, t = {}) {
|
|
|
808
810
|
/** @type {number} */
|
|
809
811
|
length: i.loc.end.offset - i.loc.start.offset
|
|
810
812
|
};
|
|
811
|
-
if (
|
|
812
|
-
let f =
|
|
813
|
-
f.count++, f.size += l,
|
|
813
|
+
if (k.unique.has(g)) {
|
|
814
|
+
let f = k.unique.get(g);
|
|
815
|
+
f.count++, f.size += l, k.unique.set(g, f), e && f.uniqueWithLocations.push(c);
|
|
814
816
|
} else {
|
|
815
817
|
let f = {
|
|
816
818
|
count: 1,
|
|
817
819
|
size: l
|
|
818
820
|
};
|
|
819
|
-
e && (f.uniqueWithLocations = [c]),
|
|
821
|
+
e && (f.uniqueWithLocations = [c]), k.unique.set(g, f);
|
|
820
822
|
}
|
|
821
823
|
}
|
|
822
824
|
break;
|
|
823
825
|
}
|
|
824
|
-
case
|
|
826
|
+
case ri: {
|
|
825
827
|
if (te(i)) {
|
|
826
|
-
|
|
828
|
+
qe.push(1), B.p(a(i), i.loc);
|
|
827
829
|
break;
|
|
828
830
|
}
|
|
829
831
|
let p = this.declaration, { property: l, important: g } = p, c = 1;
|
|
830
|
-
|
|
832
|
+
Xt(i) && (xt.p(a(i), i.loc), c++), typeof g == "string" && (ve.p(y(i) + "!" + g, i.loc), c++), Pi(i) && (ve.p(a(i), i.loc), c++);
|
|
831
833
|
let f = i.children, u = i.loc;
|
|
832
|
-
if (
|
|
833
|
-
|
|
834
|
+
if (qe.push(c), m("margin", l) || m("margin-block", l) || m("margin-inline", l) || m("margin-top", l) || m("margin-right", l) || m("margin-bottom", l) || m("margin-left", l) || m("padding", l) || m("padding-block", l) || m("padding-inline", l) || m("padding-top", l) || m("padding-right", l) || m("padding-bottom", l) || m("padding-left", l))
|
|
835
|
+
yi(i) && vt.p(l, p.loc);
|
|
834
836
|
else {
|
|
835
837
|
if (m("z-index", l))
|
|
836
838
|
return Ct.p(a(i), u), this.skip;
|
|
837
839
|
if (m("font", l)) {
|
|
838
840
|
if (Ie(i)) return;
|
|
839
|
-
let
|
|
840
|
-
|
|
841
|
+
let h = xi(i, a, function(It) {
|
|
842
|
+
It.type === "keyword" && B.p(It.value, u);
|
|
841
843
|
});
|
|
842
|
-
|
|
844
|
+
if (!h)
|
|
845
|
+
return this.skip;
|
|
846
|
+
let { font_size: x, line_height: q, font_family: F } = h;
|
|
847
|
+
F && Ae.p(F, u), x && Pe.p(x, u), q && Le.p(q, u);
|
|
843
848
|
break;
|
|
844
849
|
} else if (m("font-size", l)) {
|
|
845
850
|
Ie(i) || Pe.p(a(i), u);
|
|
@@ -850,54 +855,54 @@ function Ei(r, t = {}) {
|
|
|
850
855
|
} else if (m("line-height", l))
|
|
851
856
|
Le.p(a(i), u);
|
|
852
857
|
else if (m("transition", l) || m("animation", l)) {
|
|
853
|
-
|
|
858
|
+
Si(f, function(h) {
|
|
854
859
|
h.type === "fn" ? $.p(a(h.value), u) : h.type === "duration" ? ee.p(a(h.value), u) : h.type === "keyword" && B.p(a(h.value), u);
|
|
855
860
|
});
|
|
856
861
|
break;
|
|
857
862
|
} else if (m("animation-duration", l) || m("transition-duration", l)) {
|
|
858
863
|
f && f.size > 1 ? f.forEach((h) => {
|
|
859
|
-
h.type !==
|
|
864
|
+
h.type !== K && ee.p(a(h), u);
|
|
860
865
|
}) : ee.p(a(i), u);
|
|
861
866
|
break;
|
|
862
867
|
} else if (m("transition-timing-function", l) || m("animation-timing-function", l)) {
|
|
863
868
|
f && f.size > 1 ? f.forEach((h) => {
|
|
864
|
-
h.type !==
|
|
869
|
+
h.type !== K && $.p(a(h), u);
|
|
865
870
|
}) : $.p(a(i), u);
|
|
866
871
|
break;
|
|
867
872
|
} else if (m("container-name", l))
|
|
868
873
|
Q.p(a(i), u);
|
|
869
874
|
else if (m("container", l))
|
|
870
875
|
((Mt = f.first) == null ? void 0 : Mt.type) === "Identifier" && Q.p(f.first.name, u);
|
|
871
|
-
else if (
|
|
872
|
-
te(i) ||
|
|
876
|
+
else if (Li.has(vi(l))) {
|
|
877
|
+
te(i) || qt.push(a(i), l, u);
|
|
873
878
|
break;
|
|
874
879
|
} else m("text-shadow", l) ? te(i) || zt.p(a(i), u) : m("box-shadow", l) && (te(i) || St.p(a(i), u));
|
|
875
880
|
}
|
|
876
|
-
|
|
881
|
+
v(i, function(h) {
|
|
877
882
|
let x = h.name;
|
|
878
883
|
switch (h.type) {
|
|
879
|
-
case
|
|
880
|
-
let
|
|
881
|
-
return O("\\9", h.value) && (
|
|
884
|
+
case ni: {
|
|
885
|
+
let q = h.value.length;
|
|
886
|
+
return O("\\9", h.value) && (q = q - 2), U.push("#" + h.value, l, u), V.p("hex" + q, u), this.skip;
|
|
882
887
|
}
|
|
883
888
|
case R: {
|
|
884
889
|
ie.has(x) && B.p(x, u);
|
|
885
|
-
let
|
|
886
|
-
if (
|
|
890
|
+
let q = x.length;
|
|
891
|
+
if (q > 20 || q < 3)
|
|
887
892
|
return this.skip;
|
|
888
|
-
if (
|
|
889
|
-
let
|
|
890
|
-
U.push(
|
|
893
|
+
if (di.has(x)) {
|
|
894
|
+
let F = a(h);
|
|
895
|
+
U.push(F, l, u), V.p(x.toLowerCase(), u);
|
|
891
896
|
return;
|
|
892
897
|
}
|
|
893
|
-
if (
|
|
894
|
-
let
|
|
895
|
-
U.push(
|
|
898
|
+
if (hi.has(x)) {
|
|
899
|
+
let F = a(h);
|
|
900
|
+
U.push(F, l, u), V.p("named", u);
|
|
896
901
|
return;
|
|
897
902
|
}
|
|
898
|
-
if (
|
|
899
|
-
let
|
|
900
|
-
U.push(
|
|
903
|
+
if (mi.has(x)) {
|
|
904
|
+
let F = a(h);
|
|
905
|
+
U.push(F, l, u), V.p("system", u);
|
|
901
906
|
return;
|
|
902
907
|
}
|
|
903
908
|
return this.skip;
|
|
@@ -905,7 +910,7 @@ function Ei(r, t = {}) {
|
|
|
905
910
|
case je: {
|
|
906
911
|
if (S("var", x))
|
|
907
912
|
return this.skip;
|
|
908
|
-
if (
|
|
913
|
+
if (gi.has(x)) {
|
|
909
914
|
U.push(a(h), l, h.loc), V.p(x.toLowerCase(), h.loc);
|
|
910
915
|
return;
|
|
911
916
|
}
|
|
@@ -921,9 +926,9 @@ function Ei(r, t = {}) {
|
|
|
921
926
|
case Ve: {
|
|
922
927
|
if (this.atrulePrelude !== null)
|
|
923
928
|
return this.skip;
|
|
924
|
-
|
|
929
|
+
W++;
|
|
925
930
|
let p = 1;
|
|
926
|
-
wt.add(a(i)), ze.push(L - 1),
|
|
931
|
+
wt.add(a(i)), ze.push(L - 1), bt.p(L - 1, i.loc), i.important === !0 && (J++, p++, this.atrule && O("keyframes", this.atrule.name) && (xe++, p++)), kt.push(p);
|
|
927
932
|
let { property: l, loc: { start: g } } = i, c = {
|
|
928
933
|
start: {
|
|
929
934
|
line: g.line,
|
|
@@ -934,7 +939,7 @@ function Ei(r, t = {}) {
|
|
|
934
939
|
offset: g.offset + l.length
|
|
935
940
|
}
|
|
936
941
|
};
|
|
937
|
-
N.p(l, c),
|
|
942
|
+
N.p(l, c), E(l) ? (_e.p(l, c), j.push(2)) : qi(l) ? (Se.p(l, c), j.push(2)) : Be(l) ? (X.p(l, c), j.push(i.important ? 3 : 2), i.important === !0 && Ce.p(l, c)) : j.push(1);
|
|
938
943
|
break;
|
|
939
944
|
}
|
|
940
945
|
}
|
|
@@ -944,15 +949,15 @@ function Ei(r, t = {}) {
|
|
|
944
949
|
(i.type === Me || i.type === Te) && L--;
|
|
945
950
|
}
|
|
946
951
|
});
|
|
947
|
-
let At = wt.size, H = Z.size(), Re = ut.aggregate(), De = ct.aggregate(),
|
|
952
|
+
let At = wt.size, H = Z.size(), Re = ut.aggregate(), De = ct.aggregate(), Fe = ft.aggregate(), Pt = ot.size, d = Object.assign, Lt = r.length, Ee = se.length, Ot = re.aggregate(), Rt = Z.aggregate(), Dt = kt.aggregate(), Ft = j.aggregate(), Et = qe.aggregate(), Tt = Ye.c();
|
|
948
953
|
return {
|
|
949
954
|
stylesheet: {
|
|
950
|
-
sourceLinesOfCode: Tt.total + H +
|
|
951
|
-
linesOfCode:
|
|
955
|
+
sourceLinesOfCode: Tt.total + H + W + de.size(),
|
|
956
|
+
linesOfCode: $t,
|
|
952
957
|
size: Lt,
|
|
953
|
-
complexity: Ot.sum + Rt.sum + Dt.sum +
|
|
958
|
+
complexity: Ot.sum + Rt.sum + Dt.sum + Ft.sum + Et.sum,
|
|
954
959
|
comments: {
|
|
955
|
-
total:
|
|
960
|
+
total: b,
|
|
956
961
|
size: w
|
|
957
962
|
},
|
|
958
963
|
embeddedContent: {
|
|
@@ -961,10 +966,10 @@ function Ei(r, t = {}) {
|
|
|
961
966
|
ratio: z(_, Lt)
|
|
962
967
|
},
|
|
963
968
|
types: {
|
|
964
|
-
total:
|
|
965
|
-
totalUnique:
|
|
966
|
-
uniquenessRatio: z(
|
|
967
|
-
unique: Object.fromEntries(
|
|
969
|
+
total: k.total,
|
|
970
|
+
totalUnique: k.unique.size,
|
|
971
|
+
uniquenessRatio: z(k.unique.size, k.total),
|
|
972
|
+
unique: Object.fromEntries(k.unique)
|
|
968
973
|
}
|
|
969
974
|
}
|
|
970
975
|
},
|
|
@@ -972,10 +977,10 @@ function Ei(r, t = {}) {
|
|
|
972
977
|
Tt,
|
|
973
978
|
{
|
|
974
979
|
fontface: d({
|
|
975
|
-
total:
|
|
976
|
-
totalUnique:
|
|
980
|
+
total: Ee,
|
|
981
|
+
totalUnique: Ee,
|
|
977
982
|
unique: se,
|
|
978
|
-
uniquenessRatio:
|
|
983
|
+
uniquenessRatio: Ee === 0 ? 0 : 1
|
|
979
984
|
}, e ? {
|
|
980
985
|
uniqueWithLocations: Ge.c().uniqueWithLocations
|
|
981
986
|
} : {}),
|
|
@@ -1069,11 +1074,11 @@ function Ei(r, t = {}) {
|
|
|
1069
1074
|
/** @type Specificity */
|
|
1070
1075
|
max: M === void 0 ? [0, 0, 0] : M,
|
|
1071
1076
|
/** @type Specificity */
|
|
1072
|
-
sum: [Re.sum, De.sum,
|
|
1077
|
+
sum: [Re.sum, De.sum, Fe.sum],
|
|
1073
1078
|
/** @type Specificity */
|
|
1074
|
-
mean: [Re.mean, De.mean,
|
|
1079
|
+
mean: [Re.mean, De.mean, Fe.mean],
|
|
1075
1080
|
/** @type Specificity */
|
|
1076
|
-
mode: [Re.mode, De.mode,
|
|
1081
|
+
mode: [Re.mode, De.mode, Fe.mode],
|
|
1077
1082
|
/** @type Specificity */
|
|
1078
1083
|
items: mt
|
|
1079
1084
|
},
|
|
@@ -1087,9 +1092,9 @@ function Ei(r, t = {}) {
|
|
|
1087
1092
|
}
|
|
1088
1093
|
),
|
|
1089
1094
|
nesting: d(
|
|
1090
|
-
|
|
1095
|
+
be.aggregate(),
|
|
1091
1096
|
{
|
|
1092
|
-
items:
|
|
1097
|
+
items: be.toArray()
|
|
1093
1098
|
},
|
|
1094
1099
|
yt.c()
|
|
1095
1100
|
),
|
|
@@ -1101,9 +1106,9 @@ function Ei(r, t = {}) {
|
|
|
1101
1106
|
),
|
|
1102
1107
|
pseudoClasses: gt.c(),
|
|
1103
1108
|
accessibility: d(
|
|
1104
|
-
|
|
1109
|
+
ke.c(),
|
|
1105
1110
|
{
|
|
1106
|
-
ratio: z(
|
|
1111
|
+
ratio: z(ke.size(), H)
|
|
1107
1112
|
}
|
|
1108
1113
|
),
|
|
1109
1114
|
keyframes: de.c(),
|
|
@@ -1116,12 +1121,12 @@ function Ei(r, t = {}) {
|
|
|
1116
1121
|
combinators: dt.c()
|
|
1117
1122
|
},
|
|
1118
1123
|
declarations: {
|
|
1119
|
-
total:
|
|
1124
|
+
total: W,
|
|
1120
1125
|
totalUnique: At,
|
|
1121
|
-
uniquenessRatio: z(At,
|
|
1126
|
+
uniquenessRatio: z(At, W),
|
|
1122
1127
|
importants: {
|
|
1123
1128
|
total: J,
|
|
1124
|
-
ratio: z(J,
|
|
1129
|
+
ratio: z(J, W),
|
|
1125
1130
|
inKeyframes: {
|
|
1126
1131
|
total: xe,
|
|
1127
1132
|
ratio: z(xe, J)
|
|
@@ -1133,7 +1138,7 @@ function Ei(r, t = {}) {
|
|
|
1133
1138
|
{
|
|
1134
1139
|
items: ze.toArray()
|
|
1135
1140
|
},
|
|
1136
|
-
|
|
1141
|
+
bt.c()
|
|
1137
1142
|
)
|
|
1138
1143
|
},
|
|
1139
1144
|
properties: d(
|
|
@@ -1163,7 +1168,7 @@ function Ei(r, t = {}) {
|
|
|
1163
1168
|
ratio: z(Se.size(), N.size())
|
|
1164
1169
|
}
|
|
1165
1170
|
),
|
|
1166
|
-
complexity:
|
|
1171
|
+
complexity: Ft
|
|
1167
1172
|
}
|
|
1168
1173
|
),
|
|
1169
1174
|
values: {
|
|
@@ -1180,17 +1185,17 @@ function Ei(r, t = {}) {
|
|
|
1180
1185
|
zindexes: Ct.c(),
|
|
1181
1186
|
textShadows: zt.c(),
|
|
1182
1187
|
boxShadows: St.c(),
|
|
1183
|
-
borderRadiuses:
|
|
1188
|
+
borderRadiuses: qt.count(),
|
|
1184
1189
|
animations: {
|
|
1185
1190
|
durations: ee.c(),
|
|
1186
1191
|
timingFunctions: $.c()
|
|
1187
1192
|
},
|
|
1188
1193
|
prefixes: xt.c(),
|
|
1189
|
-
browserhacks:
|
|
1194
|
+
browserhacks: ve.c(),
|
|
1190
1195
|
units: Oe.count(),
|
|
1191
|
-
complexity:
|
|
1196
|
+
complexity: Et,
|
|
1192
1197
|
keywords: B.c(),
|
|
1193
|
-
resets:
|
|
1198
|
+
resets: vt.c()
|
|
1194
1199
|
},
|
|
1195
1200
|
__meta__: {
|
|
1196
1201
|
parseTime: T - P,
|
|
@@ -1203,14 +1208,20 @@ function Wt(r, t) {
|
|
|
1203
1208
|
return r[0] === t[0] ? r[1] === t[1] ? t[2] - r[2] : t[1] - r[1] : t[0] - r[0];
|
|
1204
1209
|
}
|
|
1205
1210
|
export {
|
|
1211
|
+
A as KeywordSet,
|
|
1206
1212
|
Ei as analyze,
|
|
1213
|
+
gi as colorFunctions,
|
|
1214
|
+
di as colorKeywords,
|
|
1207
1215
|
Wt as compareSpecificity,
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
+
ie as cssKeywords,
|
|
1217
|
+
E as hasVendorPrefix,
|
|
1218
|
+
Zt as isAccessibilitySelector,
|
|
1219
|
+
ui as isMediaBrowserhack,
|
|
1220
|
+
qi as isPropertyHack,
|
|
1221
|
+
ci as isSelectorPrefixed,
|
|
1222
|
+
oi as isSupportsBrowserhack,
|
|
1223
|
+
Xt as isValuePrefixed,
|
|
1224
|
+
hi as namedColors,
|
|
1225
|
+
Jt as selectorComplexity,
|
|
1226
|
+
mi as systemColors
|
|
1216
1227
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1035,7 +1035,9 @@ export function analyze(css: string, options?: Options): {
|
|
|
1035
1035
|
export function compareSpecificity(a: Specificity, b: Specificity): number;
|
|
1036
1036
|
export { isHack as isPropertyHack } from './properties/property-utils.js';
|
|
1037
1037
|
export { isValuePrefixed } from './values/vendor-prefix.js';
|
|
1038
|
+
export { keywords as cssKeywords } from './values/values.js';
|
|
1038
1039
|
export { hasVendorPrefix } from './vendor-prefix.js';
|
|
1040
|
+
export { KeywordSet } from './keyword-set.js';
|
|
1039
1041
|
export type Options = {
|
|
1040
1042
|
/**
|
|
1041
1043
|
* Use Locations (`{ 'item': [{ line, column, offset, length }] }`) instead of a regular count per occurrence (`{ 'item': 3 }`)
|
|
@@ -1045,3 +1047,4 @@ export type Options = {
|
|
|
1045
1047
|
export type Specificity = [number, number, number];
|
|
1046
1048
|
export { getComplexity as selectorComplexity, isPrefixed as isSelectorPrefixed, isAccessibility as isAccessibilitySelector } from './selectors/utils.js';
|
|
1047
1049
|
export { isSupportsBrowserhack, isMediaBrowserhack } from './atrules/atrules.js';
|
|
1050
|
+
export { colorFunctions, colorKeywords, namedColors, systemColors } from './values/colors.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@projectwallace/css-analyzer",
|
|
3
3
|
"description": "The best CSS analyzer out there. Check design tokens, complexity, specificity, performance and more.",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.6.0",
|
|
5
5
|
"author": "Bart Veneman",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|