[wp-trac] [WordPress Trac] #41317: Consistent submenu item spacing when count indicator is present
WordPress Trac
noreply at wordpress.org
Sun Jul 30 17:11:53 UTC 2017
#41317: Consistent submenu item spacing when count indicator is present
-------------------------------------------------+-------------------------
Reporter: pauldechov | Owner: afercia
Type: enhancement | Status: assigned
Priority: normal | Milestone: 4.9
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: good-first-bug has-screenshots has- | Focuses: ui
patch needs-refresh |
-------------------------------------------------+-------------------------
Changes (by afercia):
* keywords: good-first-bug has-screenshots has-patch needs-testing =>
good-first-bug has-screenshots has-patch needs-refresh
Comment:
Seems to me it would be better to consider the real reason why the
counters vertical alignment looks different. I think it's because of the
different `line-height` value of the parent element. The font size and
line-height for the top level items are:
{{{
font-size: 14px;
line-height: 18px;
}}}
while for sub-items are:
{{{
font-size: 13px;
line-height: 1.2; <-- 15.6 pixels
}}}
To double check, I've tried to make the sub items font size and line
height the same as the top level items and then the alignment looks
identical:
[[Image(https://cldup.com/XjP44KooEC.png)]]
Of course, it's not possible to change the font-size but it is possible to
change the line-height and then compensate the total item height adjusting
the padding. While the [https://make.wordpress.org/core/handbook/best-
practices/coding-standards/css/#values WordPress CSS coding standards]
recommend to use unit-less values for line-height, they also say "unless
necessary to be defined as a specific pixel value". I'd probably try to
set the same value in pixels for the top level items and sub items, then
adjust as necessary.
To improve the "roundness" of the counters, I'd suggest to have a look at
the red comment counts in the posts list.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41317#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list