Patch #23980

Replace images with icon fonts

Added by Marius BALTEANU about 3 years ago. Updated 19 days ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:UI
Target version:4.1.0

Description

Icon fonts have some advantages over the classical images:
- being vector graphics, they are scalable an can be resized without losing quality.
- can be customized directly from CSS (size, colour, etc)
- less HTTP requests to server because they are loaded only with one or a few requests. Now, Redmine make a request for each image.
- some of the current custom themes already use icon fonts (Abacus theme, Minelab, PurpleMine2, our custom theme and I think the theme from plan.io).

We're interested to contribute with a patch that implements the FontAwesome icons, but because there are at least two ways to implement them, we want some feedback before from Redmine contributors and/or users.

1. Using i tags:

Advantages:
  • Is the recommended way on their official page
  • We can use all the build-in rules available in the FontAwesome CSS.
Disadvantages:
  • it'll be required to add the i elements in views.

2. Only from css

Advantages:
  • the views will not be modified
Disadvantages:
  • The build-in rules must be reimplemented in the current CSS
  • The icons will be defined using their unicode. For example, the fa-pencil icon (similar with the current images for icon-edit) has the unicode f040.

Only for demo purposes, I've attached a patch that replaces the icons from issue page with font awesome icons (using i tags).

font_awesome_icons.patch Magnifier (15.3 KB) Marius BALTEANU, 2016-10-04 02:06

font_awesome.png (263 KB) Marius BALTEANU, 2016-10-04 02:19

use_font_awesome_icons_for_all_elements_that_use_icon_class.patch Magnifier (399 KB) Marius BALTEANU, 2016-10-09 12:11

replace_images_with_fa_icons.patch Magnifier (15 KB) Marius BALTEANU, 2016-11-29 01:33

font-mfizz.zip (243 KB) Marius BALTEANU, 2016-11-29 02:05

fonts_folder.png (92.8 KB) Marius BALTEANU, 2016-11-29 02:06

admin_fa.png (142 KB) Marius BALTEANU, 2016-11-29 02:09

issue_fa.png (236 KB) Marius BALTEANU, 2016-11-29 02:09

activity_fa.png (293 KB) Marius BALTEANU, 2016-11-29 02:09

overview_fa.png (191 KB) Marius BALTEANU, 2016-11-29 02:10

projects_fa.png (124 KB) Marius BALTEANU, 2016-11-29 02:10

issues_fa.png (319 KB) Marius BALTEANU, 2016-11-29 02:10

repository_fa.png (324 KB) Marius BALTEANU, 2016-11-29 02:10

roadmap_fa.png (211 KB) Marius BALTEANU, 2016-11-29 02:10

replace_images_with_fa_icons_v2.patch Magnifier (15.6 KB) Marius BALTEANU, 2016-11-29 02:40

gitlab.png (50.4 KB) Marius BALTEANU, 2019-05-20 08:46

before.png (50.5 KB) Marius BALTEANU, 2019-09-25 21:45

after.png (43.6 KB) Marius BALTEANU, 2019-09-25 21:45


Related issues

Related to Redmine - Feature #5830: Replace famfamfam icons with the fugue set New 2010-07-07
Related to Redmine - Feature #11757: Add support for HDPI screens (retina) New
Related to Redmine - Feature #30229: Optimization: all UI icons collapsed into a single sprite Closed

History

#1 Updated by Marius BALTEANU about 3 years ago

Marius BALTEANU wrote:

2. Only from css

Advantages:
  • the views will not be modified
Disadvantages:
  • The build-in rules must be reimplemented in the current CSS
  • The icons will be defined using their unicode. For example, the fa-pencil icon (similar with the current images for icon-edit) has the unicode f040.

The "disadvantages" word should be after the first advantage. Like is in this comment.

#2 Updated by Marius BALTEANU about 3 years ago

Attached a screenshot also.

#3 Updated by Jan from Planio www.plan.io about 3 years ago

Hi Marius, thanks for proposing this. I think replacing the current icon set with an icon font is a great idea. As you noticed, we're using Font Awesome for the new Planio design.

Marius BALTEANU wrote:

because there are at least two ways to implement them, we want some feedback

Before implementing our new design, we were discussing this intensively. We decided against using <i> tags and in favour of adding new CSS rules, for the following reasons:

  • Changing all icons in Redmine to <i> tags would be a very large patch touching almost all views in Redmine (as you probably already noticed while preparing your demo patch).
  • Using <i> tags would require all plugin developers to change plugins as well and there would be a (potentially long) period where plugins would still use the "old" icons while Redmine is already usig "new" icons making the overall user experience inconsistent.

