-
-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add 'themeName' option for ElementUiResolver #662
Changes from 1 commit
a66804d
5a09a2e
4db550c
7eaf882
cd3c7b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,24 +16,43 @@ export interface ElementUiResolverOptions { | |||||
* exclude component name, if match do not resolve the name | ||||||
*/ | ||||||
exclude?: RegExp | ||||||
|
||||||
/** | ||||||
* theme name, like '@qzdata/element-theme-qzdata' | ||||||
*/ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add |
||||||
themeName?: string | ||||||
} | ||||||
|
||||||
function getSideEffects( | ||||||
partialName: string, | ||||||
options: ElementUiResolverOptions, | ||||||
): SideEffectsInfo | undefined { | ||||||
const { importStyle = 'css' } = options | ||||||
const { importStyle = 'css', themeName } = options | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
if (!importStyle) | ||||||
return | ||||||
|
||||||
if (importStyle === 'sass') { | ||||||
if (themeName) { | ||||||
return [ | ||||||
`${themeName}/src/base.scss`, | ||||||
`${themeName}/src/${partialName}.scss`, | ||||||
] | ||||||
} | ||||||
|
||||||
Comment on lines
+36
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can remove |
||||||
return [ | ||||||
'element-ui/packages/theme-chalk/src/base.scss', | ||||||
`element-ui/packages/theme-chalk/src/${partialName}.scss`, | ||||||
] | ||||||
} | ||||||
else { | ||||||
if (themeName) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||||||
return [ | ||||||
`${themeName}/lib/base.css`, | ||||||
`${themeName}/lib/${partialName}.css`, | ||||||
] | ||||||
} | ||||||
|
||||||
return [ | ||||||
'element-ui/lib/theme-chalk/base.css', | ||||||
`element-ui/lib/theme-chalk/${partialName}.css`, | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.