[WIP] SVG Icons#441
Conversation
|
@brianteeman what browser are you using here? |
|
Chrome on Windows PS are you sure this works in IE? |
|
IE is very picky on svgs but there is a way to have the same icons rendered without too much hustle. But before we get to that point there are couple things that needs to be resolved first:
@mbabker @wilsonge can you point me to the right direction for the first 2 issues? |
|
@brianteeman oh by the way I figured out why you're not getting the icons, your instance is in a subdirectory... |
|
@dgrammatiko life would be so much easier if we mandated Joomla can only run at root of |
|
Or if @dgrammatiko developed in a sub directory because he always makes the same mistake |
|
and would it not be better to use the svg sprites instead of individual svg? |
|
Sprites packaged by font awesome will get us back to where we were with the font. The idea here is:
|
|
Not going to ask what is wrong with being coupled to the font Not sure if we can repackage the fonts under the licence - you would need to check that |
|
@brianteeman as always I have no clue what's the compatibility of licenses but according to their repo the license is |
|
ah - they';ve removed the restriction about bundling and packaging |
|
still no change for me :( |
|
Still no change :( |
| // Generate the file and load the stylesheet link | ||
| foreach ($this->icons as $key => $icon) | ||
| { | ||
| $file = HTMLHelper::image('vendor/font-awesome/' . $icon . '.svg', '', null,true, 1); |
There was a problem hiding this comment.
We made something similar in DPCalendar for J3. While doing that, an idea popped up, to first search in the template for an svg and then in vendor. Like that a template can override the core icons.
There was a problem hiding this comment.
exactly what is happening here as well thanks to the magic of HTMLHelper::image
| if ($file) { | ||
| $matches = []; | ||
| preg_match('$(\/media.+)$', $file, $matches); | ||
| $files[] = @file_get_contents(JPATH_ROOT . $matches[1]); |
There was a problem hiding this comment.
Indeed it does. Nice one.
If you want, you can do this as an oneliner $files[] = file_get_contents(JPATH_ROOT . substr($file, strpos($file, '/media')));
Added the same technique now in DPCalendar.
|
After our 30 minute group skype discussion I'm going to close this. |
|
Discussions outcomes:
|


Pull Request for Issue # .
Summary of Changes
Bye bye font-awesome font, welcome font-awesome svgs
Testing Instructions
Documentation Changes Required