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

Optimize the extension SVG icon #357

Open
joaopalmeiro opened this issue Aug 16, 2024 · 0 comments
Open

Optimize the extension SVG icon #357

joaopalmeiro opened this issue Aug 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@joaopalmeiro
Copy link

joaopalmeiro commented Aug 16, 2024

Hi! 👋

Is your feature request related to a problem? Please describe.

As a follow-up to a PR recently opened in the JupyterLab repo, I would like to propose optimizing the main SVG icon of this extension.

Currently, the icon has some attributes (e.g., preserveAspectRatio="xMidYMid meet") that can be removed and running SVGO, the tool of choice for optimizing SVG files and reducing their size, leads to a size reduction (0.671 KiB - 10.2% = 0.603 KiB).

Also, if I'm correct, the comment about Font Awesome licensing is missing.

Describe the solution you'd like

The icon for this extension should be as small as possible. To achieve this, I propose the following steps:

  1. Re-downloading the superpowers icon from the Font Awesome website.
  2. Adjust it to the desired squared size using, for example, Figma.
  3. Add the relevant JupyterLab class (jp-icon3) and license comment.
  4. Run SVGO with the configuration proposed in the PR in the JupyterLab repo.

Therefore, and including the Font Awesome license comment, it is possible to achieve an icon with an approximate size of 0.582 KiB, a size smaller than the current one (0.619 KiB). The optimized and licensed SVG icon looks like this:

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path fill="#626262" d="M24 0 10.607 1.768c-4.928.67-8.748 4.645-9.053 9.643A10.23 10.23 0 0 0 4.65 19.35L0 24l13.382-1.768c4.918-.67 8.748-4.65 9.038-9.632.187-2.973-.965-5.866-3.091-7.94zm-4.27 12.445c-.225 4.259-3.964 7.457-8.185 7.205-4.26-.252-7.538-3.804-7.302-8.09.24-4.242 3.98-7.462 8.196-7.205 4.249.252 7.527 3.804 7.291 8.09" class="jp-icon3"/></svg>

Describe alternatives you've considered

Additional context

  • Operating System and version: macOS Sonoma 14.5
  • Browser and version: Chrome 127.0.6533.89
  • JupyterLab version: 4.3.0a2
  • Python version: 3.10.13
  • JupyterLab Code Formatter version: 3.0.2

Let me know what you think and if I can open a PR. Thanks!

@joaopalmeiro joaopalmeiro added the enhancement New feature or request label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant