Skip to content

Commit 7597cce

Browse files
feat(input): support dynamic type (#28184)
Issue number: N/A --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? `ion-input` does not support dynamic type. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> `ion-input` supports dynamic type. Most of the sizing was already inherited; only the helper text needed updating. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> --------- Co-authored-by: ionitron <[email protected]>
1 parent e3a6de3 commit 7597cce

8 files changed

+21
-2
lines changed

core/src/components/input/input.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@
346346

347347
border-top: var(--border-width) var(--border-style) var(--border-color);
348348

349-
font-size: 12px;
349+
font-size: dynamic-font(12px);
350350
}
351351

352352
/**

core/src/components/input/test/a11y/input.e2e.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import AxeBuilder from '@axe-core/playwright';
22
import { expect } from '@playwright/test';
33
import { configs, test } from '@utils/test/playwright';
44

5-
configs({ directions: ['ltr'] }).forEach(({ title, config }) => {
5+
configs({ directions: ['ltr'] }).forEach(({ title, config, screenshot }) => {
66
test.describe(title('input: a11y'), () => {
77
test('should not have accessibility violations', async ({ page }) => {
88
await page.goto(`/src/components/input/test/a11y`, config);
@@ -11,4 +11,23 @@ configs({ directions: ['ltr'] }).forEach(({ title, config }) => {
1111
expect(results.violations).toEqual([]);
1212
});
1313
});
14+
15+
test.describe(title('input: font scaling'), () => {
16+
test('should scale text on larger font sizes', async ({ page }) => {
17+
await page.setContent(
18+
`
19+
<style>
20+
html {
21+
font-size: 310%;
22+
}
23+
</style>
24+
<ion-input label="Email" helper-text="Enter your email"></ion-input>
25+
`,
26+
config
27+
);
28+
29+
const input = page.locator('ion-input');
30+
await expect(input).toHaveScreenshot(screenshot('input-scale'));
31+
});
32+
});
1433
});

0 commit comments

Comments
 (0)