Skip to content

Commit 4d12348

Browse files
authored
chore(idux): add resolver importStyleTheme option (#402)
1 parent a184a0a commit 4d12348

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/core/resolvers/idux.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ export interface IduxResolverOptions {
2727
* import style along with components
2828
*/
2929
importStyle?: 'css' | 'less'
30+
/**
31+
* theme for import style
32+
*
33+
* @default 'default'
34+
*/
35+
importStyleTheme?: string
3036
}
3137

3238
/**
@@ -38,7 +44,7 @@ export function IduxResolver(options: IduxResolverOptions = {}): ComponentResolv
3844
return {
3945
type: 'component',
4046
resolve: (name: string) => {
41-
const { importStyle, exclude = [] } = options
47+
const { importStyle, importStyleTheme = 'default', exclude = [] } = options
4248
if (exclude.includes(name))
4349
return
4450

@@ -56,7 +62,7 @@ export function IduxResolver(options: IduxResolverOptions = {}): ComponentResolv
5662

5763
let sideEffects: string | undefined
5864
if (packageName !== 'cdk' && importStyle)
59-
sideEffects = `${path}/style/themes/${importStyle === 'css' ? 'default_css' : 'default'}`
65+
sideEffects = `${path}/style/themes/${importStyle === 'css' ? `${importStyleTheme}_css` : importStyleTheme}`
6066

6167
return { name, from: path, sideEffects }
6268
},

0 commit comments

Comments
 (0)