Skip to content

Comments

Remove material symbols#1333

Open
zetter-rpf wants to merge 3 commits intomainfrom
remove-material-symbols
Open

Remove material symbols#1333
zetter-rpf wants to merge 3 commits intomainfrom
remove-material-symbols

Conversation

@zetter-rpf
Copy link
Contributor

@zetter-rpf zetter-rpf commented Feb 18, 2026

I did some investigation into our bundle size. Material symbols was taking up 80% even though we don't use many symbols (only the alert symbol for one error message)

Bundle size:

Screenshot 2026-02-18 at 15 53 28

Not loading material symbols will make the code editor load faster and perform better in slower devices.

We're likely to want to use symbols in the future, especially since other components in the design library use material symbols. Then we have a few options:

  • Instead of using material symbols, use our own icons
  • Include just the material symbol font we're using from the material-symbols package
  • Require the host page to load the material symbols font. The web component would just need to define styles on '.material-symbols-sharp' as the material-symbols library does.

We could apply one of these now, but I think it would be helpful to have more example of symbols we want to use before we do which is why my preference is to remove them for now.

Visual changes

The only change is to remove the symbol used for an alert that I expect a very small proportion of our users see. Before:

Screenshot 2026-02-18 at 15 25 06

Even if we did want to continue using material icons, this isn't needed here are we are importing the specific icon file we need elsewhere in CSS
@zetter-rpf zetter-rpf temporarily deployed to previews/1333/merge February 18, 2026 15:54 — with GitHub Actions Inactive
@zetter-rpf zetter-rpf marked this pull request as ready for review February 18, 2026 15:58
Copilot AI review requested due to automatic review settings February 18, 2026 15:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes the material-symbols dependency and related font/style loading to reduce bundle size, replacing the one in-product usage (error alert icon) with a lightweight CSS-variable override.

Changes:

  • Removed material-symbols from package.json and yarn.lock.
  • Stopped loading Material Symbols via @use in SCSS, a JS side-effect import, and the demo page Google Fonts <link>.
  • Added a --rpf-alert-error-icon CSS custom property override for the web component root.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yarn.lock Removes the locked material-symbols package entry.
package.json Drops material-symbols from dependencies.
src/web-component.html Removes external Google Fonts stylesheet for Material Symbols from the demo page.
src/components/Editor/EditorPanel/EditorPanel.jsx Removes the material-symbols side-effect import.
src/assets/stylesheets/ExternalStyles.scss Stops importing the Material Symbols sharp SCSS.
src/assets/stylesheets/index.scss Overrides the alert error icon via --rpf-alert-error-icon on #wc.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@maxelkins
Copy link
Contributor

I think ideally we'd use the icon, since it just keeps the design of that component consistent with other places we use it. But its hard to argue shipping the font file for that 1 icon, so I understand the choice to remove it 👍

Maybe we just display: none .rpf-alert__icon so it looks like:
Screenshot 2026-02-18 at 16 27 04

I've confirmed this is the only use of a material symbol. The only other item in the design library that we are using is Button and we never pass it a icon name in the icon prop. We also have no class references to 'material-symbols' anywhere.

Hide the symbol rather than showing it.
Material symbols was taking up 80% of our bundle size all so that we could use an alert symbol in one place.

Not loading material symbols will make the code editor load faster and perform better in slower devices.

It might be useful to use symbols in the future, especially since other components in the design library use material symbols. Then we have a few options:
+ Instead of using material symbols, use our own icons
+ Include just the material symbol font we're using from the material-symbols package
+ Require the host page to load the material symbols font. The web component would just need to define styles on '.material-symbols-sharp' as the material-symbols library does.
@zetter-rpf
Copy link
Contributor Author

I think ideally we'd use the icon, since it just keeps the design of that component consistent with other places we use it. But its hard to argue shipping the font file for that 1 icon, so I understand the choice to remove it 👍

Maybe we just display: none .rpf-alert__icon so it looks like: Screenshot 2026-02-18 at 16 27 04

No prob, I've removed the icon as you suggested.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/assets/stylesheets/EditorPanel.scss:64

  • There are two trailing blank lines here, but other SCSS files in the codebase (like ExternalStyles.scss and EditorInput.scss) end with only one blank line. Consider removing one of these blank lines to maintain consistency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/assets/stylesheets/EditorPanel.scss:65

  • There are extra blank lines at the end of the file. Consider removing the trailing blank lines (lines 64-65) to maintain consistency with the rest of the codebase.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants