This came up recently where an element with font-size: 0 is throwing a color-contrast violation when the text is not visible. Normally an element with font-size: 0 would have a width and height of 0 (which would be ignored), but explicitly setting the width and height of the element overrides that while still visually hidding the font.
<ol>
<li>Visible text</li>
<li style="font-size: 0; width: 16px; height: 16px; background: red; color: #282828;">Not visible</li>
</ol>