From 6e49cb7be6ed2b3dfe447fb5a52832aabbefdaf2 Mon Sep 17 00:00:00 2001 From: Stefan Pfaffel Date: Sat, 15 Apr 2023 22:03:19 +0200 Subject: [PATCH] chore(text): do not set any class name if color should be inherited --- src/components/text.vue | 2 +- src/theme-keys.js | 1 - src/theme.js | 3 +-- tests/unit/text.spec.js | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/text.vue b/src/components/text.vue index ed527b9..9070854 100644 --- a/src/components/text.vue +++ b/src/components/text.vue @@ -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 } diff --git a/src/theme-keys.js b/src/theme-keys.js index cd540a8..22bfaf7 100644 --- a/src/theme-keys.js +++ b/src/theme-keys.js @@ -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' diff --git a/src/theme.js b/src/theme.js index 295b831..c5b6f4e 100644 --- a/src/theme.js +++ b/src/theme.js @@ -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'), diff --git a/tests/unit/text.spec.js b/tests/unit/text.spec.js index 0aa1500..060a6ed 100644 --- a/tests/unit/text.spec.js +++ b/tests/unit/text.spec.js @@ -99,6 +99,6 @@ describe('Text.vue', () => { inheritColor: true } }) - expect(wrapper.classes()).to.include('text-inherit') + expect(wrapper.classes()).to.not.include('text-') }) })