Skip to content

Commit 3656c8d

Browse files
feat(input-password-toggle): fixed color and icon sizes. (#29808)
Issue number: resolves ROU-4860 --------- ## What is the current behavior? Icon color and sizes are not ok. ## What is the new behavior? - Fixed Icon color into `neutral-800` - Set the icon size with `16px` ## Does this introduce a breaking change? - [ ] Yes - [X] No ## Other information This will complete the [PR](#29787) [Basic Preview](https://ionic-framework-p6zymvqpo-ionic1.vercel.app/src/components/input-password-toggle/test/basic?ionic:theme=ionic) --------- Co-authored-by: Brandy Carney <[email protected]>
1 parent aded437 commit 3656c8d

18 files changed

+96
-37
lines changed

core/src/components/input-password-toggle/input-password-toggle.ionic.scss

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@
33

44
// Ionic Input Toggle Password
55
// --------------------------------------------------
6-
:host ion-button.button-has-icon-only {
7-
--padding-end: inherit;
8-
--color: #{globals.$ionic-color-neutral-500};
6+
:host ion-button {
7+
--color: #{globals.$ionic-color-neutral-800};
98
--margin-end: calc(-1 * var(--padding-end));
9+
--padding-end: inherit;
10+
--icon-size: #{globals.dynamic-font(16px)};
1011

1112
@include globals.margin(0, var(--margin-end), 0, 0);
13+
14+
width: var(--size);
15+
height: var(--size);
16+
17+
ion-icon {
18+
font-size: var(--icon-size);
19+
}
1220
}

core/src/components/input-password-toggle/test/basic/index.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
grid-row-gap: 20px;
2020
grid-column-gap: 20px;
2121
}
22+
.margin-top {
23+
margin-top: 20px;
24+
}
2225
h2 {
2326
font-size: 12px;
2427
font-weight: normal;
@@ -47,18 +50,34 @@
4750
<ion-content id="content" class="ion-padding">
4851
<div class="grid">
4952
<div class="grid-item">
50-
<h2>Default</h2>
53+
<h2>Default - Size Medium</h2>
54+
<ion-input
55+
fill="outline"
56+
shape="soft"
57+
placeholder="Enter your password"
58+
type="password"
59+
value="supersecurepassword"
60+
label="Password"
61+
>
62+
<ion-input-password-toggle slot="end"></ion-input-password-toggle>
63+
</ion-input>
64+
</div>
65+
<div class="grid-item">
66+
<h2>Default - Size Large</h2>
5167
<ion-input
5268
fill="outline"
5369
shape="soft"
5470
placeholder="Enter your password"
5571
type="password"
5672
value="supersecurepassword"
5773
label="Password"
74+
size="large"
5875
>
5976
<ion-input-password-toggle slot="end"></ion-input-password-toggle>
6077
</ion-input>
6178
</div>
79+
</div>
80+
<div class="grid margin-top">
6281
<div class="grid-item">
6382
<h2>Custom Icon</h2>
6483
<ion-input type="password" value="supersecurepassword" label="Password">

core/src/components/input-password-toggle/test/basic/input-password-toggle.e2e.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,21 @@ configs({ modes: ['md', 'ios', 'ionic-md'], directions: ['ltr'] }).forEach(({ ti
4747
await expect(inputPasswordToggle).toHaveScreenshot(screenshot('input-password-toggle'));
4848
});
4949
});
50+
51+
test.describe(title('input password toggle - large size: rendering'), () => {
52+
test('should not have visual regressions', async ({ page }) => {
53+
await page.setContent(
54+
`
55+
<ion-input label="input" type="password" size="large">
56+
<ion-input-password-toggle slot="end"></ion-input-password-toggle>
57+
</ion-input>
58+
`,
59+
config
60+
);
61+
62+
const inputPasswordToggle = page.locator('ion-input-password-toggle');
63+
64+
await expect(inputPasswordToggle).toHaveScreenshot(screenshot('input-password-toggle-large-size'));
65+
});
66+
});
5067
});
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)