diff --git a/core/src/components/input/input.ionic.outline.scss b/core/src/components/input/input.ionic.outline.scss index 4528a6d1ad..4ac6229791 100644 --- a/core/src/components/input/input.ionic.outline.scss +++ b/core/src/components/input/input.ionic.outline.scss @@ -139,3 +139,10 @@ background: var(--background); } + +// Input Focus +// ---------------------------------------------------------------- + +:host(.input-fill-outline.has-focus) { + --border-width: #{tokens.$ionic-border-size-medium}; +} diff --git a/core/src/components/input/input.ionic.scss b/core/src/components/input/input.ionic.scss index c5b50ad094..52f5c6a0b4 100644 --- a/core/src/components/input/input.ionic.scss +++ b/core/src/components/input/input.ionic.scss @@ -145,10 +145,31 @@ opacity: 0.6; } +// Input Highlight +// ---------------------------------------------------------------- + +.input-highlight { + @include position(null, null, -1px, 0); + + position: absolute; + + width: 100%; + height: tokens.$ionic-border-size-medium; + + transform: scale(0); + + transition: transform 200ms; + + background: var(--border-color); +} + // Input Focus // ---------------------------------------------------------------- :host(.has-focus) { --border-color: #{tokens.$ionic-color-primary}; - --border-width: #{tokens.$ionic-border-size-medium}; +} + +:host(.has-focus) .input-highlight { + transform: scale(1); } diff --git a/core/src/components/input/input.tsx b/core/src/components/input/input.tsx index b637e03a89..9e90cfc517 100644 --- a/core/src/components/input/input.tsx +++ b/core/src/components/input/input.tsx @@ -736,7 +736,7 @@ export class Input implements ComponentInterface { const value = this.getValue(); const size = this.getSize(); const inItem = hostContext('ion-item', this.el); - const shouldRenderHighlight = theme === 'md' && fill !== 'outline' && !inItem; + const shouldRenderHighlight = (theme === 'md' || theme === 'ionic') && fill !== 'outline' && !inItem; const labelPlacement = this.getLabelPlacement(); const defaultClearIcon = theme === 'ios' ? closeCircle : closeSharp;