chaincss 2.1.20 → 2.1.22
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/index.js +1 -11
- package/dist/runtime/index.js +1 -11
- package/package.json +1 -1
- package/src/runtime/index.ts +2 -14
package/dist/index.js
CHANGED
|
@@ -3353,18 +3353,8 @@ var compileRuntime = (s, moduleId) => styleInjector.injectMultiple(s, moduleId);
|
|
|
3353
3353
|
// src/runtime/index.ts
|
|
3354
3354
|
function injectChainStyles(styles) {
|
|
3355
3355
|
let css = "";
|
|
3356
|
-
let staticCount = 0, dynamicCount = 0, hybridCount = 0;
|
|
3357
3356
|
for (const [key, obj] of Object.entries(styles)) {
|
|
3358
3357
|
if (!obj || !obj.selectors) continue;
|
|
3359
|
-
let stat = 0, dyn = 0;
|
|
3360
|
-
for (const [k, v] of Object.entries(obj)) {
|
|
3361
|
-
if (["selectors", "hover", "atRules", "nestedRules", "_name", "_classes", "__buildClasses", "__runtimeClasses", "__isHybrid"].includes(k)) continue;
|
|
3362
|
-
if (typeof v === "function") dyn++;
|
|
3363
|
-
else stat++;
|
|
3364
|
-
}
|
|
3365
|
-
if (stat > 0 && dyn > 0) hybridCount++;
|
|
3366
|
-
else if (dyn > 0) dynamicCount++;
|
|
3367
|
-
else staticCount++;
|
|
3368
3358
|
const sel = "." + obj.selectors[0];
|
|
3369
3359
|
css += sel + "{";
|
|
3370
3360
|
for (const [k, v] of Object.entries(obj)) {
|
|
@@ -3389,7 +3379,7 @@ function injectChainStyles(styles) {
|
|
|
3389
3379
|
el.setAttribute("data-chaincss", "runtime");
|
|
3390
3380
|
el.textContent = css;
|
|
3391
3381
|
document.head.appendChild(el);
|
|
3392
|
-
console.log("\u26D3\uFE0F ChainCSS
|
|
3382
|
+
console.log("\u26D3\uFE0F ChainCSS \u2014 " + Object.keys(styles).length + " styles injected | CSS: " + css.length + " bytes | smartChain auto-detect active");
|
|
3393
3383
|
return el;
|
|
3394
3384
|
}
|
|
3395
3385
|
|
package/dist/runtime/index.js
CHANGED
|
@@ -3909,18 +3909,8 @@ var injectStyleContextSvelte = (...args) => getSvelteExports().injectStyleContex
|
|
|
3909
3909
|
var chainStyles2 = (...args) => getSvelteExports().chainStyles?.(...args);
|
|
3910
3910
|
function injectChainStyles(styles3) {
|
|
3911
3911
|
let css = "";
|
|
3912
|
-
let staticCount = 0, dynamicCount = 0, hybridCount = 0;
|
|
3913
3912
|
for (const [key, obj] of Object.entries(styles3)) {
|
|
3914
3913
|
if (!obj || !obj.selectors) continue;
|
|
3915
|
-
let stat = 0, dyn = 0;
|
|
3916
|
-
for (const [k, v] of Object.entries(obj)) {
|
|
3917
|
-
if (["selectors", "hover", "atRules", "nestedRules", "_name", "_classes", "__buildClasses", "__runtimeClasses", "__isHybrid"].includes(k)) continue;
|
|
3918
|
-
if (typeof v === "function") dyn++;
|
|
3919
|
-
else stat++;
|
|
3920
|
-
}
|
|
3921
|
-
if (stat > 0 && dyn > 0) hybridCount++;
|
|
3922
|
-
else if (dyn > 0) dynamicCount++;
|
|
3923
|
-
else staticCount++;
|
|
3924
3914
|
const sel = "." + obj.selectors[0];
|
|
3925
3915
|
css += sel + "{";
|
|
3926
3916
|
for (const [k, v] of Object.entries(obj)) {
|
|
@@ -3945,7 +3935,7 @@ function injectChainStyles(styles3) {
|
|
|
3945
3935
|
el.setAttribute("data-chaincss", "runtime");
|
|
3946
3936
|
el.textContent = css;
|
|
3947
3937
|
document.head.appendChild(el);
|
|
3948
|
-
console.log("\u26D3\uFE0F ChainCSS
|
|
3938
|
+
console.log("\u26D3\uFE0F ChainCSS \u2014 " + Object.keys(styles3).length + " styles injected | CSS: " + css.length + " bytes | smartChain auto-detect active");
|
|
3949
3939
|
return el;
|
|
3950
3940
|
}
|
|
3951
3941
|
export {
|
package/package.json
CHANGED
package/src/runtime/index.ts
CHANGED
|
@@ -92,22 +92,10 @@ export type {
|
|
|
92
92
|
// Auto-inject styles into DOM
|
|
93
93
|
export function injectChainStyles(styles: Record<string, any>) {
|
|
94
94
|
let css = '';
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
|
|
97
96
|
for (const [key, obj] of Object.entries(styles)) {
|
|
98
97
|
if (!obj || !obj.selectors) continue;
|
|
99
98
|
|
|
100
|
-
// Count static vs dynamic
|
|
101
|
-
let stat = 0, dyn = 0;
|
|
102
|
-
for (const [k, v] of Object.entries(obj)) {
|
|
103
|
-
if (['selectors','hover','atRules','nestedRules','_name','_classes','__buildClasses','__runtimeClasses','__isHybrid'].includes(k)) continue;
|
|
104
|
-
if (typeof v === 'function') dyn++;
|
|
105
|
-
else stat++;
|
|
106
|
-
}
|
|
107
|
-
if (stat > 0 && dyn > 0) hybridCount++;
|
|
108
|
-
else if (dyn > 0) dynamicCount++;
|
|
109
|
-
else staticCount++;
|
|
110
|
-
|
|
111
99
|
const sel = '.' + obj.selectors[0];
|
|
112
100
|
css += sel + '{';
|
|
113
101
|
for (const [k, v] of Object.entries(obj)) {
|
|
@@ -134,7 +122,7 @@ export function injectChainStyles(styles: Record<string, any>) {
|
|
|
134
122
|
document.head.appendChild(el);
|
|
135
123
|
|
|
136
124
|
// Show split stats in console
|
|
137
|
-
console.log('⛓️ ChainCSS
|
|
125
|
+
console.log('⛓️ ChainCSS — ' + Object.keys(styles).length + ' styles injected | CSS: ' + css.length + ' bytes | smartChain auto-detect active');
|
|
138
126
|
|
|
139
127
|
return el;
|
|
140
128
|
}
|