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

Font awesome icons : how should we store the collection server side, for an optimal ease of maintenance ? #54

Closed
ghost opened this issue Jul 2, 2018 · 5 comments · Fixed by #58
Assignees
Labels
enhancement New feature or request fixed Needs specifications Specifications missing question Further information is requested

Comments

@ghost
Copy link

ghost commented Jul 2, 2018

The question is : what is the most convenient format to use for the icon list ?
The solution should take into account the ease of initial creation and maintenance of such a list.

In an ideal world, the best solution would be to use a raw css file downloded from fontawesome.com, which would be parsed by a smart php ajax callback to produce a js parsable json sent to the customizer.

@eri-trabiccolo let's discuss that tomorrow.

@ghost ghost added enhancement New feature or request question Further information is requested Needs specifications Specifications missing labels Jul 2, 2018
@ghost ghost assigned eri-trabiccolo Jul 2, 2018
@ghost ghost changed the title Font awesome icons : how should we store the collection for an optimal ease of maintenance ? Font awesome icons : how should we store the collection server side, for an optimal ease of maintenance ? Jul 2, 2018
@ghost
Copy link
Author

ghost commented Jul 2, 2018

@eri-trabiccolo, the icon list is now generated by a specific method ( see a461849 and 77de31e )

@ghost
Copy link
Author

ghost commented Jul 2, 2018

see #55

@eri-trabiccolo
Copy link
Collaborator

Hi Nico,
actually I was thinking about something slightly different;

  1. we should refer to our own font-awesome version not the remote one (our set might be not in sync)
  2. we actually don't need raw css file to parse, icons can be retrieved by svg files (they're basically xml):
    https://raw.githubusercontent.com/presscustomizr/customizr/dev/assets/shared/fonts/fa/webfonts/fa-brands-400.svg
    See glyph-name attribute of the glyph tag

So basically what we should do is:

  1. parse the 3 svg files convert them into json
  2. create the merged icon list A-Z ASC ordered

The whole thing could have been done in js only but since the PHP template (with the caching mechanism) is already there now, we can do 1) (and potentially 2)) in PHP (libxml is usually included in PHP installs - users don't having it won't be able to use the icon module: we really should not care about poor hostings IMHO)
Then we just have to send the whole thing in json, and build the select in JS.

What do you think?

@eri-trabiccolo
Copy link
Collaborator

eri-trabiccolo commented Jul 3, 2018

Do you want me to look for a way to automatically download and put into nimble the whole font-awesome assets too?

[EDIT]
In a skype call we decided to not do this for the moment.

@eri-trabiccolo
Copy link
Collaborator

fixed in #58
the code to generate the file can be found in #57

#58 doesn't include the code above, hence you need to manually run (add) it.

@ghost ghost closed this as completed in #58 Jul 4, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed Needs specifications Specifications missing question Further information is requested
Projects
None yet
1 participant