-
-
Notifications
You must be signed in to change notification settings - Fork 339
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
Conversation
|
||
/** | ||
* theme name, like '@qzdata/element-theme-qzdata' | ||
*/ |
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.
Add @default element-ui/packages/theme-chalk
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
* theme name, like '@qzdata/element-theme-qzdata' | |
* theme name |
} | ||
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
const { importStyle = 'css', themeName } = options | |
const { importStyle = 'css', themeName = 'element-ui/packages/theme-chalk' } = options |
if (themeName) { | ||
return [ | ||
`${themeName}/src/base.scss`, | ||
`${themeName}/src/${partialName}.scss`, | ||
] | ||
} | ||
|
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.
We can remove if (themeName) {
check if there's a default value.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
Co-authored-by: 内小子 <nbn1209@126.com>
Close due to inactive - feel free to bring it back if anyone interested in continue it |
Description
Linked Issues
Additional context