diff --git a/components/textfield/src/vwc-textfield.scss b/components/textfield/src/vwc-textfield.scss index 3d3d11f06..5a05e98af 100644 --- a/components/textfield/src/vwc-textfield.scss +++ b/components/textfield/src/vwc-textfield.scss @@ -3,6 +3,7 @@ @forward './vwc-textfield-input'; @forward './vwc-textfield-action'; @use './vwc-textfield-variables' as textfield-variables; +@use '@vonage/vvd-typography/scss/typography' as typography; @use '@vonage/vwc-icon/src/partials/vwc-icon-variables' as icon-variables; @use '@vonage/vvd-design-tokens/build/scss/semantic-variables/scheme-variables' as scheme-variables; @use '@vonage/vvd-style-coupling/scss/vvd-formfield' as vvd-formfield; @@ -87,8 +88,6 @@ } :host([dense][label]:not([label=''])) { - padding-top: 24px; - .mdc-text-field { .mdc-floating-label { top: -25px; @@ -105,6 +104,11 @@ color: var(--mdc-text-field-ink-color); } } + + @at-root :host([charcounter]), // also if charcounter is present. temporary fix + & { + padding-top: 24px; + } } .mdc-text-field { @@ -232,3 +236,11 @@ vwc-notched-outline { .mdc-floating-label { left: 40px; } + +.mdc-text-field-character-counter { + @include typography.typography-cat-shorthand('body-2'); + position: absolute; + top: -25px; + right: 0; + color: var(#{scheme-variables.$vvd-color-neutral-70}) !important; +} diff --git a/components/textfield/src/vwc-textfield.ts b/components/textfield/src/vwc-textfield.ts index 6bdb2535f..b716a2379 100644 --- a/components/textfield/src/vwc-textfield.ts +++ b/components/textfield/src/vwc-textfield.ts @@ -148,7 +148,7 @@ export class VWCTextField extends MWCTextField { override render(): TemplateResult { const shouldRenderCharCounter = this.charCounter && this.maxLength !== -1; const shouldRenderHelperText = - !!this.helper || !!this.validationMessage || shouldRenderCharCounter; + !!this.helper || !!this.validationMessage; /** @classMap */ const classes = { @@ -166,6 +166,7 @@ export class VWCTextField extends MWCTextField {