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 sync icons from Material to reduce toolbox clutter #1265

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

phoudoin
Copy link

In effort to reduce toolbox cluttering, here a change to use Material Icons font's icons for Sync plugin.

See screenshot:
screenshot-ingress com-2018-05-23-18-53-51

@phoudoin
Copy link
Author

Same can be done for other common plugins like bookmark, drawtools...

@EvoldicA
Copy link

EvoldicA commented Nov 3, 2018

I like the idea of cleaning up the toolbox. This was never merged. Maybe due to the faction biased colour choice? Does anyone think its a good idea to do similar with other things? I could probably take a crack at it.

@phoudoin
Copy link
Author

phoudoin commented Dec 5, 2018

It's not faction biased, it's just reusing the visual common sense to report disabled (gray), error (red), or ok (green) sync status.
Others icons without live status indication, like bookmarks icon, should keep the default toolbox color (yellow).

@johnd0e
Copy link

johnd0e commented Dec 6, 2018

Same can be done for other common plugins like bookmark, drawtools...

Imagine there are 3 plugins with icons. Could we avoid triple including the same stylesheet in the head?

@modos189
Copy link

modos189 commented Dec 6, 2018

I suggest not import heavy third-party Google icons, which slows down the IITC start, but to import only the necessary Google Material icons in svg format, as I started here:
IITC-CE/ingress-intel-total-conversion@59cc312

@johnd0e
Copy link

johnd0e commented Jan 3, 2019

@modos189

Really heavy?

They say that it's only 42KB for 900+ icons.

@phoudoin
Copy link
Author

phoudoin commented Aug 1, 2020

@johnd0e

Imagine there are 3 plugins with icons. Could we avoid triple including the same stylesheet in the head?

First, if it's exactly the same URL, the cached content will be reused, not triple downloaded.
But, agreed, it will be triple evaluated, which is bad.

We can mitigate this by assign an id to check if it's already there:

if ( $( "#material-icons-stylesheet" ).length == 0 ) {
  // add Google Material icons.
  $("head").append(
    '<link id="material-icons-stylesheet" rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">'
  );
}

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