diff --git a/core/src/components/cat-textarea/cat-textarea.tsx b/core/src/components/cat-textarea/cat-textarea.tsx index 063aff410..d386a4599 100644 --- a/core/src/components/cat-textarea/cat-textarea.tsx +++ b/core/src/components/cat-textarea/cat-textarea.tsx @@ -282,19 +282,15 @@ export class CatTextarea { ({i18n.t('input.required')}) )} - {(this.maxLength || this.hasSlottedCounter) && ( - - )} )} + {(this.maxLength || this.hasSlottedCounter) && ( +
+ {this.hasSlottedCounter ? : `${this.value?.length ?? 0}/${this.maxLength}`} +
+ )}
Slotted Counter Show any text here +

Counter w/o label

+
diff --git a/core/src/styles/_snippets/_form-label.scss b/core/src/styles/_snippets/_form-label.scss index a46743c76..7da944789 100644 --- a/core/src/styles/_snippets/_form-label.scss +++ b/core/src/styles/_snippets/_form-label.scss @@ -20,7 +20,8 @@ $cat-input-height: 2.5rem; flex-basis: var(--label-size, 33.33%); } -.label-wrapper { +.label-wrapper, +.label-container { display: flex; gap: 0.25rem; } @@ -35,15 +36,17 @@ $cat-input-height: 2.5rem; } .label-optional, -.label-character-count { +.character-count { display: inline-flex; align-items: center; max-height: 1.25rem; @include cat-body('xs', null); } -.label-character-count { +.character-count { margin-left: auto; + flex-shrink: 0; + color: cat-token('color.ui.font.muted'); } .input-horizontal, @@ -70,7 +73,7 @@ $cat-input-height: 2.5rem; .label-metadata { justify-content: flex-start; - .label-character-count { + .character-count { margin-left: 0; } }