feature: vor und nachteile

This commit is contained in:
Hikyu
2026-05-31 13:54:31 +02:00
parent 552a947a1c
commit e3dad17446
23270 changed files with 3024794 additions and 200 deletions
+2
View File
@@ -0,0 +1,2 @@
export { }
+2
View File
@@ -0,0 +1,2 @@
export { }
+52
View File
@@ -0,0 +1,52 @@
function post(data, config) {
return fetch("__POST_PATH__", {
...config,
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(data)
});
}
function include(set, v) {
for (const i of v)
set.add(i);
}
console.log(
"%c[unocss] devtools support enabled %c\nread more at https://windicss.org",
"background:#0ea5e9; color:white; padding: 1px 4px; border-radius: 3px;",
""
);
const visitedClasses = /* @__PURE__ */ new Set();
const pendingClasses = /* @__PURE__ */ new Set();
let _timer;
function schedule() {
if (_timer != null)
clearTimeout(_timer);
_timer = setTimeout(() => {
if (pendingClasses.size) {
post(
{ type: "add-classes", data: Array.from(pendingClasses) },
{ mode: "__POST_FETCH_MODE__" }
);
include(visitedClasses, pendingClasses);
pendingClasses.clear();
}
}, 10);
}
const mutationObserver = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (mutation.attributeName === "class" && mutation.target) {
Array.from(mutation.target.classList || []).forEach((i) => {
if (!visitedClasses.has(i))
pendingClasses.add(i);
});
schedule();
}
});
});
mutationObserver.observe(document.documentElement || document.body, {
childList: true,
subtree: true,
attributes: true
});
+84
View File
@@ -0,0 +1,84 @@
import { UserConfig, UnocssPluginContext, UserConfigDefaults } from '@unocss/core';
import * as vite from 'vite';
import { Plugin } from 'vite';
interface VitePluginConfig<Theme extends object = object> extends UserConfig<Theme> {
/**
* Enable UnoCSS inspector
*
* @default true
*/
inspector?: boolean;
/**
* CSS Generation mode
*
* - `global` - generate a single CSS sheet for entire App
* - `dist-chunk` - generate a CSS sheet for each code chunk on build, great for MPA
* - `per-module` - generate a CSS sheet for each module, can be scoped
* - `vue-scoped` - inject generated CSS to Vue SFC's `<style scoped>` for isolation
* - `shadow-dom` - inject generated CSS to `Shadow DOM` css style block for each web component
*
* @default 'global'
*/
mode?: 'global' | 'per-module' | 'vue-scoped' | 'dist-chunk' | 'shadow-dom';
/**
* Transform CSS for `@apply` directive
*
* @experimental
* @default false
*/
transformCSS?: boolean | 'pre' | 'post';
/**
* Make the generated css processed by postcss (https://vitejs.dev/guide/features.html#postcss)
*
* @default true
*/
postcss?: boolean;
/**
* Use top level await in HMR code to avoid FOUC on dev time.
*
* You usually don't need to disable this, unless you are developing on
* a browser that does not support top level await.
*
* This will only affect on dev time.
*
* @default true
*/
hmrTopLevelAwait?: boolean;
/**
* Fetch mode in devtools.
*
* Some server does not configure its CORS and you may want to set this to 'no-cors'.
* See https://github.com/unocss/unocss/issues/2822.
*
* @default 'cors'
*/
fetchMode?: 'cors' | 'navigate' | 'no-cors' | 'same-origin';
/**
* Disable `import 'uno.css'` existing check.
*
* @default true
*/
checkImport?: boolean;
}
declare function ChunkModeBuildPlugin(ctx: UnocssPluginContext): Plugin;
declare function GlobalModeBuildPlugin(ctx: UnocssPluginContext<VitePluginConfig>): Plugin[];
declare function GlobalModeDevPlugin(ctx: UnocssPluginContext): Plugin[];
declare function GlobalModePlugin(ctx: UnocssPluginContext): vite.Plugin<any>[];
declare function PerModuleModePlugin(ctx: UnocssPluginContext): Plugin[];
declare function VueScopedPlugin(ctx: UnocssPluginContext): Plugin;
declare function defineConfig<Theme extends object>(config: VitePluginConfig<Theme>): VitePluginConfig<Theme>;
interface UnocssVitePluginAPI {
getContext: () => UnocssPluginContext<VitePluginConfig>;
getMode: () => VitePluginConfig['mode'];
}
declare function UnocssPlugin<Theme extends object>(configOrPath?: VitePluginConfig<Theme> | string, defaults?: UserConfigDefaults): Plugin[];
export { ChunkModeBuildPlugin, GlobalModeBuildPlugin, GlobalModeDevPlugin, GlobalModePlugin, PerModuleModePlugin, type UnocssVitePluginAPI, type VitePluginConfig, VueScopedPlugin, UnocssPlugin as default, defineConfig };
+84
View File
@@ -0,0 +1,84 @@
import { UserConfig, UnocssPluginContext, UserConfigDefaults } from '@unocss/core';
import * as vite from 'vite';
import { Plugin } from 'vite';
interface VitePluginConfig<Theme extends object = object> extends UserConfig<Theme> {
/**
* Enable UnoCSS inspector
*
* @default true
*/
inspector?: boolean;
/**
* CSS Generation mode
*
* - `global` - generate a single CSS sheet for entire App
* - `dist-chunk` - generate a CSS sheet for each code chunk on build, great for MPA
* - `per-module` - generate a CSS sheet for each module, can be scoped
* - `vue-scoped` - inject generated CSS to Vue SFC's `<style scoped>` for isolation
* - `shadow-dom` - inject generated CSS to `Shadow DOM` css style block for each web component
*
* @default 'global'
*/
mode?: 'global' | 'per-module' | 'vue-scoped' | 'dist-chunk' | 'shadow-dom';
/**
* Transform CSS for `@apply` directive
*
* @experimental
* @default false
*/
transformCSS?: boolean | 'pre' | 'post';
/**
* Make the generated css processed by postcss (https://vitejs.dev/guide/features.html#postcss)
*
* @default true
*/
postcss?: boolean;
/**
* Use top level await in HMR code to avoid FOUC on dev time.
*
* You usually don't need to disable this, unless you are developing on
* a browser that does not support top level await.
*
* This will only affect on dev time.
*
* @default true
*/
hmrTopLevelAwait?: boolean;
/**
* Fetch mode in devtools.
*
* Some server does not configure its CORS and you may want to set this to 'no-cors'.
* See https://github.com/unocss/unocss/issues/2822.
*
* @default 'cors'
*/
fetchMode?: 'cors' | 'navigate' | 'no-cors' | 'same-origin';
/**
* Disable `import 'uno.css'` existing check.
*
* @default true
*/
checkImport?: boolean;
}
declare function ChunkModeBuildPlugin(ctx: UnocssPluginContext): Plugin;
declare function GlobalModeBuildPlugin(ctx: UnocssPluginContext<VitePluginConfig>): Plugin[];
declare function GlobalModeDevPlugin(ctx: UnocssPluginContext): Plugin[];
declare function GlobalModePlugin(ctx: UnocssPluginContext): vite.Plugin<any>[];
declare function PerModuleModePlugin(ctx: UnocssPluginContext): Plugin[];
declare function VueScopedPlugin(ctx: UnocssPluginContext): Plugin;
declare function defineConfig<Theme extends object>(config: VitePluginConfig<Theme>): VitePluginConfig<Theme>;
interface UnocssVitePluginAPI {
getContext: () => UnocssPluginContext<VitePluginConfig>;
getMode: () => VitePluginConfig['mode'];
}
declare function UnocssPlugin<Theme extends object>(configOrPath?: VitePluginConfig<Theme> | string, defaults?: UserConfigDefaults): Plugin[];
export { ChunkModeBuildPlugin, GlobalModeBuildPlugin, GlobalModeDevPlugin, GlobalModePlugin, PerModuleModePlugin, type UnocssVitePluginAPI, type VitePluginConfig, VueScopedPlugin, UnocssPlugin as default, defineConfig };
File diff suppressed because it is too large Load Diff