Skip to content

Commit

Permalink
docs(editor): fix get parent themes
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Jan 23, 2022
1 parent e793449 commit 13dfd26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function getThemeParents (theme) {
do {
// Support theme extend
if (themeConfig.config.$extend) {
themeConfig = state.themeMap[themeConfig.config.$extend] || {}
themeConfig = state.themeMap[themeConfig.config.$extend]
} else {
themeConfig = null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function generateArrowInnerCSS (theme, key) {
function generateCSSForComponent (theme, key, classKey, handler) {
const styles = theme.styles[key]
if (!styles) return []
const inherited = getInheritedStyleOptions(theme.name)[key]
const inherited = getInheritedStyleOptions(theme)[key]
const merged = assign(assign({}, inherited), styles)

const isDark = key === 'dark'
Expand Down Expand Up @@ -142,8 +142,8 @@ function generateColorCSS ({ color, opacity }) {
}
}

function getInheritedStyleOptions (themeName) {
let themeConfig = state.themeMap[themeName] || {}
function getInheritedStyleOptions (theme) {
let themeConfig = theme
const value = {}
for (const key of keys) {
value[key] = assign({}, baseStyles)
Expand All @@ -160,7 +160,7 @@ function getInheritedStyleOptions (themeName) {
parentStyles.push(obj)
break
}
themeConfig = state.themeMap[themeConfig.config.$extend] || {}
themeConfig = state.themeMap[themeConfig.config.$extend]
} else {
themeConfig = null
}
Expand Down

0 comments on commit 13dfd26

Please sign in to comment.