Skip to content

Commit

Permalink
feat(input-text): add caret color theme property
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed Apr 15, 2023
1 parent 97f892c commit 3ccaf39
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/form-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<script setup>
import { computed, ref } from 'vue';
import { FORM_ELEMENT_INPUT_BACKGROUND_COLOR_DEFAULT, FORM_ELEMENT_INPUT_PLACEHOLDER_COLOR_DEFAULT, FORM_ELEMENT_INPUT_TEXT_COLOR_DEFAULT, FORM_ELEMENT_INPUT_TEXT_SIZE_DEFAULT } from '../theme-keys.js';
import { FORM_ELEMENT_INPUT_BACKGROUND_COLOR_DEFAULT, FORM_ELEMENT_INPUT_CARET_COLOR_DEFAULT, FORM_ELEMENT_INPUT_PLACEHOLDER_COLOR_DEFAULT, FORM_ELEMENT_INPUT_TEXT_COLOR_DEFAULT, FORM_ELEMENT_INPUT_TEXT_SIZE_DEFAULT } from '../theme-keys.js';
import { getThemeProperty } from '../theme.js';
import FormElementContainerWithLabel from './form-element-container-with-label.vue';
Expand Down Expand Up @@ -108,6 +108,7 @@ const invalidCharactersRegex = computed(() => {
const inputClazz = computed(() => {
const clazz = [
'w-full mt-4 outline-none px-3 leading-8',
getThemeProperty(FORM_ELEMENT_INPUT_CARET_COLOR_DEFAULT).value,
getThemeProperty(FORM_ELEMENT_INPUT_BACKGROUND_COLOR_DEFAULT).value,
getThemeProperty(FORM_ELEMENT_INPUT_PLACEHOLDER_COLOR_DEFAULT).value,
getThemeProperty(FORM_ELEMENT_INPUT_TEXT_SIZE_DEFAULT).value,
Expand Down
1 change: 1 addition & 0 deletions src/theme-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ 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'
export const FORM_ELEMENT_INPUT_CARET_COLOR_DEFAULT = 'formElementInput.caretColor.default'
export const FORM_ELEMENT_INPUT_TEXT_COLOR_DEFAULT = 'formElementInput.textColor.default'
export const FORM_ELEMENT_INPUT_BACKGROUND_COLOR_DEFAULT = 'formElementInput.backgroundColor.default'
export const FORM_ELEMENT_INPUT_PLACEHOLDER_COLOR_DEFAULT = 'formElementInput.placeholderColor.default'
Expand Down
3 changes: 3 additions & 0 deletions src/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ const theme = {
textSize: {
default: ref('text-lg')
},
caretColor: {
default: ref('caret-gray-900')
},
textColor: {
default: ref('text-gray-900')
},
Expand Down

0 comments on commit 3ccaf39

Please sign in to comment.