Skip to content

Commit

Permalink
chore(text): do not set any class name if color should be inherited
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed Apr 15, 2023
1 parent 8706963 commit 6e49cb7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const fontColor = computed(() => {
} else if (props.highlight) {
return getThemeProperty('text.color.highlight').value
} else if (props.inheritColor) {
return getThemeProperty('text.color.inherit').value
return ''
} else {
return getThemeProperty('text.color.default').value
}
Expand Down
1 change: 0 additions & 1 deletion src/theme-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const TEXT_SIZE_LARGE = 'text.size.large'
export const TEXT_COLOR_DEFAULT = 'text.color.default'
export const TEXT_COLOR_LIGHT = 'text.color.light'
export const TEXT_COLOR_HIGHLIGHT = 'text.color.highlight'
export const TEXT_COLOR_INHERIT = 'text.color.inherit'
export const TEXT_WEIGHT_DEFAULT = 'text.weight.default'
export const TEXT_WEIGHT_HIGHLIGHT = 'text.weight.highlight'
export const FORM_ELEMENT_INPUT_TEXT_SIZE_DEFAULT = 'formElementInput.textSize.default'
Expand Down
3 changes: 1 addition & 2 deletions src/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ const theme = {
color: {
'default': ref('text-gray-900'),
'light': ref('text-gray-100'),
'highlight': ref('text-gray-900'),
'inherit': ref('text-inherit'),
'highlight': ref('text-gray-900')
},
weight: {
'default': ref('font-base'),
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/text.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,6 @@ describe('Text.vue', () => {
inheritColor: true
}
})
expect(wrapper.classes()).to.include('text-inherit')
expect(wrapper.classes()).to.not.include('text-')
})
})

0 comments on commit 6e49cb7

Please sign in to comment.