Monday, April 27, 2020
1 change · master
Enhancements to existing features
Odoo has been migrated from Font Awesome 4 to Font Awesome 5, modernizing the icon library used throughout the product. This improves visual consistency and keeps the interface aligned with a newer, supported icon standard across many screens and modules.
Original PR description
Font-awesome v4 have been supplanted by a v5 in September 2017, it is about time we migrate our source code to support that new version. The two version major difference is about icon identification.…
Font-awesome v4 have been supplanted by a v5 in September 2017, it is about time we migrate our source code to support that new version.
The two version major difference is about icon identification. In FA v4 the icon name only is enough, every icon name had its own character like 'fa-clock' is the only solid clock font, 'fa-clock-o' is the only edge clock font. In FA v5, every icons can come with up to 5 (in the pro version) different styles for a same icon name. In FA v5, an icon identifier is the pair icon style and icon name. The solid clock icon is `fas fa-clock` and the edge clock icon is `far fa-clock`.
The entire codebase has been migrated thanks to an automatic script you can download at https://gist.github.com/Julien00859/7992bb19dd5b801d91f1e2baa1f4cc98 . While the script is fast, detect most fonts and correctly translate most of them, there are a few patterns it does not detect or cannot automatically translate.
Among others, here are a few patterns that need to be manually translated :
* CSS rules, e.g. `.fa-star-o { color: gold; }`.
* Javascript tests, e.g. `testUtils.dom.click('.fa-start-o');`.
* Code-controlled icons, e.g. `$('i.fa').toggleClass('fa-star').toggleClass('fa-start-o');`.
* Dynamic icon injection, e.g. `<i t-att-class="'fa ' + (stared ? 'fa-star' : 'fa-star-o')">`.
Task: 2050241