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
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021-PRESENT Anthony Fu <https://github.com/antfu>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+40
View File
@@ -0,0 +1,40 @@
# @unocss/transformer-variant-group
<!-- @unocss-ignore -->
Enables the [variant group feature of Windi CSS](https://windicss.org/features/variant-groups.html) for UnoCSS.
## Install
```bash
npm i -D @unocss/transformer-variant-group
```
```ts
import transformerVariantGroup from '@unocss/transformer-variant-group'
// uno.config.ts
import { defineConfig } from 'unocss'
export default defineConfig({
// ...
transformers: [
transformerVariantGroup(),
],
})
```
## Usage
```html
<div class="hover:(bg-gray-400 font-medium) font-(light mono)"/>
```
Will be transformed to:
```html
<div class="hover:bg-gray-400 hover:font-medium font-light font-mono"/>
```
## License
MIT License &copy; 2021-PRESENT [Anthony Fu](https://github.com/antfu)
@@ -0,0 +1,22 @@
import { SourceCodeTransformer } from '@unocss/core';
interface TransformerVariantGroupOptions {
/**
* Separators to expand.
*
* ```
* foo-(bar baz) -> foo-bar foo-baz
* ^
* separator
* ```
*
* You may set it to `[':']` for strictness.
*
* @default [':', '-']
* @see https://github.com/unocss/unocss/pull/1231
*/
separators?: (':' | '-')[];
}
declare function transformerVariantGroup(options?: TransformerVariantGroupOptions): SourceCodeTransformer;
export { type TransformerVariantGroupOptions, transformerVariantGroup as default };
@@ -0,0 +1,22 @@
import { SourceCodeTransformer } from '@unocss/core';
interface TransformerVariantGroupOptions {
/**
* Separators to expand.
*
* ```
* foo-(bar baz) -> foo-bar foo-baz
* ^
* separator
* ```
*
* You may set it to `[':']` for strictness.
*
* @default [':', '-']
* @see https://github.com/unocss/unocss/pull/1231
*/
separators?: (':' | '-')[];
}
declare function transformerVariantGroup(options?: TransformerVariantGroupOptions): SourceCodeTransformer;
export { type TransformerVariantGroupOptions, transformerVariantGroup as default };
@@ -0,0 +1,18 @@
import { parseVariantGroup } from '@unocss/core';
function transformerVariantGroup(options = {}) {
return {
name: "@unocss/transformer-variant-group",
enforce: "pre",
transform(s) {
const result = parseVariantGroup(s, options.separators);
return {
get highlightAnnotations() {
return [...result.groupsByOffset.values()].flatMap((group) => group.items);
}
};
}
};
}
export { transformerVariantGroup as default };
@@ -0,0 +1,46 @@
{
"name": "@unocss/transformer-variant-group",
"type": "module",
"version": "0.65.4",
"description": "Variant group transformer for UnoCSS",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
"funding": "https://github.com/sponsors/antfu",
"homepage": "https://github.com/unocss/unocss/tree/main/packages/transformer-variant-group#readme",
"repository": {
"type": "git",
"url": "https://github.com/unocss/unocss",
"directory": "packages/transformer-variant-group"
},
"bugs": {
"url": "https://github.com/unocss/unocss/issues"
},
"keywords": [
"unocss",
"unocss-transformer"
],
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
}
},
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"@unocss/core": "0.65.4"
},
"devDependencies": {
"magic-string": "^0.30.17"
},
"scripts": {
"build": "unbuild",
"stub": "unbuild --stub",
"test:attw": "attw --pack --config-path ../../.attw-esm-only.json"
}
}