Re: [css-lists] feedback

On Wed, May 13, 2015 at 1:41 AM, Philippe Verdy <verdy_p@wanadoo.fr> wrote:
> The suggested default stylesheet for defining the padding gutter needed to
> display ordered or unnumbered list is currently this:
>
> ol:dir(ltr), ul:dir(ltr) {
>     padding-left: 40px;
>   }
> ol:dir(rtl), ul:dir(rtl) {
>     padding-right: 40px;
> }
>
> This is really bad as it uses a static size that does not work with all font
> sizes (this value is only valid if the document's default font size is about
> 13 pixels, producing a correct "3em" padding. But it will break immediately
> when numbered lists are displayed with much larger fonts (this padding will
> be insufficient, the marker will be partly truncated (on the left-side if
> the resolved direction of the ul or ol element is LTR) or not displayed at
> all, even if its size (for example a bullet) is a standard character
> inheriting the current font size of <ul> and <ol> lists.

I agree that it's bad, but it matches what browsers actually do.  This
has been stable for such a long time that changing it would almost
certainly break pages.

> Why not definining these default padding values to "3em" ? (letting authors
> increasing it if they need markers not reduced to a single static character
> such as a bullet, for example in numbered lists where "3em" could be
> insufficient to display "123." in a long numbered list).

If we were to change it, we would make it 2.5em, as the common default
text size is 16px, and 2.5*16=40.


> Also is there a way to have this padding computed according to the maximum
> display width of all markers in the same list (the most direct ul or ol
> parent element containing the list item for which markers will be
> displayed), plus the marker relative position from the list-item border box,
> plus an additional offset?

There is not.  What use-case are you envisioning this for?  I imagine
it might be a little weird to have the indent vary shrink when there's
less content in the list.

~TJ

Received on Friday, 15 May 2015 19:55:21 UTC