Skip to content

Commit

Permalink
feat(postcss): allow customizing single directive name (#2293)
Browse files Browse the repository at this point in the history
  • Loading branch information
sibbng committed Mar 6, 2023
1 parent 7031b5b commit 28a94dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
13 changes: 7 additions & 6 deletions packages/postcss/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ function unocss(options: UnoPostcssPluginOptions = {}) {

const {
cwd = process.cwd(),
directiveMap = {
apply: 'apply',
theme: 'theme',
screen: 'screen',
unocss: 'unocss',
},
content,
configOrPath,
} = options

const directiveMap = Object.assign({
apply: 'apply',
theme: 'theme',
screen: 'screen',
unocss: 'unocss',
}, options.directiveMap || {})

const fileMap = new Map()
const fileClassMap = new Map()
const classes = new Set<string>()
Expand Down
8 changes: 4 additions & 4 deletions packages/postcss/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export interface UnoPostcssPluginOptions {
extension: string
})[]
directiveMap?: {
apply: string
screen: string
theme: string
unocss: string
apply?: string
screen?: string
theme?: string
unocss?: string
}
cwd?: string
configOrPath?: string | UserConfig
Expand Down

0 comments on commit 28a94dd

Please sign in to comment.