-
Notifications
You must be signed in to change notification settings - Fork 13.3k
feat(searchbar): support dynamic type #28043
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
Changes from all commits
c8e7f6c
7c9427a
82bcde0
e289773
51e8263
3e6a810
f9f8393
fceab46
d3a402c
0bc482d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -31,7 +31,7 @@ $searchbar-md-cancel-button-font-size: 1.6em !default; | |||||
| $searchbar-md-input-search-icon-color: $text-color-step-400 !default; | ||||||
|
|
||||||
| /// @prop - Size of the searchbar input search icon | ||||||
| $searchbar-md-input-search-icon-size: 20px !default; | ||||||
| $searchbar-md-input-search-icon-size: dynamic-font(21px) !default; | ||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an intentional change from 20px to 21px. The actual width/height of the icon was 21px due to the following code: ionic-framework/core/src/components/searchbar/searchbar.md.scss Lines 28 to 29 in 01fc9b4
I discussed with Brandy, and these variables were originally used for other things like background size which is why the 1px was not incorporated as part of the sass variable. However, the variable is only used for width/height so I made it part of the variable directly. |
||||||
|
|
||||||
| /// @prop - Height of the searchbar input | ||||||
| $searchbar-md-input-height: auto !default; | ||||||
|
|
@@ -58,4 +58,4 @@ $searchbar-md-input-border-radius: 2px !default; | |||||
| $searchbar-md-input-clear-icon-color: $text-color-step-400 !default; | ||||||
|
|
||||||
| /// @prop - Size of the searchbar input clear icon | ||||||
| $searchbar-md-input-clear-icon-size: 22px !default; | ||||||
| $searchbar-md-input-clear-icon-size: dynamic-font(22px) !default; | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,6 +74,7 @@ | |
| display: block; | ||
|
|
||
| width: 100%; | ||
| min-height: inherit; | ||
|
|
||
| border: 0; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { expect } from '@playwright/test'; | ||
| import { configs, test } from '@utils/test/playwright'; | ||
|
|
||
| configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { | ||
| test.describe(title('searchbar: font scaling'), () => { | ||
| test('should scale text on larger font sizes', async ({ page }) => { | ||
| await page.setContent( | ||
| ` | ||
| <style> | ||
| html { | ||
| font-size: 36px; | ||
| } | ||
| </style> | ||
| <ion-searchbar value="My Text" show-cancel-button="always" show-clear-button="always"></ion-searchbar> | ||
| `, | ||
| config | ||
| ); | ||
|
|
||
| const searchbar = page.locator('ion-searchbar'); | ||
|
|
||
| await expect(searchbar).toHaveScreenshot(screenshot(`searchbar-scale`)); | ||
| }); | ||
| }); | ||
| }); |
Uh oh!
There was an error while loading. Please reload this page.