Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use inline SVG for Baseline icons #22

Merged
merged 3 commits into from
Nov 15, 2024

Conversation

pepelsbey
Copy link
Contributor

@pepelsbey pepelsbey commented Sep 19, 2024

  • SVG paths are duplicated in the current implementation, although only fill colors differ.
  • It’s hard to maintain icons when they’re inlined in CSS as data:image/svg+xml.
  Build summary for baseline-status.min.js - es
  ┌────────────────────────┬──────────┐
  │ File name              │ Size     │
  │ ---------------------- │ -------- │
  │ baseline-status.min.js │ 63.12 kB │
  │ ---------------------- │ -------- │
- │ Totals                 │ 65.61 kB │
+ │ Totals                 │ 63.12 kB │
  └────────────────────────┴──────────┘

This approach saves 2.49 kB in the resulting bundle.

baseline-icon.js Outdated Show resolved Hide resolved
delucis added a commit to delucis/astro-embed that referenced this pull request Oct 25, 2024
Copy link

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Seems good to me! (Although noting I’m not at all involved here, just found this PR helpful while implementing a zero-JS version of this component for Astro projects.)

@pepelsbey
Copy link
Contributor Author

@devnook is there anything I can do to make it worth merging?

@devnook
Copy link
Collaborator

devnook commented Nov 15, 2024

Hi @pepelsbey Apologies for the delay

@devnook devnook merged commit 1d14849 into web-platform-dx:main Nov 15, 2024
@pepelsbey pepelsbey deleted the reuse-baseline-icons branch November 15, 2024 18:14
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.

4 participants