Implementing new CSS rules for all icons using Font Awesome, however, would be less of a change to existing Redmine code (we would be able to leave views alone) and would apply to all existing plugins using standard Redmine icons (like edit, delete, etc.) at once, so plugin developers would have few things to change or nothing at all.

To respond to the disadvantages mentioned:

The build-in rules must be reimplemented in the current CSS

I actually see this as an advantage: implementing Icon style can be encapsulated in a defined place within the CSS and does not happen all over the place.

The icons will be defined using their unicode. For example, the fa-pencil icon (similar with the current images for icon-edit) has the unicode f040.

From our experience in working with Font Awesome in our new UI, it isn't much of a problem. The icons can be looked up easily via http://fontawesome.io/icons/ and we could use CSS comments to note the Font Awesome icon names next to the unicodes.

One sidenote: At Planio, we're using Rails' Asset Pipeline with Redmine and are thus using SCSS and the fontawesome-rails gem which is a tremendous help.

#4 Updated by Marius BALTEANU about 3 years ago

Jan from Planio www.plan.io wrote:

Hi Marius, thanks for proposing this. I think replacing the current icon set with an icon font is a great idea. As you noticed, we're using Font Awesome for the new Planio design.

Marius BALTEANU wrote:

because there are at least two ways to implement them, we want some feedback

Before implementing our new design, we were discussing this intensively. We decided against using <i> tags and in favour of adding new CSS rules, for the following reasons:

  • Changing all icons in Redmine to <i> tags would be a very large patch touching almost all views in Redmine (as you probably already noticed while preparing your demo patch).
  • Using <i> tags would require all plugin developers to change plugins as well and there would be a (potentially long) period where plugins would still use the "old" icons while Redmine is already usig "new" icons making the overall user experience inconsistent.

Implementing new CSS rules for all icons using Font Awesome, however, would be less of a change to existing Redmine code (we would be able to leave views alone) and would apply to all existing plugins using standard Redmine icons (like edit, delete, etc.) at once, so plugin developers would have few things to change or nothing at all.

To respond to the disadvantages mentioned:

The build-in rules must be reimplemented in the current CSS

I actually see this as an advantage: implementing Icon style can be encapsulated in a defined place within the CSS and does not happen all over the place.

The icons will be defined using their unicode. For example, the fa-pencil icon (similar with the current images for icon-edit) has the unicode f040.

From our experience in working with Font Awesome in our new UI, it isn't much of a problem. The icons can be looked up easily via http://fontawesome.io/icons/ and we could use CSS comments to note the Font Awesome icon names next to the unicodes.

Totally agree with you, I'll try to create a patch using only CSS.

One sidenote: At Planio, we're using Rails' Asset Pipeline with Redmine and are thus using SCSS and the fontawesome-rails gem which is a tremendous help.

I know that were some discussions about the Rails' Asset Pipeline (I can't find the ticket now) and enabling this feature is not an option because will add some complexity. If I'm wrong, I'll be very happy to use that gem.

Thanks for your feedback.

#5 Updated by Marius BALTEANU about 3 years ago

I've attached a first patch which:
  • adds the Font Awesome fonts
  • replaces the images icons with font awesome icons for all elements that have icon and icon-* classes

Some observations:

1. Currently, there are some specific programming images for file types like text-x-php, text-x-c, text-x-java and so on. Because FontAwesome doesn't have these types of icons, I see 3 ways to solve this problem:
1.1 use the current images
1.2 use the generic file code icon provided by FontAwesome for all of these files.
1.3 add Font-Mfizz which is an extension of FontAwesome icons and provides the required icons.

IMHO, I prefer the second solution because:
  • it doesn't add new fonts
  • it doesn't require to keep the rules related to background images in icon class
  • it doesn't require maintenance when a new type of files appears (in this patch I've added a new class named "application-javascript" in order to recognize the javascript files)

2. I'll add separate patches that replaces the current images with FontAwesome icons in other pages like: administration, project overview, etc..
3. In the last patch, I'll remove the unused images.

Any feedback is appreciated.

#6 Updated by Alexander Meindl about 3 years ago

I would prefer the Font-Mfizz solution. It does not require much more server load using it (there are a lot less server requests compared to the background image solution). Main reason for this solutions is, that the usability and the user acceptance would be higher. A lot of technical teams are working with Redmine and SCM, and these people will be certainly happy to see file type specific icons.

#7 Updated by Toshi MARUYAMA almost 3 years ago

  • Description updated (diff)

#8 Updated by Marius BALTEANU almost 3 years ago

