Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
06aaaaa
feat(icon): add support for slotted content
brandyscarney Jul 10, 2026
175fed2
test(ionicons): refactor the tests to individual pages with shared st…
brandyscarney Jul 21, 2026
6bf9274
test(icon): move all test files into the icon test folder
brandyscarney Jul 21, 2026
3a2a57e
test(icon): consistent head tags and titles for tests
brandyscarney Jul 21, 2026
a295aef
test(icon): fix screenshots and naming
brandyscarney Jul 21, 2026
77ca364
chore(): add updated snapshots
Ionitron Jul 21, 2026
ed357ea
chore(testing): update test to run spec and e2e and document it
brandyscarney Jul 22, 2026
99cb543
chore(deps): update to playwright and jest to resolve errors
brandyscarney Jul 22, 2026
54aff8e
test(icon): fix sanitization test and add e2e test
brandyscarney Jul 22, 2026
00a2169
test(icon): add a11y test for icon
brandyscarney Jul 22, 2026
4cea47b
chore(prettier): ignore components file and run prettier on test files
brandyscarney Jul 22, 2026
4bb43d8
chore(deps): update stencil to latest
brandyscarney Jul 22, 2026
bf00f5a
chore(): add updated snapshots
Ionitron Jul 22, 2026
a912828
revert(icon): revert slotted font support
brandyscarney Jul 22, 2026
58ca62c
Revert "revert(icon): revert slotted font support"
brandyscarney Jul 22, 2026
4dfa798
test(icon): add tests for slotted font icons
brandyscarney Jul 22, 2026
f5157b9
chore(): add updated snapshots
Ionitron Jul 22, 2026
51f33b5
fix(icon): remove double div on svgs and render height correctly
brandyscarney Jul 23, 2026
c794397
test(icon): lint and fix paths
brandyscarney Jul 23, 2026
c7205a2
test(icon): add spec tests for svg rendering
brandyscarney Jul 23, 2026
f2f328f
style: lint
brandyscarney Jul 23, 2026
cd916b1
test(csp): fix import path
brandyscarney Jul 24, 2026
e6a33bb
chore(build): remove duplicate copy task
brandyscarney Jul 24, 2026
e5e7bcd
Merge branch 'chore/ionicons-align-build-tests' into FW-7618
brandyscarney Jul 24, 2026
a6d9b8c
test(icon): fix a11y test
brandyscarney Jul 24, 2026
dfd6b88
test(icon): fix asset path
brandyscarney Jul 24, 2026
182a7ed
chore: delete snapshots to regenerate
brandyscarney Jul 24, 2026
0d622f4
chore(): add updated snapshots
Ionitron Jul 24, 2026
96b9ead
Merge branch 'chore/ionicons-align-build-tests' into FW-7618
brandyscarney Jul 24, 2026
f1fb490
test(icon): capture smaller screenshots
brandyscarney Jul 28, 2026
f6bbf01
chore(): add updated snapshots
Ionitron Jul 28, 2026
207c009
Merge branch 'chore/ionicons-align-build-tests' into FW-7618
brandyscarney Jul 28, 2026
1fa116b
chore(): add updated snapshots
Ionitron Jul 28, 2026
7290eb5
Merge branch 'main' into FW-7618
brandyscarney Jul 28, 2026
a818214
docs(readme): update release process
brandyscarney Jul 28, 2026
06400e9
test(icon): add size test and e2e tests
brandyscarney Jul 28, 2026
e15c0b8
chore(): add updated snapshots
Ionitron Jul 28, 2026
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
3 changes: 2 additions & 1 deletion jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { createJestStencilPreset } from 'jest-stencil-runner';
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));

