Skip to content

Commit 0d67c83

Browse files
feat(input-password-toggle): add ionic theme design (#29787)
Issue number: ROU-4860 --------- ## What is the current behavior? Input Password Toggle does not have styles for the ionic theme. ## What is the new behavior? - Added color style - Set margins ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information | Figma Design | Implemented Input Password Toggle | | --- | --- | | ![Figma Design](https://github.com/user-attachments/assets/285c4766-267b-4c73-b0fc-801b130c6fb2) | ![Implemented InputPasswordToggle](https://github.com/user-attachments/assets/a768cbfe-3bf4-4d49-89ce-0b142d29d3b0) | - [Basic Preview](https://ionic-framework-git-rou-4860-ionic1.vercel.app/src/components/input-password-toggle/test/basic?ionic:theme=ionic) --------- Co-authored-by: Brandy Carney <[email protected]>
1 parent e539620 commit 0d67c83

12 files changed

+28
-4
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@import "../../themes/native/native.globals";
2+
3+
// Input Toggle Password
4+
// --------------------------------------------------
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@use "../../themes/ionic/ionic.globals.scss" as globals;
2+
@use "./input-password-toggle.common.scss";
3+
4+
// Ionic Input Toggle Password
5+
// --------------------------------------------------
6+
:host ion-button.button-has-icon-only {
7+
--padding-end: inherit;
8+
--color: #{globals.$ionic-color-neutral-500};
9+
--margin-end: calc(-1 * var(--padding-end));
10+
11+
@include globals.margin(0, var(--margin-end), 0, 0);
12+
}

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

Whitespace-only changes.

core/src/components/input-password-toggle/input-password-toggle.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ import type { Color, TextFieldTypes } from '../../interface';
2121
* and we will default to MD mode.
2222
*/
2323
styleUrls: {
24-
ios: 'input-password-toggle.scss',
25-
md: 'input-password-toggle.scss',
24+
ios: 'input-password-toggle.common.scss',
25+
md: 'input-password-toggle.common.scss',
26+
ionic: 'input-password-toggle.ionic.scss',
2627
},
2728
shadow: true,
2829
})

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,14 @@
4848
<div class="grid">
4949
<div class="grid-item">
5050
<h2>Default</h2>
51-
<ion-input type="password" value="supersecurepassword" label="Password">
51+
<ion-input
52+
fill="outline"
53+
shape="soft"
54+
placeholder="Enter your password"
55+
type="password"
56+
value="supersecurepassword"
57+
label="Password"
58+
>
5259
<ion-input-password-toggle slot="end"></ion-input-password-toggle>
5360
</ion-input>
5461
</div>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect } from '@playwright/test';
22
import { configs, test } from '@utils/test/playwright';
33

4-
configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
4+
configs({ modes: ['md', 'ios', 'ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
55
test.describe(title('input password toggle: states'), () => {
66
test('should be hidden when inside of a readonly input', async ({ page }) => {
77
await page.setContent(
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)