We discussed internally in Zitec and we are going to implement the solution with Font-Mfizz but for the moment we are waiting for some feedback on issue #24313 because having that ticket commited, it will be much easier for us to implement this one.

#9 Updated by Go MAEDA almost 3 years ago

  • Related to Feature #5830: Replace famfamfam icons with the fugue set added

#10 Updated by Go MAEDA almost 3 years ago

  • Target version set to Candidate for next major release

#24313 has been implemented.
I am looking forward to seeing this feature in 3.4.0. Setting target version to "Candidate for next major release".

#11 Updated by Marius BALTEANU almost 3 years ago

Go MAEDA wrote:

#24313 has been implemented.
I am looking forward to seeing this feature in 3.4.0. Setting target version to "Candidate for next major release".

The patch that replaces the images with fa icons is ready, but I want to take some feedback from our users regarding the icons color. Now all the icons have the same color (# 169). Please let me know if you want to test it as it is now.

#12 Updated by Marius BALTEANU almost 3 years ago

The attached patch (replace_images_with_fa_icons.patch) replaces the images for all regular icons (that have the classes "icon icon-*") with font-awesome icons.

Because the git binary diffs are not supported by the patch command, I wasn't able to add the required fonts as patches, but I've documented bellow the necessary steps:
1. Create a folder fonts in the public directory from redmine.
2. Unzip the attached font-mfizz.zip in the new fonts folder.
3. Because the font-awesome archive is bigger than the maximum allowed size for attachments (600kb), the zip can be downloaded from here. If the official link is preferred, the fonts must be extracted from the archive (folder fonts) to a folder named font-awesome in the same folder fonts from public directory.

At the end, the fonts folder from public should have 2 directories:
  • font-awesome
  • font-mfizz

There are still some elements that are using images (like classes expander, asc, desc), but I think that is safer to replace them with FA icons in another ticket (requires more changes). Also, I think the images should be removed in a later major release (for plugins compatibility).

Any feedback on the chosen icons is welcome.

#13 Updated by Marius BALTEANU almost 3 years ago

Some screenshots.

#14 Updated by Marius BALTEANU almost 3 years ago

Updated to include a fix for the responsive mode (the left padding is no more required).

#15 Updated by Marius BALTEANU almost 3 years ago

Any feedback on this patch? FTR, I tried to create a single patch with all the changes with Subversion too but it didn't work.

#16 Updated by Go MAEDA almost 3 years ago

  • Assignee set to Jean-Philippe Lang

Screenshots looks nice for me.
Jean-Phillipe, is there any possibility that this patch will be merged?

#17 Updated by Marius BALTEANU over 2 years ago

Jean-Philippe, do you have any feedback on this?

#18 Updated by Go MAEDA over 2 years ago

  • Related to Feature #11757: Add support for HDPI screens (retina) added

#19 Updated by Bernhard Rohloff almost 2 years ago

This patch is a great improvement to Redmine. It extends the variety of icons available to developers of plugins and Redmine itself. It's a pitty that there hasn't been more discussion about this improvement for a year now.

Unfortunately this patch doesn't work anymore.
@Marius BALTEANU is it possible to update this patch to a recent revision of Redmine? I would really love to see this patch applied in 4.0.0 or 4.1.0.

+1 for this!

#20 Updated by Marius BALTEANU almost 2 years ago

Bernhard Rohloff wrote:

@Marius BALTEANU is it possible to update this patch to a recent revision of Redmine? I would really love to see this patch applied in 4.0.0 or 4.1.0.

Sure, I'll try to do it this month (including the update to Font Awesome 5).

#21 Updated by Taiki I almost 2 years ago

GitHub changed from Icon fonts to SVG icons.
Icon fonts is not bad, but I think it will be better if you change to SVG icons.

#22 Updated by Bernhard Rohloff over 1 year ago

Taiki IKEGAME wrote:

GitHub changed from Icon fonts to SVG icons.
Icon fonts is not bad, but I think it will be better if you change to SVG icons.

This also sounds very interesting to me and seems to be more versatile than icon fonts. It could be nice to load custom icons in a plugin and use them with the same helper method as the core icons. Or just to install a custom icon pack as a plugin. Just a few thoughts. I'm not so well informed about this topic right now. So are there some other opinions about preferring SVG icons over icon fonts?

#23 Updated by Taiki I over 1 year ago

Fontawesome 5 recommends JS with SVG.
Sorry for not checking well.

#24 Updated by Anonymous 10 months ago

Yey! This asap pls!
+1

#25 Updated by Marius BALTEANU 10 months ago

  • Related to Feature #30229: Optimization: all UI icons collapsed into a single sprite added

#26 Updated by Marius BALTEANU 10 months ago

Max Johansson wrote:

Yey! This asap pls!
+1

Max, I'll be very happy to update my patch if Jean-Philippe agrees to replace the current icons with FA icons.

#27 Updated by Anonymous 10 months ago

Marius,
Jean-Philippe, could you please let us know your opinion about this?

#28 Updated by Anonymous 8 months ago

Marius, maybe it will be easier to update the patch and sneak-commit it with help of Go? Then we could cross fingers and hope that Jean-Philippe might not notice it :D

#29 Updated by Go MAEDA 8 months ago

Max Johansson wrote:

Marius, maybe it will be easier to update the patch and sneak-commit it with help of Go?

I will not commit such a big change without Jean-Philippe's consent. I never forget that he is the owner of this software and we can use Redmine thanks to him and his many years of efforts.

#30 Updated by Jan from Planio www.plan.io 8 months ago

Go MAEDA wrote:

I will not commit such a big change without Jean-Philippe's consent. I never forget that he is the owner of this software and we can use Redmine thanks to him and his many years of efforts.

Absolutely agree!

#31 Updated by Bernhard Rohloff 8 months ago

Basically I agree with Go and Jan. It's not an option to make decisions behind JP's back. As much as I share this opinion I can understand Max's intention. This issue is nearly three years old and no decisions are made. So has anybody a better idea on how to get at least a yes, no, maybe from Redmine's kahuna?

#32 Updated by Anonymous 8 months ago

So has anybody a better idea on how to get at least a yes, no, maybe from Redmine's kahuna?

I guess the only way I could come up with is to bump this ticket with a message mentioning JPL and urgent to be visible in the activity log of Redmine.org next time a commit streak from JPL will occur. And it can be detected with help of #redmine-commits channel on our Discord, but if RSS tracker bot will not logout again (Discord been having problems with bots logging out lately, but they are working on fixing it afaik) and there will be anyone available or online to bump this message in that perfect moment :)

#33 Updated by Anonymous 8 months ago

Bump! Jean-Philippe, this ticket is ultra-urgent to many, please share your consent.

#34 Updated by Marius BALTEANU 8 months ago

Max Johansson wrote:

Bump! Jean-Philippe, this ticket is ultra-urgent to many, please share your consent.

Max, let be honest, it is not so ultra-urgent, it is just a nice UI improvement for the core and for the theme developers. I'll update my patch to Font Awesome 5 and then I'll share my thoughts regarding this feature.

#35 Updated by Marius BALTEANU 8 months ago

But I partially agree, a feedback from Jean-Philippe could be useful to not work in the wrong direction.

#36 Updated by Marius BALTEANU 5 months ago

Here is an updated version of my patch. Because the size of the patch is too big, you need to download it from my gitlab instance (screenshot attached for those who are not familiar with GitLab - gitlab.png).

The patch includes now the latest version of Font Awesome (5.8.2) and replaces the images with font icons only for elements with 'icon icon-*' classes. I'll add very soon another patch for the rest of the elements.

Please test it and let me know what do you think.

#37 Updated by Go MAEDA 5 months ago

Marius BALTEANU wrote:

Here is an updated version of my patch.

Since the page requires authentication, I could not get the patch.

#38 Updated by Marius BALTEANU 5 months ago

Go MAEDA wrote:

Marius BALTEANU wrote:

Here is an updated version of my patch.

Since the page requires authentication, I could not get the patch.

Sorry, I didn't know that the project is private. I made it public now, you should have access.

#39 Updated by Marius BALTEANU 4 months ago

  • Target version changed from Candidate for next major release to 4.1.0

I've have updated my patch to include the latest changes made in #31433 and #31496.

Considering that most of the icons are now replaced with font awesome icons, I'm assigning this to 4.1.0 in order to take a feedback from Jean-Philippe.

There are still some images that can be replaced with FA icons, but we can do it in a later version. I'm really sure that it'll be a great improvement to deliver this for everyone (users, theme developers, plugin developers, 3rd party saas providers like Plan.io).

#40 Updated by Mizuki ISHIKAWA 2 months ago

+1

I hope this feature will be released as soon as possible.
The current icon is hard to see due to its small size and is not kind to the user.

#41 Updated by Marius BALTEANU 19 days ago

Updated the patch and added a new commit to replace the images from JS Toolbar with FA icons.

Toolbar with current images:

Toolbar with FA icons*:

*The icons for Inline code, H1, H2 and H3 are not really icons because FA doesn't have such icons, are just text.

The patches (2 commits) can be found here.

Also available in: Atom PDF