Skip to content

feat(icon): add font icon support to ion-icon - #31302

Merged
brandyscarney merged 6 commits into
major-9.0from
FW-7625
Aug 3, 2026
Merged

brandyscarney merged 6 commits into
major-9.0from
FW-7625

Conversation

@brandyscarney

@brandyscarney brandyscarney commented Jul 28, 2026 •

Copy link
Copy Markdown
Member

Issue number: internal


What is the current behavior?

Ionicons added support for font icons in ion-icon, but Ionic Framework does not support it.

What is the new behavior?

  • Updates Ionicons to the latest release with font icon support
  • Adds a font test to the icon folder to verify font icon support works in Ionic Framework
  • Updates the components that style ion-icon using width/height to use font-size so it will style them for both SVGs and font icons.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Preview: icon: font

@vercel

vercel Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview Aug 3, 2026 3:38pm

Request Review

@brandyscarney
brandyscarney marked this pull request as ready for review July 28, 2026 21:34
@brandyscarney
brandyscarney requested a review from a team as a code owner July 28, 2026 21:34
@brandyscarney
brandyscarney requested a review from ShaneK July 28, 2026 21:34

@ShaneK ShaneK left a comment

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'm approving this with nits, but I do think the size issue is worth considering more (and may not actually be a nit if you agree it could be a problem)

@thetaPC thetaPC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Once you verify what Shane said, then I can move forward with my decision.

@thetaPC thetaPC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@brandyscarney
brandyscarney merged commit 3edc1c3 into major-9.0 Aug 3, 2026
53 checks passed
@brandyscarney
brandyscarney deleted the FW-7625 branch August 3, 2026 17:23
ShaneK added a commit that referenced this pull request Nov 19, 2026
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. -->

Currently, Ionic Framework depends on `ionicons@^8.0.13`. Every ionicons
release up to `8.1.0` has gaps in `ion-icon`'s SVG sanitization that let
script run, which are described in
[GHSA-xg58-2j88-q7f7](GHSA-xg58-2j88-q7f7).

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

- `@ionic/core`, `@ionic/angular`, `@ionic/react` and `@ionic/vue` now
require `ionicons@^8.1.1`, which has the fix, so updating Ionic also
updates ionicons.

## Does this introduce a breaking change?

- [ ] Yes
- [X] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Since `8.1.1` is the first patched version, this also brings in the font
icon support from `ionicons@8.1.0`, which `main` already has from
#31302. It adds a `<slot>` to `ion-icon` and changes its containment and
layout CSS. None of our components put content inside `ion-icon`, and I
ran the 172 e2e files that use it in Docker against this branch. The
only failure was the `item-sliding` md/rtl safe area screenshot, which
fails just as often on `8.0.13`.

`ion-icon` also stops rendering some SVGs that rendered before, like
ones with more than one root `<svg>` or HTML inside `<desc>` or
`<title>`. The icons that ship with ionicons all pass, and the advisory
covers what to do for custom icons.

This branch was successfully deployed

1 active deployment
Preview — 75efe3e9 Deployed Aug 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants