Skip to content

Commit

Permalink
feat(core): add reset prefilghts
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyv committed Mar 4, 2024
1 parent f128f70 commit a0a2936
Show file tree
Hide file tree
Showing 9 changed files with 462 additions and 5 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,19 @@ export interface UsefulOptions {
<details>
<summary>Expand it see more details</summary><br>

### autocomplete

```ts
export const autocomplete: UserConfig['autocomplete'] = {
shorthands: {
magic: `(${Object.keys(keyframes).join('|')})`,
},
templates: [
'animate-<magic>',
],
}
```

### extractors

```ts
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export * from './shortcuts'
export * from './theme'
export * from './variants'
export * from './autocomplete'
export * from './preflights'
9 changes: 9 additions & 0 deletions packages/core/src/core/preflights/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { Preflight } from 'unocss'
import type { ResolvedOptions } from '../../types'
import { resetPreflight } from './reset'

export function preflights(options: ResolvedOptions): Preflight[] {
return [
options.enableResetStyles ? resetPreflight : undefined,
].filter(Boolean) as Preflight[]
}
Loading

0 comments on commit a0a2936

Please sign in to comment.