Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
],
"dependencies": {
"@stencil/core": "^4.43.5",
"ionicons": "^8.0.13",
"ionicons": "^8.1.0",
"tslib": "^2.1.0"
},
"devDependencies": {
Expand Down
34 changes: 34 additions & 0 deletions core/src/components/icon/test/font/icon.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { expect } from '@playwright/test';
import { configs, test } from '@utils/test/playwright';

configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
/**
* Font icon rendering does not vary across modes/directions.
*/
configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {

Nit: could you add a note on why this is md/ltr only? We generally put a /** */ block above a restricted configs() call, like select-modal does. Up to you!

test.describe(title('icon: font'), () => {
test('should render font icon when passed', async ({ page }) => {
await page.setContent(
`
<link
rel="stylesheet"
type="text/css"
href="https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.1/src/fill/style.css"
/>

<style>
ion-icon {
font-size: 32px;
}
</style>

<ion-icon>
<i class="ph-fill ph-house"></i>
</ion-icon>
`,
config
);

await page.evaluate(() => document.fonts.ready);

const icon = page.locator('ion-icon');
await expect(icon).toHaveScreenshot(screenshot(`icon-font`));
});
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
286 changes: 286 additions & 0 deletions core/src/components/icon/test/font/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8" />
<title>Icon - Font</title>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet" />
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
<link
rel="stylesheet"
type="text/css"
href="https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.1/src/regular/style.css"
/>
<link
rel="stylesheet"
type="text/css"
href="https://cdn.jsdelivr.net/npm/@phosphor-icons/web@2.1.1/src/fill/style.css"
/>
<script src="../../../../../scripts/testing/scripts.js"></script>
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
</head>

<body>
<ion-app>
<ion-header>
<ion-toolbar>
<ion-title>Icon - Font</ion-title>
</ion-toolbar>
</ion-header>

<ion-content class="ion-padding-horizontal">
<h2>Phosphor icons: regular</h2>
<ion-icon aria-hidden="true">
<i class="ph ph-house"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph ph-heart"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph ph-star"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph ph-user"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph ph-gear"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph ph-airplane"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph ph-trash"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph ph-globe"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph ph-lock"></i>
</ion-icon>

<h2>Phosphor icons: fill</h2>
<ion-icon aria-hidden="true">
<i class="ph-fill ph-house"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph-fill ph-heart"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph-fill ph-star"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph-fill ph-user"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph-fill ph-gear"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph-fill ph-airplane"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph-fill ph-trash"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph-fill ph-globe"></i>
</ion-icon>
<ion-icon aria-hidden="true">
<i class="ph-fill ph-lock"></i>
</ion-icon>

<h2>Phosphor icons: color</h2>
<ion-icon aria-hidden="true" color="primary">
<i class="ph ph-house"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="secondary">
<i class="ph ph-heart"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="tertiary">
<i class="ph ph-star"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="success">
<i class="ph ph-user"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="warning">
<i class="ph ph-gear"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="danger">
<i class="ph ph-airplane"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="light">
<i class="ph ph-trash"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="medium">
<i class="ph ph-globe"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="dark">
<i class="ph ph-lock"></i>
</ion-icon>
<br />
<ion-icon aria-hidden="true" color="primary">
<i class="ph-fill ph-house"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="secondary">
<i class="ph-fill ph-heart"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="tertiary">
<i class="ph-fill ph-star"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="success">
<i class="ph-fill ph-user"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="warning">
<i class="ph-fill ph-gear"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="danger">
<i class="ph-fill ph-airplane"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="light">
<i class="ph-fill ph-trash"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="medium">
<i class="ph-fill ph-globe"></i>
</ion-icon>
<ion-icon aria-hidden="true" color="dark">
<i class="ph-fill ph-lock"></i>
</ion-icon>

<h2>Phosphor icons: custom sizing</h2>
<ion-icon aria-hidden="true" style="font-size: 16px">
<i class="ph ph-house"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 20px">
<i class="ph ph-heart"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 24px">
<i class="ph ph-star"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 28px">
<i class="ph ph-user"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 32px">
<i class="ph ph-gear"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 36px">
<i class="ph ph-airplane"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 40px">
<i class="ph ph-trash"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 44px">
<i class="ph ph-globe"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 48px">
<i class="ph ph-lock"></i>
</ion-icon>
<br />
<ion-icon aria-hidden="true" style="font-size: 16px">
<i class="ph-fill ph-house"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 20px">
<i class="ph-fill ph-heart"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 24px">
<i class="ph-fill ph-star"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 28px">
<i class="ph-fill ph-user"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 32px">
<i class="ph-fill ph-gear"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 36px">
<i class="ph-fill ph-airplane"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 40px">
<i class="ph-fill ph-trash"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 44px">
<i class="ph-fill ph-globe"></i>
</ion-icon>
<ion-icon aria-hidden="true" style="font-size: 48px">
<i class="ph-fill ph-lock"></i>
</ion-icon>

<h2>Buttons: Phosphor Icons</h2>
<ion-button size="small" aria-label="Trash">
<ion-icon aria-hidden="true" slot="icon-only">
<i class="ph-fill ph-trash"></i>
</ion-icon>
</ion-button>

<ion-button size="medium" aria-label="Trash">
<ion-icon aria-hidden="true" slot="icon-only">
<i class="ph-fill ph-trash"></i>
</ion-icon>
</ion-button>

<ion-button size="large" aria-label="Trash">
<ion-icon aria-hidden="true" slot="icon-only">
<i class="ph-fill ph-trash"></i>
</ion-icon>
</ion-button>

<h2>Buttons: Ionicons</h2>
<ion-button size="small" aria-label="Trash">
<ion-icon aria-hidden="true" slot="icon-only" icon="trash"></ion-icon>
</ion-button>

<ion-button size="medium" aria-label="Trash">
<ion-icon aria-hidden="true" slot="icon-only" icon="trash"></ion-icon>
</ion-button>

<ion-button size="large" aria-label="Trash">
<ion-icon aria-hidden="true" slot="icon-only" icon="trash"></ion-icon>
</ion-button>

<h2>Items: Phosphor Icons</h2>
<ion-item>
<ion-icon aria-hidden="true" slot="start">
<i class="ph-fill ph-person"></i>
</ion-icon>
<ion-label>Phosphor Icons</ion-label>
<ion-icon aria-hidden="true" slot="end">
<i class="ph-fill ph-trash"></i>
</ion-icon>
</ion-item>

<ion-item>
<ion-icon color="secondary" aria-hidden="true" slot="start">
<i class="ph-fill ph-person"></i>
</ion-icon>
<ion-label>Phosphor Icons</ion-label>
<ion-icon color="danger" aria-hidden="true" slot="end">
<i class="ph-fill ph-trash"></i>
</ion-icon>
</ion-item>

<h2>Items: Ionicons</h2>
<ion-item>
<ion-icon icon="person" aria-hidden="true" slot="start"></ion-icon>
<ion-label>Ionicons</ion-label>
<ion-icon icon="trash" aria-hidden="true" slot="end"></ion-icon>
</ion-item>

<ion-item>
<ion-icon icon="person" color="secondary" aria-hidden="true" slot="start"></ion-icon>
<ion-label>Ionicons</ion-label>
<ion-icon icon="trash" color="danger" aria-hidden="true" slot="end"></ion-icon>
</ion-item>
</ion-content>
</ion-app>

<style>
h2 {
text-transform: uppercase;
font-size: 14px;
color: #444;
font-weight: bold;
margin-top: 24px;
}
</style>
</body>
</html>
3 changes: 1 addition & 2 deletions core/src/components/input/input.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
}

.input-clear-icon ion-icon {
width: 18px;
height: 18px;
font-size: 18px;
}

// Input - Disabled
Expand Down
3 changes: 1 addition & 2 deletions core/src/components/input/input.md.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
}

.input-clear-icon ion-icon {
width: 22px;
height: 22px;
font-size: 22px;
}

// Input - Disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
// Icon
.select-option-start > ion-icon,
.select-option-end > ion-icon {
width: 28px;
height: 28px;
font-size: 28px;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think size might get past this now. ionicons applies font-size: 2rem !important for size="large" in its own shadow root, and an inner !important beats our outer rule, so a large icon measured 32px for me where the old width/height held it at 28px. The comment above mentions capping slotted content, so figured I'd flag it.

Adding !important here would keep the cap, or :not([size]) if you'd rather size win. Same in the MD file. Could be missing something though!

}

// Select Option: Action Sheet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
// Icon
.select-option-start > ion-icon,
.select-option-end > ion-icon {
width: 24px;
height: 24px;
font-size: 24px;
}

// Image / SVG / Thumbnail
Expand Down
Loading
Loading