Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

neterm
Copy link

@neterm neterm commented Jul 21, 2023

Description

Linked Issues

Additional context

@neterm neterm requested a review from sxzz as a code owner July 21, 2023 04:16

/**
* theme name, like '@qzdata/element-theme-qzdata'
*/
Copy link
Member

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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const { importStyle = 'css', themeName } = options
const { importStyle = 'css', themeName = 'element-ui/packages/theme-chalk' } = options

Comment on lines +36 to +42
if (themeName) {
return [
`${themeName}/src/base.scss`,
`${themeName}/src/${partialName}.scss`,
]
}

Copy link
Member

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@antfu
Copy link
Member

antfu commented May 1, 2024

Close due to inactive - feel free to bring it back if anyone interested in continue it

@antfu antfu closed this May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants