Compare commits

...

69 Commits

Author SHA1 Message Date
Sean Perkins
539f05b150 chore: conflicts with dynamic type and stacked labels 2023-09-25 14:35:18 -04:00
Sean Perkins
45dea9781c Merge remote-tracking branch 'origin/FW-4146' into sp/dynamic-type-standalone 2023-09-25 14:19:16 -04:00
Sean Perkins
cef5a29867 Merge remote-tracking branch 'origin/FW-4612' into sp/dynamic-type-standalone 2023-09-25 14:12:36 -04:00
Sean Perkins
28f2ec9c62 feat(angular): standalone form controls can participate in forms (#28125)
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?
<!-- Please describe the current behavior that you are modifying. -->

Ionic standalone form controls cannot participate in Angular forms.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Ionic form controls can participate in Angular forms by importing the
standalone component
- Applies to: `ion-input`, `ion-textarea`, `ion-searchbar`,
`ion-toggle`, `ion-checkbox`, `ion-segment`, `ion-radio`,
`ion-radio-group`, `ion-datetime` and `ion-range`.
- Refactors `ValueAccessor` from `@ionic/angular` to
`@ionic/angular/common`
- Refactors `raf` utility from `@ionic/angular` to
`@ionic/angular/common`

## 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. -->

---------
2023-09-19 12:46:28 -04:00
Amanda Johnston
7597cce66a 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 <hi@ionicframework.com>
2023-09-19 09:05:43 -05:00
Liam DeBeasi
e3a6de3e32 feat(datetime): support dynamic type (#28129) 2023-09-15 14:04:57 -04:00
Liam DeBeasi
dad7e66cf6 fix(angular): include core exports in standalone (#28158) 2023-09-12 12:06:59 -04:00
Liam DeBeasi
98de18513e fix: add fallback for when not enabled (#28142) 2023-09-11 08:53:16 -04:00
Liam DeBeasi
c55c492b61 refactor: rename dynamic font variable (#28145) 2023-09-08 08:58:23 -04:00
Liam DeBeasi
26962d9e58 fix(searchbar): searchbar in collapsible header has correct height (#28144) 2023-09-08 08:55:52 -04:00
Liam DeBeasi
128617512c fix(header): do not apply safe area padding to collapsible large title toolbar (#28143) 2023-09-07 16:12:27 -04:00
Liam DeBeasi
28deb56e9c chore: sync with main
chore: sync with main
2023-09-07 11:51:13 -04:00
Maria Hutt
3720ae6a09 chore(angular): remove unused type 2023-09-07 08:08:14 -07:00
Maria Hutt
01c34738a6 chore(angular): add missing code from bbfb8f8 2023-09-06 14:07:56 -07:00
Maria Hutt
fd0f25aa72 Merge remote-tracking branch 'origin/main' into FW-4612-sync 2023-09-06 13:24:09 -07:00
Brandy Carney
921faac009 refactor(item-options): remove unnecessary font-size style (#28133)
Removes the `font-size` from `ion-item-options`. It is unnecessary because `ion-item-option` also defines `font-size`.
2023-09-06 15:30:33 -04:00
Liam DeBeasi
f4ce2af19e chore: sync with main
chore: sync with main
2023-09-06 11:33:28 -04:00
ionitron
6bae0be7aa chore(): add updated snapshots 2023-09-06 15:14:40 +00:00
Liam DeBeasi
c59eaf1b8b chore: sync with main 2023-09-06 10:58:16 -04:00
Brandy Carney
464198c9ce feat(item): support dynamic type (#27989)
Adds support for dynamic type by converting `font-size` to use `rem` units and icon `font-size` to use `em` units.
2023-09-06 10:42:53 -04:00
Amanda Johnston
0afa14ed7a feat(angular): add standalone tabs (#28093)
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?

Tabs cannot be used as a standalone component.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Added tabs as a standalone component.
- Added a quick test. I included the event checking from the lazy test
in the HTML as a smoke check, but didn't bring over the Cypress tests
for them since I noticed the other standalone tests have been quick,
stripped down affairs. I'm assuming I would just be duplicating effort.
Let me know if I should bring more tests over from the lazy version, or
even get rid of the event logging from the standalone HTML.

## 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. -->
2023-09-01 13:08:20 -05:00
Sean Perkins
dcd23e188b feat(toast): support dynamic type (#28051)
Issue number: Internal

---------

<!-- 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?
<!-- Please describe the current behavior that you are modifying. -->

Toast does not support the dynamic type feature in iOS. 

_A brief history on Ionic's toast..._

The toast component is influenced based on Material Design's
[Snackbar](https://m2.material.io/components/snackbars) component. iOS
does not include a toast component in their Human Interface Guidelines.
Ionic's implementation is a hybrid of a "close enough" design for iOS
that somewhat resembles iOS notifications.

Taking this into account, the new behavior specified below is very much
a best guess of reasonable defaults to provide an appropriate user
experience for a user that is displayed a toast while using the dynamic
type feature in iOS.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- The toast content (header and message) content will scale to a maximum
of 310% of its base size of 14px.
- Note: Header is not a valid aspect of MD Snackbar. This is an area
where the iOS notification style has bled into public API. We scale both
the header and message text to be consistent, but developers should be
cautious with how much content they are rendering. MD recommends a
maximum of 2 lines of text for mobile, this would include both the
header and message text[^1].
- The toast button will scale based on the same sizing rules as the back
button does for dynamic type. The action is important to scale for
visibility, but the content of the toast is the primary content that
should be scaled to the maximum size allocated.
- On iOS, the toast container has a maximum height of 478px. This value
is taken from scaling the notification UI in iOS to 310% and capturing
the height of the largest allowed notification[^2]. Developers that
display too much text will have the contents overflow (visibly hidden).
This is intentional to prevent the toast from covering the entire
application UI and to enforce developers limit their text. Developers
can continue to override this value through the `--max-height` CSS
variable.
- The fixed height requirement for toast has been removed. On iOS, the
toast container can expand up to the max height (defaults to `478px`).
On MD, the container will expand and overflow the viewport. Once again,
developers _should_ follow best practices of limiting their message to
1-2 lines of text.


https://github.com/ionic-team/ionic-framework/assets/13732623/d19e93c9-55c3-4b35-85af-3be9d98e008d


## 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. -->

I attempted to enforce the line requirements to have the header and
message text overflow, but line-clamp is not consistently implemented
across browsers and Safari does not render an ellipsis when the content
overflows. For this reason, I do not believe clamping the text to a
fixed number of lines is viable at this time.

[^1]: Reference to Material Design 2 Snackbar spec:
https://m2.material.io/components/snackbars#specs
[^2]: Reference image for iOS notifications scaled to 310%:
https://github.com/ionic-team/ionic-framework/assets/13732623/e2420340-8046-4a56-81c8-9e2ee1c1399b

---------

Co-authored-by: ionitron <hi@ionicframework.com>
2023-09-01 13:08:21 -04:00
Maria Hutt
a23c1222b9 feat(title): support dynamic type (#27990)
Co-authored-by: ionitron <hi@ionicframework.com>
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
2023-08-30 08:15:41 -07:00
Liam DeBeasi
e4cc457f57 feat(toolbar): support dynamic type (#28073) 2023-08-30 08:44:24 -04:00
Shawn Taylor
9e5f732a5e feat(textarea): support dynamic type (#28068)
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?
<!-- Please describe the current behavior that you are modifying. -->
ion-textarea does not support dynamic type

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- ion-textarea does support dynamic type

## 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. -->

Mostly, dynamic type for textarea was already supported. Only the
bottom-content had a static size. All other font sizes were all already
relative.

Note: Textareas do not currently look correct when they are in an item,
because #27989 has not yet merged. Once that PR is merged, the font
sizes within textareas will be relative to the item sizes, and both will
scale appropriately. If preferred, I can base this PR off branch FW-4432
instead.

---------

Co-authored-by: ionitron <hi@ionicframework.com>
2023-08-29 10:39:09 -04:00
Liam DeBeasi
fc39cd3dcb feat(searchbar): support dynamic type (#28043) 2023-08-28 14:03:36 -04:00
Liam DeBeasi
b453ef5c67 feat(range): support dynamic type (#28006) 2023-08-25 15:20:05 -04:00
Brandy Carney
bcc03437e0 feat(item-option): support dynamic type (#28050)
Adds support for dynamic type by converting `font-size` to use `rem` units and adds a min and max `font-size` for `ios`.
2023-08-24 13:50:05 -04:00
Brandy Carney
b1cc988f83 feat(typography): support dynamic type (#28045)
Adds support for dynamic type by converting `font-size` to use `rem` units. Upgrades the `sass` version to `1.33.0` to support this change.
2023-08-24 13:07:36 -04:00
Liam DeBeasi
e5b7f5ff55 feat(angular): add enhanced icon support with addIcons (#28009) 2023-08-22 09:46:46 -04:00
Sean Perkins
221d77827f Merge pull request #28026 from ionic-team/sp/FW-4146-sync-2
chore: sync with main
2023-08-21 17:11:07 -04:00
Sean Perkins
441e534523 chore(): add updated snapshots (#28027)
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?
<!-- Please describe the current behavior that you are modifying. -->

The dynamic type feature branch screenshots are out of sync with the
updated state from changes on `main`.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Regenerates update screenshot diffs for the dynamic type feature
branch with the latest changes from `main`

## 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 <hi@ionicframework.com>
2023-08-21 15:58:31 -04:00
Sean Perkins
28f6c4abbc Merge remote-tracking branch 'origin/main' into sp/FW-4146-sync-2 2023-08-18 15:07:43 -04:00
Sean Perkins
e57759f4b6 chore(angular): generate standalone component wrappers (#27970)
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?
<!-- Please describe the current behavior that you are modifying. -->

Ionic Framework currently only generates the lazy/hydrated Angular
component wrappers for the web components.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Generates Angular standalone component wrappers for the web
components, using the CE build.
  - Adds manual component wrapper for `ion-icon` with the CE build.
- Migrates the `ion-back-button` and `ion-nav` to be manual component
wrappers
- Continues to generate the lazy/hydrated Angular component wrappers.
- Refactors "NavDelegate" etc. language to `IonNav` to avoid exporting
as and simplify navigating the code.

## 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. -->

Related output targets PR:
https://github.com/ionic-team/stencil-ds-output-targets/pull/367
2023-08-18 11:02:16 -04:00
Brandy Carney
5a72ecaa89 feat(menu-button): support dynamic type (#28008)
Adds support for dynamic type by converting `font-size` to use `rem` units and adds a min and max `font-size` for `ios`.
2023-08-17 13:42:01 -04:00
Brandy Carney
b3948d6ab7 feat(label): support dynamic type (#27962)
Adds support for dynamic type by converting `font-size` to use `rem` units.
2023-08-17 10:51:37 -04:00
Liam DeBeasi
ca53682684 feat(angular): add standalone provideIonicAngular (#27996) 2023-08-15 15:32:27 -04:00
Liam DeBeasi
c65e08dcd1 feat(angular): add standalone providers, route strategy, component binding provider (#27997) 2023-08-15 11:45:37 -04:00
Liam DeBeasi
84212acce4 refactor(angular): use type for imports used as types (#27998) 2023-08-15 11:44:58 -04:00
Sean Perkins
104b9547e5 chore: typescript resolves @ionic/angular/common import paths (#27995)
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?
<!-- Please describe the current behavior that you are modifying. -->

IDEs that perform type checking/include a language service will error on
the `@ionic/angular/common` import paths and not provide intelisense or
auto import detection.

![CleanShot 2023-08-15 at 09 49
34](https://github.com/ionic-team/ionic-framework/assets/13732623/2e9913b2-5b44-4dd7-8cf7-8fa0d6aaac69)


## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- `@ionic/angular/common` import paths are detected by IDEs such as
VSCode

![CleanShot 2023-08-15 at 09 48
40](https://github.com/ionic-team/ionic-framework/assets/13732623/cd502093-b095-47a8-b5f7-b28a0fc9fe27)


## 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. -->
2023-08-15 10:50:38 -04:00
Brandy Carney
251a40acd6 feat(item-divider): support dynamic type (#27947)
Adds support for dynamic type by converting `font-size` to use `rem` units.
2023-08-09 09:47:52 -04:00
Brandy Carney
ed545024ad feat(note): support dynamic type (#27946)
Adds support for dynamic type by converting `font-size` to use `rem` units and setting a min `font-size` which matches native iOS.
2023-08-09 09:43:52 -04:00
Maria Hutt
e44a02632d feat(angular): add standalone router-link (#27937) 2023-08-08 11:15:50 -05:00
Brandy Carney
b37121de9b feat(list-header): support dynamic type (#27938)
Adds support for dynamic type by converting `font-size` to use `rem` units and setting a max `font-size` which matches native iOS.
2023-08-08 11:22:42 -04:00
Liam DeBeasi
7b458b6a87 refactor: add dynamic type sass functions (#27934) 2023-08-08 11:05:24 -04:00
Shawn Taylor
8fae6da3f1 feat(chip): add dynamic type support (#27868)
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?
<!-- Please describe the current behavior that you are modifying. -->
The chip component does not support dynamic type.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->
The chip component supports dynamic type, has a dynamic height, has min
and max font sizes in `ios` mode, and has a screenshot test.

### md mode

Small md mode:
<img width="1368" alt="md-small"
src="https://github.com/ionic-team/ionic-framework/assets/14926794/4466c1b6-6d01-4ec8-8de9-0eb71fa45223">


Medium md mode:
<img width="1371" alt="md-medium"
src="https://github.com/ionic-team/ionic-framework/assets/14926794/c51c324e-a3b7-486b-9f68-84b0e4146570">


Large md mode:
<img width="1369" alt="md-large"
src="https://github.com/ionic-team/ionic-framework/assets/14926794/166e1229-96b7-4270-9ef2-4c708776691e">


 
### ios mode
Small ios mode:
<img width="1371" alt="ios-small"
src="https://github.com/ionic-team/ionic-framework/assets/14926794/de240058-5fe5-4387-8481-d695950853db">


Medium ios mode:
<img width="1371" alt="ios-medium"
src="https://github.com/ionic-team/ionic-framework/assets/14926794/c63db4be-e813-4917-a525-02ec456849ea">


Large ios mode:
<img width="1370" alt="ios-large"
src="https://github.com/ionic-team/ionic-framework/assets/14926794/3479f619-82c8-4645-85f7-2725ea43de00">



## 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. -->

This also fixes an existing bug that the contents of a chip could get
smooshed if the chip doesn't have enough horizontal space for its
contents.

### Before
<img width="253" alt="rStll"
src="https://github.com/ionic-team/ionic-framework/assets/14926794/9a8f4c30-ceef-4fe1-a600-38b2f01c4e68">


### After
<img width="253" alt="Screenshot 2023-08-02 at 5 00 39 PM"
src="https://github.com/ionic-team/ionic-framework/assets/14926794/e82e17c3-91e3-4089-a57b-16c7d7b386fb">

---------

Co-authored-by: ionitron <hi@ionicframework.com>
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
2023-08-08 11:04:51 -04:00
Maria Hutt
c52a0972b9 feat(angular): add standalone nav (#27876) 2023-08-04 16:20:39 -07:00
Brandy Carney
c9b27927bd feat(buttons): support dynamic type (#27896)
- Adds support for dynamic type by converting `font-size` to use `rem` units.
- Updates the button width/height for icon only buttons in `md` to use `rem` units to scale the icon larger
- Adds test for scaling the font which checks default buttons, clear buttons (because they use a different `font-size`), buttons with an icon, and a button containing only an icon
2023-08-04 17:05:49 -04:00
Liam DeBeasi
8a97e406a0 feat(angular): add standalone popover (#27883) 2023-08-04 16:55:46 -04:00
Liam DeBeasi
37acdf9711 feat(angular): add standalone modal (#27885) 2023-08-04 15:45:50 -04:00
Liam DeBeasi
9f20780d66 feat(angular): add standalone back-button (#27927) 2023-08-04 15:12:11 -04:00
Liam DeBeasi
3ea7488b47 feat(angular): add standalone router outlet (#27926) 2023-08-04 14:57:32 -04:00
Liam DeBeasi
de48493a16 refactor(angular): move remaining directives to common module (#27909) 2023-08-04 13:46:45 -04:00
Brandy Carney
afcc7eb159 feat(button): support dynamic type (#27887)
Adds support for dynamic type by converting `font-size` to use `rem` units and setting a `max-size` which matches native iOS.
2023-08-04 12:44:06 -04:00
Liam DeBeasi
5b31439ca0 refactor(angular): move providers to common library (#27899) 2023-08-01 15:59:53 -04:00
Liam DeBeasi
291b1310a6 chore: move lazy and standalone tests to subdirectories (#27881) 2023-08-01 15:44:26 -04:00
Liam DeBeasi
a62040f9f9 fix(datetime-button): buttons wrap instead of truncate (#27872) 2023-07-31 10:07:57 -04:00
Liam DeBeasi
af68808e69 test(angular): update test app to account for standalone components (#27867) 2023-07-28 10:33:09 -04:00
Liam DeBeasi
4553425502 chore: add infrastructure for standalone (#27866) 2023-07-27 13:37:42 -04:00
Brandy Carney
92c6b5999a feat(datetime-button): add dynamic type support (#27848)
Issue number: N/A

---------

## What is the current behavior?
The datetime button does not support dynamic type.

## What is the new behavior?
Adds support for dynamic type by converting `font-size` to use `rem`
units and adding an ellipsis to text when the size is too large.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No


## Other information

Dynamic type can be enabled with the following CSS:

```css
html {
  --ion-dynamic-type: var(--ion-default-dynamic-font);
}
```
2023-07-26 16:26:29 -04:00
Maria Hutt
2737871679 feat(card): support dynamic type (#27845) 2023-07-26 08:01:38 -07:00
Liam DeBeasi
4ee14c4245 feat(reorder): support dynamic type (#27838) 2023-07-25 13:12:30 -04:00
Liam DeBeasi
648d06aa2b feat(loading): support for dynamic type (#27828) 2023-07-25 11:01:39 -04:00
Liam DeBeasi
914c6f2c10 test(many): add font scaling tests (#27836) 2023-07-20 15:12:50 -04:00
Liam DeBeasi
7713ea6eb8 feat(badge): support dynamic type (#27772) 2023-07-12 16:25:44 -04:00
Liam DeBeasi
fff2114291 feat(back-button): support dynamic type (#27750) 2023-07-12 15:35:02 -04:00
Liam DeBeasi
c7126a42ad feat(breadcrumb): support dynamic type (#27759) 2023-07-12 15:34:29 -04:00
Liam DeBeasi
563fda7ffc feat(action-sheet): support dynamic type (#27747) 2023-07-10 11:14:10 -04:00
Liam DeBeasi
937c44d22f feat: add dynamic type variables (#27745) 2023-07-06 15:17:09 -04:00
789 changed files with 9002 additions and 1938 deletions

18
core/package-lock.json generated
View File

@@ -44,7 +44,7 @@
"jest-cli": "^27.5.1",
"prettier": "^2.6.1",
"rollup": "^2.26.4",
"sass": "^1.26.10",
"sass": "^1.33.0",
"serve": "^14.0.1",
"stylelint": "^13.13.1",
"stylelint-order": "^4.1.0",
@@ -8825,12 +8825,12 @@
"dev": true
},
"node_modules/sass": {
"version": "1.30.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.30.0.tgz",
"integrity": "sha512-26EUhOXRLaUY7+mWuRFqGeGGNmhB1vblpTENO1Z7mAzzIZeVxZr9EZoaY1kyGLFWdSOZxRMAufiN2mkbO6dAlw==",
"version": "1.33.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.33.0.tgz",
"integrity": "sha512-9v0MUXnSi62FtfjqcwZ+b8B9FIxdwFEb3FPUkjEPXWd0b5KcnPGSp2XF9WrzcH1ZxedfgJVTdA3A1j4eEj53xg==",
"dev": true,
"dependencies": {
"chokidar": ">=2.0.0 <4.0.0"
"chokidar": ">=3.0.0 <4.0.0"
},
"bin": {
"sass": "sass.js"
@@ -16798,12 +16798,12 @@
"dev": true
},
"sass": {
"version": "1.30.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.30.0.tgz",
"integrity": "sha512-26EUhOXRLaUY7+mWuRFqGeGGNmhB1vblpTENO1Z7mAzzIZeVxZr9EZoaY1kyGLFWdSOZxRMAufiN2mkbO6dAlw==",
"version": "1.33.0",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.33.0.tgz",
"integrity": "sha512-9v0MUXnSi62FtfjqcwZ+b8B9FIxdwFEb3FPUkjEPXWd0b5KcnPGSp2XF9WrzcH1ZxedfgJVTdA3A1j4eEj53xg==",
"dev": true,
"requires": {
"chokidar": ">=2.0.0 <4.0.0"
"chokidar": ">=3.0.0 <4.0.0"
}
},
"saxes": {

View File

@@ -66,7 +66,7 @@
"jest-cli": "^27.5.1",
"prettier": "^2.6.1",
"rollup": "^2.26.4",
"sass": "^1.26.10",
"sass": "^1.33.0",
"serve": "^14.0.1",
"stylelint": "^13.13.1",
"stylelint-order": "^4.1.0",

View File

File diff suppressed because one or more lines are too long

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 84 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 84 KiB

View File

@@ -131,11 +131,11 @@
.action-sheet-button {
@include padding($action-sheet-ios-button-padding);
height: $action-sheet-ios-button-height;
min-height: $action-sheet-ios-button-height;
font-size: $action-sheet-ios-button-font-size;
contain: strict;
contain: content;
}
.action-sheet-button .action-sheet-icon {

View File

@@ -50,7 +50,7 @@ $action-sheet-ios-title-padding-start: $action-sheet-
$action-sheet-ios-title-color: $text-color-step-600 !default;
/// @prop - Font size of the action sheet title
$action-sheet-ios-title-font-size: 13px !default;
$action-sheet-ios-title-font-size: dynamic-font-min(1, 13px) !default;
/// @prop - Font weight of the action sheet title
$action-sheet-ios-title-font-weight: 400 !default;
@@ -75,7 +75,7 @@ $action-sheet-ios-title-border-color: rgba($text-col
// --------------------------------------------------
/// @prop - Font size of the action sheet sub title
$action-sheet-ios-sub-title-font-size: 13px !default;
$action-sheet-ios-sub-title-font-size: dynamic-font-min(1, 13px) !default;
/// @prop - Padding top of the action sheet sub title
$action-sheet-ios-sub-title-padding-top: 6px !default;
@@ -97,19 +97,19 @@ $action-sheet-ios-sub-title-padding-start: $action-sheet-
$action-sheet-ios-button-height: 56px !default;
/// @prop - Padding of the action sheet button
$action-sheet-ios-button-padding: 18px !default;
$action-sheet-ios-button-padding: 14px !default;
/// @prop - Text color of the action sheet button
$action-sheet-ios-button-text-color: ion-color(primary, base) !default;
/// @prop - Font size of the action sheet button icon
$action-sheet-ios-button-icon-font-size: 28px !default;
$action-sheet-ios-button-icon-font-size: dynamic-font-min(1, 28px) !default;
/// @prop - Padding right of the action sheet button icon
$action-sheet-ios-button-icon-padding-right: .3em !default;
/// @prop - Font size of the action sheet button
$action-sheet-ios-button-font-size: 20px !default;
$action-sheet-ios-button-font-size: dynamic-font-min(1, 20px) !default;
/// @prop - Border color alpha of the action sheet button
$action-sheet-ios-button-border-color-alpha: .08 !default;

View File

@@ -67,13 +67,13 @@
position: relative;
height: $action-sheet-md-button-height;
min-height: $action-sheet-md-button-height;
font-size: $action-sheet-md-button-font-size;
text-align: $action-sheet-md-text-align;
contain: strict;
contain: content;
overflow: hidden;
}

View File

@@ -26,7 +26,7 @@ $action-sheet-md-title-height: 60px !default;
$action-sheet-md-title-color: rgba($text-color-rgb, 0.54) !default;
/// @prop - Font size of the action sheet title
$action-sheet-md-title-font-size: 16px !default;
$action-sheet-md-title-font-size: dynamic-font(16px) !default;
/// @prop - Padding top of the action sheet title
$action-sheet-md-title-padding-top: 20px !default;
@@ -45,7 +45,7 @@ $action-sheet-md-title-padding-start: $action-sheet-md-title-p
// --------------------------------------------------
/// @prop - Font size of the action sheet sub title
$action-sheet-md-sub-title-font-size: 14px !default;
$action-sheet-md-sub-title-font-size: dynamic-font(14px) !default;
/// @prop - Padding top of the action sheet sub title
$action-sheet-md-sub-title-padding-top: 16px !default;
@@ -70,10 +70,10 @@ $action-sheet-md-button-height: 52px !default;
$action-sheet-md-button-text-color: $text-color-step-150 !default;
/// @prop - Font size of the action sheet button
$action-sheet-md-button-font-size: 16px !default;
$action-sheet-md-button-font-size: dynamic-font(16px) !default;
/// @prop - Padding top of the action sheet button
$action-sheet-md-button-padding-top: 0 !default;
$action-sheet-md-button-padding-top: 12px !default;
/// @prop - Padding end of the action sheet button
$action-sheet-md-button-padding-end: 16px !default;
@@ -91,7 +91,7 @@ $action-sheet-md-button-background: transparent !default;
// --------------------------------------------------
/// @prop - Font size of the icon in the action sheet button
$action-sheet-md-icon-font-size: 24px !default;
$action-sheet-md-icon-font-size: dynamic-font(24px) !default;
/// @prop - Margin top of the icon in the action sheet button
$action-sheet-md-icon-margin-top: 0 !default;

View File

@@ -126,7 +126,10 @@
justify-content: flex-end;
height: 100%;
/* Fallback for browsers that do not support dvh */
max-height: 100vh;
max-height: 100dvh;
}
.action-sheet-group {

View File

@@ -86,3 +86,37 @@ configs({ directions: ['ltr'] }).forEach(({ config, title }) => {
});
});
});
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('action-sheet: font scaling'), () => {
test('should scale text on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 36px;
}
</style>
<ion-action-sheet></ion-action-sheet>
<script>
const actionSheet = document.querySelector('ion-action-sheet');
actionSheet.header = 'Header';
actionSheet.subHeader = 'Sub Header';
actionSheet.buttons = ['Ok', { role: 'cancel', text: 'Cancel' }];
</script>
`,
config
);
const ionActionSheetDidPresent = await page.spyOnEvent('ionActionSheetDidPresent');
const actionSheet = page.locator('ion-action-sheet');
await actionSheet.evaluate((el: HTMLIonActionSheetElement) => el.present());
await ionActionSheetDidPresent.next();
await expect(actionSheet).toHaveScreenshot(screenshot(`action-sheet-scale`));
});
});
});

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -13,10 +13,26 @@
--color: #{$back-button-ios-color};
--icon-margin-end: 1px;
--icon-margin-start: -4px;
/**
* The icon should be sized relative
* to the size of the text which is
* why we use em here instead of rem.
* This allows developers to override
* the text font size while ensuring that
* the icon is sized relative to that.
*/
--icon-font-size: 1.6em;
--min-height: 32px;
font-size: 17px;
/**
* Main content should be prioritized over the back
* button which is why a maximum font size is applied.
* Also, we want the text to remain readable
* so a minimum font size is applied.
* Using 1.294 instead of 1.3 aligns the text
* with the icon a bit nicer in Firefox.
*/
font-size: dynamic-font-clamp(1, 17px, 1.294);
}
.button-native {

View File

@@ -13,14 +13,14 @@
--color: #{$back-button-md-color};
--icon-margin-end: 0;
--icon-margin-start: 0;
--icon-font-size: 24px;
--icon-font-size: #{dynamic-font(24px)};
--icon-font-weight: normal;
--min-height: 32px;
--min-width: 44px;
--padding-start: 12px;
--padding-end: 12px;
font-size: 14px;
font-size: dynamic-font(14px);
font-weight: 500;
text-transform: uppercase;
@@ -30,7 +30,14 @@
--border-radius: 50%;
min-width: 48px;
height: 48px;
min-height: 48px;
/**
* This allows the icon only button to
* keep its circular shape even when the
* text scales up.
*/
aspect-ratio: 1 / 1;
}
.button-native {

View File

@@ -0,0 +1,29 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('back-button: font scaling'), () => {
test('should scale text on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 36px;
}
</style>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button default-href="/" text="Back"></ion-back-button>
</ion-buttons>
</ion-toolbar>
`,
config
);
const backButton = page.locator('ion-back-button');
await expect(backButton).toHaveScreenshot(screenshot(`back-button-scale`));
});
});
});

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -6,4 +6,13 @@
:host {
@include border-radius($badge-ios-border-radius);
/**
* "-apple-system-body" on iOS never goes smaller than
* 14px according to https://developer.apple.com/design/human-interface-guidelines/typography#Specifications.
* However, we still keep the max() usage here for consistency
* with other components and in case "-apple-system-body" does
* go smaller than 14px in the future.
*/
font-size: dynamic-font-min(1, $badge-baseline-font-size);
}

View File

@@ -18,8 +18,11 @@ $badge-padding-start: $badge-padding-end !default;
/// @prop - Minimum width of the badge
$badge-min-width: 10px !default;
/// @prop - Baseline font size of the badge
$badge-baseline-font-size: 13px !default;
/// @prop - Font size of the badge
$badge-font-size: 13px !default;
$badge-font-size: dynamic-font($badge-baseline-font-size) !default;
/// @prop - Font weight of the badge
$badge-font-weight: bold !default;

View File

@@ -0,0 +1,25 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('badge: font scaling'), () => {
test('should scale text on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 36px;
}
</style>
<ion-badge>123</ion-badge>
`,
config
);
const badge = page.locator('ion-badge');
await expect(badge).toHaveScreenshot(screenshot(`badge-scale`));
});
});
});

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -10,6 +10,14 @@
--color-hover: #{$breadcrumb-ios-color-active};
--color-focused: var(--color-active);
--background-focused: #{$breadcrumb-ios-background-focused};
/**
* Main content should be prioritized
* on iOS, so we set max font size for breadcrumbs.
* Breadcrumbs can be placed in the content too, so
* we add a min font size to keep the text legible.
*/
font-size: dynamic-font-clamp(1, $breadcrumb-baseline-font-size, 1.375);
}
:host(.breadcrumb-active) {
@@ -58,7 +66,7 @@
::slotted(ion-icon) {
color: $breadcrumb-ios-icon-color;
font-size: 18px;
font-size: dynamic-font-max(18px, 1.2);
}
::slotted(ion-icon[slot="start"]) {
@@ -92,3 +100,7 @@
.breadcrumbs-collapsed-indicator:focus {
background: $breadcrumb-ios-indicator-background-focused;
}
.breadcrumbs-collapsed-indicator ion-icon {
font-size: dynamic-font-max(22px, 1);
}

View File

@@ -53,7 +53,7 @@
::slotted(ion-icon) {
color: $breadcrumb-md-icon-color;
font-size: 18px;
font-size: dynamic-font(18px);
}
::slotted(ion-icon[slot="start"]) {

View File

@@ -156,5 +156,5 @@
.breadcrumbs-collapsed-indicator ion-icon {
margin-top: 1px;
font-size: 22px;
font-size: dynamic-font(22px);
}

View File

@@ -6,8 +6,10 @@
/// @prop - Font weight of the breadcrumb
$breadcrumb-font-weight: 400 !default;
$breadcrumb-baseline-font-size: 16px !default;
/// @prop - Font size of the breadcrumb
$breadcrumb-font-size: 16px !default;
$breadcrumb-font-size: dynamic-font($breadcrumb-baseline-font-size) !default;
/// @prop - Color of the breadcrumb separator
$breadcrumb-separator-color: var(--ion-color-step-550, #73849a) !default;

View File

@@ -12,3 +12,30 @@ configs().forEach(({ config, title }) => {
});
});
});
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('breadcrumbs: font scaling'), () => {
test('should scale text on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 36px;
}
</style>
<ion-breadcrumbs max-items="2" items-before-collapse="1">
<ion-breadcrumb>Home</ion-breadcrumb>
<ion-breadcrumb>Electronics</ion-breadcrumb>
<ion-breadcrumb>Photography</ion-breadcrumb>
</ion-breadcrumbs>
`,
config
);
const breadcrumbs = page.locator('ion-breadcrumbs');
await expect(breadcrumbs).toHaveScreenshot(screenshot(`breadcrumbs-scale`));
});
});
});

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -24,20 +24,6 @@
letter-spacing: #{$button-ios-letter-spacing};
}
/**
* The default buttons in a toolbar
* have a different font size/weight
* than buttons outside of a toolbar on iOS.
* However, we still want the "size"/"strong"
* properties to be usable in a toolbar, so we add
* the .in-buttons selector such that we
* can add the different font size/weight in a toolbar
* but still let "size"/"strong" override it.
*/
:host(.in-buttons) {
font-size: #{$toolbar-ios-button-font-size};
font-weight: 400;
}
// iOS Solid Button
// --------------------------------------------------
@@ -82,6 +68,25 @@
}
// iOS Toolbar Buttons
// --------------------------------------------------
/**
* The default buttons in a toolbar
* have a different font size/weight
* than buttons outside of a toolbar on iOS.
* However, we still want the "size"/"strong"
* properties to be usable in a toolbar, so we add
* the .in-buttons selector such that we
* can add the different font size/weight in a toolbar
* but still let "size"/"strong" override it.
*/
:host(.in-buttons) {
font-size: #{$toolbar-ios-button-font-size};
font-weight: 400;
}
// iOS Button Sizes
// --------------------------------------------------
@@ -127,7 +132,7 @@
}
// iOS strong Button
// iOS Strong Button
// --------------------------------------------------
:host(.button-strong) {

View File

@@ -34,7 +34,9 @@ $button-ios-min-height: 3.1em !default;
$button-ios-border-radius: 14px !default;
/// @prop - Font size of the button text
$button-ios-font-size: 16px !default;
/// The maximum font size is calculated by taking the default font size
/// and multiplying it by 3, since 310% of the default is the maximum
$button-ios-font-size: dynamic-font-max(16px, 3) !default;
/// @prop - Font weight of the button text
$button-ios-font-weight: 500 !default;
@@ -83,7 +85,9 @@ $button-ios-large-min-height: 3.1em !default;
$button-ios-large-border-radius: 16px !default;
/// @prop - Font size of the large button
$button-ios-large-font-size: 20px !default;
/// The maximum font size is calculated by taking the default font size
/// and multiplying it by 3, since 310% of the default is the maximum
$button-ios-large-font-size: dynamic-font-max(20px, 3) !default;
// iOS Small Button
@@ -108,7 +112,9 @@ $button-ios-small-min-height: 2.1em !default;
$button-ios-small-border-radius: 6px !default;
/// @prop - Font size of the small button
$button-ios-small-font-size: 13px !default;
/// The maximum font size is calculated by taking the default font size
/// and multiplying it by 3, since 310% of the default is the maximum
$button-ios-small-font-size: dynamic-font-max(13px, 3) !default;
// iOS Outline Button
@@ -151,13 +157,15 @@ $button-ios-outline-background-color-focused: ion-color(primary, base, $
// --------------------------------------------------
/// @prop - Font size of the clear button
$button-ios-clear-font-size: 17px !default;
/// The maximum font size is calculated by taking the default font size
/// and multiplying it by 3, since 310% of the default is the maximum
$button-ios-clear-font-size: dynamic-font-max(17px, 3) !default;
/// @prop - Font weight of the clear button
$button-ios-clear-font-weight: normal !default;
/// @prop - Letter spacing of the button
$button-ios-letter-spacing: 0 !default;
$button-ios-letter-spacing: 0 !default;
/// @prop - Border color of the clear button
$button-ios-clear-border-color: transparent !default;

View File

@@ -34,7 +34,7 @@ $button-md-min-height: 36px !default;
$button-md-border-radius: 4px !default;
/// @prop - Font size of the button text
$button-md-font-size: 14px !default;
$button-md-font-size: dynamic-font(14px) !default;
/// @prop - Font weight of the button text
$button-md-font-weight: 500 !default;
@@ -78,7 +78,7 @@ $button-md-large-padding-start: $button-md-large-padding
$button-md-large-min-height: 2.8em !default;
/// @prop - Font size of the large button
$button-md-large-font-size: 20px !default;
$button-md-large-font-size: dynamic-font(20px) !default;
// Material Design Small Button
@@ -100,7 +100,7 @@ $button-md-small-padding-start: $button-md-small-padding
$button-md-small-min-height: 2.1em !default;
/// @prop - Font size of the small button
$button-md-small-font-size: 13px !default;
$button-md-small-font-size: dynamic-font(13px) !default;
// Material Design Outline Button

View File

@@ -0,0 +1,82 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('button: font scaling'), () => {
test('should scale default button text on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 310%;
}
</style>
<ion-button>Default</ion-button>
`,
config
);
const button = page.locator('ion-button');
await expect(button).toHaveScreenshot(screenshot(`button-default-scale`));
});
test('should scale clear button text on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 310%;
}
</style>
<ion-button fill="clear">Clear</ion-button>
`,
config
);
const button = page.locator('ion-button');
await expect(button).toHaveScreenshot(screenshot(`button-clear-scale`));
});
test('should scale small button text on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 310%;
}
</style>
<ion-button size="small">Small</ion-button>
`,
config
);
const button = page.locator('ion-button');
await expect(button).toHaveScreenshot(screenshot(`button-small-scale`));
});
test('should scale large button text on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 310%;
}
</style>
<ion-button size="large">Large</ion-button>
`,
config
);
const button = page.locator('ion-button');
await expect(button).toHaveScreenshot(screenshot(`button-large-scale`));
});
});
});

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -88,7 +88,10 @@
@include margin(0);
@include margin-horizontal(null, .3em);
font-size: 24px;
// This value is calculated by dividing the font size the
// icon should be in px (24px) by the font size of its
// parent button (17px). e.g. 24 / 17 = 1.4117
font-size: 1.41em;
line-height: .67;
}
@@ -97,7 +100,10 @@
@include margin(0);
@include margin-horizontal(.4em, null);
font-size: 24px;
// This value is calculated by dividing the font size the
// icon should be in px (24px) by the font size of its
// parent button (17px). e.g. 24 / 17 = 1.4117
font-size: 1.41em;
line-height: .67;
}
@@ -106,7 +112,10 @@
@include padding(0);
@include margin(0);
font-size: 28px;
// This value is calculated by dividing the font size the
// icon should be in px (28px) by the font size of its
// parent button (17px). e.g. 28 / 17 = 1.647
font-size: 1.65em;
line-height: .67;
}

View File

@@ -65,8 +65,8 @@
@include margin(0);
width: 48px;
height: 48px;
width: 3rem;
height: 3rem;
}

View File

@@ -0,0 +1,95 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('buttons: font scaling'), () => {
test('should scale default button text on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 135%;
}
</style>
<ion-buttons>
<ion-button>Default</ion-button>
</ion-buttons>
`,
config
);
const button = page.locator('ion-button');
await expect(button).toHaveScreenshot(screenshot(`buttons-default-scale`));
});
test('should scale clear button text on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 135%;
}
</style>
<ion-buttons>
<ion-button fill="clear">Clear</ion-button>
</ion-buttons>
`,
config
);
const button = page.locator('ion-button');
await expect(button).toHaveScreenshot(screenshot(`buttons-clear-scale`));
});
test('should scale button with icon on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 135%;
}
</style>
<ion-buttons>
<ion-button>
<ion-icon slot="start" name="star"></ion-icon>
Default
</ion-button>
</ion-buttons>
`,
config
);
const button = page.locator('ion-button');
await expect(button).toHaveScreenshot(screenshot(`buttons-icon-scale`));
});
test('should scale button with icon only on larger font sizes', async ({ page }) => {
await page.setContent(
`
<style>
html {
font-size: 135%;
}
</style>
<ion-buttons>
<ion-button>
<ion-icon slot="icon-only" name="person-circle"></ion-icon>
</ion-button>
</ion-buttons>
`,
config
);
const button = page.locator('ion-button');
await expect(button).toHaveScreenshot(screenshot(`buttons-icon-only-scale`));
});
});
});

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 964 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Some files were not shown because too many files have changed in this diff Show More