From 5638372a8ca221e22c288fc0f117bc171f965d25 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 18 Oct 2024 18:15:58 +0800 Subject: [PATCH] chore: update --- README.md | 39 +++++++++++++++++++++++---------------- READMETEMPLATE.md | 21 +++++++++++++-------- 2 files changed, 36 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index cbd51d0..2db6272 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,19 @@ pnpm i -D unocss-preset-useful unocss ```ts // unocss.config.ts -import { defineConfig } from 'unocss' -import { presetUseful } from 'unocss-preset-useful' +import { defineUsefulConfig } from 'unocss-preset-useful' -export default defineConfig({ - presets: [ - presetUseful(), - ], -}) +export default defineUsefulConfig() + +// Custom options +export default defineUsefulConfig( + { + // Useful options + }, + { + // Uno options + } +) ```
@@ -171,8 +176,9 @@ export interface UsefulOptions {
Expand it see more details
-### autocomplete +### autocomplete + ```ts export const autocomplete: UserConfig['autocomplete'] = { shorthands: { @@ -185,7 +191,7 @@ export const autocomplete: UserConfig['autocomplete'] = { ``` ### extractors - + ```ts // https://github.com/unocss/unocss/pull/2485 // Support extract base64 image. @@ -201,7 +207,7 @@ export const extractors: Extractor[] = [ ``` ### postprocess - + ```ts // https://github.com/unocss/unocss/discussions/2816 // Extract rgba color in css variable. @@ -231,7 +237,7 @@ export function importantProcess(): Postprocessor { ``` ### rules - + ```ts // Use any css variable easily. export const rules: Rule[] = [ @@ -250,7 +256,7 @@ export const rules: Rule[] = [ ``` ### shortcuts - + ```ts // FYI. My own shortcuts. const _shortcuts: CustomStaticShortcuts = [ @@ -279,8 +285,8 @@ const _shortcuts: CustomStaticShortcuts = [ ['fbc', 'flex justify-between items-center'], ['fa', 'flex justify-around'], ['fac', 'flex justify-around items-center'], - ['fw', 'flex justify-wrap'], - ['fwr', 'flex justify-wrap-reverse'], + ['fw', 'flex flex-wrap'], + ['fwr', 'flex flex-wrap-reverse'], // transition ['trans', 'transition-all-350 ease-linear'], @@ -288,7 +294,7 @@ const _shortcuts: CustomStaticShortcuts = [ ``` ### index - + ```ts // See index.test.ts `themeAnimate configuration` for usage. export function nomarlizeTheme(theme: UsefulTheme, enableMagicAnimations: boolean): UsefulTheme { @@ -303,7 +309,7 @@ export function nomarlizeTheme(theme: UsefulTheme, enableMagicAnimations: boolea ``` ### magic-animate - + ```ts export function magicAnimate(): Theme['animation'] { const keyframesObj = getKeyframes(magicCSS) @@ -325,6 +331,7 @@ export function magicAnimate(): Theme['animation'] { } ``` +
## License diff --git a/READMETEMPLATE.md b/READMETEMPLATE.md index 1fa12fe..482c1c9 100644 --- a/READMETEMPLATE.md +++ b/READMETEMPLATE.md @@ -19,14 +19,19 @@ pnpm i -D unocss-preset-useful unocss ```ts // unocss.config.ts -import { defineConfig } from 'unocss' -import { presetUseful } from 'unocss-preset-useful' - -export default defineConfig({ - presets: [ - presetUseful(), - ], -}) +import { defineUsefulConfig } from 'unocss-preset-useful' + +export default defineUsefulConfig() + +// Custom options +export default defineUsefulConfig( + { + // Useful options + }, + { + // Uno options + } +) ```