Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(input): add item highlight for ionic theme #29395

Merged
merged 5 commits into from Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions core/src/components/input/input.ionic.outline.scss
Expand Up @@ -139,3 +139,10 @@

background: var(--background);
}

// Input Focus
// ----------------------------------------------------------------

:host(.input-fill-outline.has-focus) {
--border-width: #{tokens.$ionic-border-size-medium};
}
23 changes: 22 additions & 1 deletion core/src/components/input/input.ionic.scss
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion core/src/components/input/input.tsx
Expand Up @@ -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;
Expand Down