Description
Currently there is not a consistent approach to icon sizing in MF/Minerva. There are generally three icon sizes (small, medium, and large) however the CSS that sizes individual icons is rather inconsistent. There is also inconsistency around the touch areas for icons. This problem became evident as we introduced several new icons into the interface as part of the AMC work. Our plan is to refactor the icon sizing, standardized around the following sizes:
small | medium | larger than medium | |
icon area | 16x16px | 20x20px | (no standard) |
touch area | 34x34px | 44x44px | (no standard) |
example | see T231683 | ||
This problem is made worse by the fact that the SVGs themselves are not sized consistently. Some are on 24x24px canvases, others are on 20x20px canvases, with varying degrees of padding within the SVGs themselves (not CSS padding/margins). The work related to replacing icons with properly sized ones will be tracked in T231613.
This is an incomplete reference to help clarify which icons should be sized small vs. medium:
Example of current issue
- Icons in the site header and page-actions toolbar are larger than icons in the menus.
- Various icons, such as "talk" and "special pages", are being rendered larger than intended.
Developer notes
There seem to be two main causes of this issue:
- The svgs themselves are not sized consistently. Some are on 24x24px canvases, others are on 20x20px canvases, with varying degrees of padding within the SVGs themselves (not CSS padding/margins)
- The background-size: 100% auto; rule causes the width of the icons to 100%, which makes them appear larger if the SVG has a width smaller than 20px. See gif below.
QA
Run an exploratory test on https://en.m.wikipedia.beta.wmflabs.org/wiki/Spain - if any content is missing or looks different to production and the UI element involves an icon flag it.
Some examples we have found so far: T232800, T232792, T232798
Sign off steps
- Make sure all subtasks are resolved.
QA Results
AC | Status | Details |
---|---|---|
1 | ✅ | T229440#5499327 |
2 | ❓ | T229440#5499327 |
3 | ❓ | T229440#5499327 |
4 | ✅ | T229440#5499327 |
5 | ✅ | T229440#5499327 |
6 | ✅ | T229440#5499327 |
7 | ❓ | T229440#5499327 |
8 | ❌ | T229440#5499327 |
9 | ❓ | T229440#5499327 |
10 | ❓ | T229440#5499327 |
11 | ✅ | T229440#5499327 |
12 | ❌ | T229440#5499327 |
13 | ✅ | T229440#5499327 |