chaincss 2.1.36 → 2.1.38
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/browser.js +2550 -2454
- package/dist/index.js +2616 -2518
- package/dist/plugins/vite.js +8 -1
- package/dist/runtime/index.d.ts +7 -3
- package/dist/runtime/index.js +2985 -2827
- package/package.json +1 -1
- package/src/plugins/vite.ts +9 -1
- package/src/runtime/index.ts +9 -10
package/package.json
CHANGED
package/src/plugins/vite.ts
CHANGED
|
@@ -276,7 +276,15 @@ export default function chaincssPlugin(options: ChainCSSPluginOptions = {}): Plu
|
|
|
276
276
|
|
|
277
277
|
if (id === resolvedCssId) {
|
|
278
278
|
const css = updateCSS();
|
|
279
|
-
|
|
279
|
+
// Return JS that injects the CSS into the DOM
|
|
280
|
+
if (css && css.trim()) {
|
|
281
|
+
return `const style = document.createElement('style');
|
|
282
|
+
style.setAttribute('data-chaincss', 'build');
|
|
283
|
+
style.textContent = ${JSON.stringify(css)};
|
|
284
|
+
document.head.appendChild(style);
|
|
285
|
+
export default {};`;
|
|
286
|
+
}
|
|
287
|
+
return 'export default {};';
|
|
280
288
|
}
|
|
281
289
|
|
|
282
290
|
return null;
|
package/src/runtime/index.ts
CHANGED
|
@@ -26,16 +26,15 @@ export {
|
|
|
26
26
|
useComputedStyles
|
|
27
27
|
} from './react.js';
|
|
28
28
|
|
|
29
|
-
// Vue composables
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} from './vue.js';
|
|
29
|
+
// Vue composables — lazy stubs (only load vue.js when called)
|
|
30
|
+
const _lazyVue = () => import('./vue.js');
|
|
31
|
+
export const useAtomicClassesVue = (...args: any[]) => _lazyVue().then((m: any) => m.useAtomicClasses(...args as any[]));
|
|
32
|
+
export const ChainCSSGlobalVue = (props: any) => { _lazyVue(); return null; };
|
|
33
|
+
export const createStyledVueComponent = (...args: any[]) => (...a: any[]) => { _lazyVue(); return null; };
|
|
34
|
+
export const createStyledVueComponents = (...args: any[]) => { _lazyVue(); return {}; };
|
|
35
|
+
export const useComputedStylesVue = (...args: any[]) => { _lazyVue(); return {}; };
|
|
36
|
+
export const provideStyleContext = (...args: any[]) => { _lazyVue(); };
|
|
37
|
+
export const injectStyleContext = (...args: any[]) => { _lazyVue(); return {}; };
|
|
39
38
|
|
|
40
39
|
// Svelte — loaded lazily
|
|
41
40
|
let _svelteExports: any = null;
|