export default createJestStencilPreset({
rootDir: __dirname,
rootDir: __dirname,
// Add any additional Jest configuration here
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
Expand Down
2 changes: 2 additions & 0 deletions jest.setup.js
Comment thread
brandyscarney marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const Stencil = require('@stencil/core');
Stencil.Build.isBrowser = true;
Comment on lines +1 to +2
17 changes: 8 additions & 9 deletions scripts/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ npm start

## Release Steps

The release script will ask what version to use. After the script completes, double check the `www/cheatsheet.html` to ensure everything is good to go.

Next, update `CHANGELOG.md`, then commit and push your changes Github.

```sh
npm run release
```

Triple check the version number is correct, and choose which tag this should be released as. If it's a pre-release, it should be `dev`.
Releases are automated via GitHub Actions. To trigger a release:

1. Go to the [Release Orchestrator](https://github.com/ionic-team/ionicons/actions/workflows/release-orchestrator.yml) workflow
2. Click "Run workflow"
3. Select the release type:
- **dev** — Creates a pre-release with a timestamp-based version (e.g., `8.0.14-dev.11784821417.1c794397`)
- **production** — Creates a semver release; select `patch`, `minor`, or `major`
4. The workflow will build, publish to NPM, and create a GitHub release (for production releases)
24 changes: 21 additions & 3 deletions src/components/icon/icon.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
width: 1em;
height: 1em;

contain: strict;
font-size: 1em;

contain: layout style;

fill: currentColor;

box-sizing: content-box !important;

}

:host .ionicon {
Expand All @@ -24,7 +25,16 @@
stroke-width: var(--ionicon-stroke-width, 32px);
}

.icon-inner,
.icon-inner {
display: flex;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We need flex here for the font icons, otherwise they are shifted to the right and down. Since developers can't override this, we could expose this as a part if it's an issue.


align-items: center;
justify-content: center;

width: 100%;
height: 100%;
}

.ionicon,
svg {
display: block;
Expand All @@ -33,6 +43,14 @@ svg {
width: 100%;
}

/* Slotted Content
* -----------------------------------------------------------
*/

::slotted(*) {
font-size: inherit !important;
}

/* Icon RTL
* -----------------------------------------------------------
*/
Expand Down
4 changes: 3 additions & 1 deletion src/components/icon/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ export class Icon {
{Build.isBrowser && this.svgContent ? (
<div class="icon-inner" innerHTML={this.svgContent}></div>
) : (
<div class="icon-inner"></div>
<div class="icon-inner">
<slot></slot>
</div>
)}
</Host>
);
Expand Down
34 changes: 31 additions & 3 deletions src/components/icon/test/a11y/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<script nomodule src="/build/ionicons.js"></script>
<link rel="stylesheet" href="../styles.css" />
<script src="../header.js"></script>

<!-- Font Awesome Icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css" />
Comment on lines +12 to +13
</head>

<body>
Expand All @@ -16,16 +19,41 @@
<main>
<h1>Icon - Accessibility</h1>

<h2>Icon with aria-label</h2>
<h2>SVG icon with aria-label</h2>
<ion-icon name="cellular" aria-label="Mobile data"></ion-icon>

<h2>Button with aria-label</h2>
<h2>Button with aria-label and SVG icon</h2>
<button aria-label="Mobile data">
<ion-icon name="cellular" aria-hidden="true"></ion-icon>
</button>

<h2>Icon with aria-hidden</h2>
<h2>SVG icon with aria-hidden</h2>
<ion-icon name="cellular" aria-hidden="true"></ion-icon>

<hr />

<h2>Font icon with aria-label</h2>
<ion-icon aria-label="Mobile data">
<i class="fa fa-home"></i>
</ion-icon>

<h2>Button with aria-label and font icon</h2>
<button aria-label="Mobile data">
<ion-icon aria-hidden="true">
<i class="fa fa-home"></i>
</ion-icon>
</button>

<h2>Font icon with aria-hidden</h2>
<ion-icon aria-hidden="true">
<i class="fa fa-home"></i>
</ion-icon>
</main>

<style>
ion-icon {
font-size: 32px;
}
</style>
</body>
</html>
4 changes: 4 additions & 0 deletions src/components/icon/test/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ <h2>Custom CSS</h2>
</main>

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

.custom {
stroke: red;
fill: blue;
Expand Down
4 changes: 4 additions & 0 deletions src/components/icon/test/csp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ <h2>Default</h2>
</body>

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

.custom {
stroke: red;
fill: goldenrod;
Expand Down
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.
15 changes: 15 additions & 0 deletions src/components/icon/test/dynamic-type/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<script nomodule src="/build/ionicons.js"></script>
<link rel="stylesheet" href="../styles.css" />
<script src="../header.js"></script>

<!-- Font Awesome Icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css" />
Comment on lines +11 to +13
</head>

<body>
Expand All @@ -16,9 +19,21 @@
<main>
<h1>Icon - Dynamic Type</h1>

<h2>Default Icons</h2>
<ion-icon name="star"></ion-icon>
<ion-icon name="star" size="small"></ion-icon>
<ion-icon name="star" size="large"></ion-icon>

<h2>Font Icons</h2>
<ion-icon>
<i class="fa fa-star"></i>
</ion-icon>
<ion-icon size="small">
<i class="fa fa-star"></i>
</ion-icon>
<ion-icon size="large">
<i class="fa fa-star"></i>
</ion-icon>
</main>

<style>
Expand Down
Loading
Loading