Re: Proposal: list-item-color

From: Bert Bos <Bert.Bos@sophia.inria.fr>
Subject: Re: Proposal: list-item-color
Date: Sat, Sep 29, 2001, 5:36 AM

> Actually, the way CSS2 does it is by using generated text with a 'display'
> of 'marker'. Such a 'marker' will automatically replace the list-item's
> own marker, like so:
>
>     li {display: list-style}  /* This is already default in HTML */
>
>     /* Make an explicit counter for li, instead of the implicit one: */
>     li:before {display: marker; counter-increment: li-no}
>     ul li:before {content: counter(li-no, disc)}
>     ol li:before {content: counter(li-no, decimal)}
>
> This is more powerful than 'list-style-color' (a better name than
> 'list-item-color' I think), but admittedly harder to write.

Yes, I believe the example speaks for itself in this regard.  Not only
harder to write, but harder to read as well.


> ('Display: marker' is not supported by any browser so far, I believe.)

Nor should it be, in our opinion.

The ':before {display:marker}' method (IMHO - hack) for doing list markers
is seriously problematic both for implementers and for authors.

It is poorly designed, and would have never exited "CR" had there been a CR
period when CSS2 went to last call.

I believe that much better solutions are both desired and possible, and, as
co-editor of the CSS3 List Module, I invite proposals (such as
'list-style-color') from the community to arrive at a better solution.

Frankly, the CSS1 list properties were both much easier to implement, and to
understand from an authoring perspective.  CSS2's list model went a bit off
the theoretical deep end as it were.



From: Bjoern Hoehrmann <derhoermi@gmx.net>
Subject: Re: Proposal: list-item-color
Date: Sat, Sep 29, 2001, 12:19 PM

> Why didn't CSS Level 2 say, that list item markers are intended to work
> just like that and one could simply specify
>
>   li::before { color: red }
>
> or whatever to style the marker?

Yes, CSS2 could have said this.

But this demonstrates one of the more serious flaws with using :before for
list-markers, and that is, that it prevents the authoring of content which
itself has :before content and also has a list number or marker.

Essentially, forcing the author to use :before to style the list marker,
robs the author of the ability to independently prefix their list items with
generated content.

A much better alternative would have been to assign a pseudo-element
specifically to the list marker, e.g. :list-marker (or ::list-marker in CSS3
pseudo-element syntax) which could be used to address the list marker and
style it with color (or other properties as well, which would, for example,
remove the need for the 'marker-offset' property).  Every element that had
"display:list-item" would automatically have a :list-marker pseudo-element
generated for it to be styled.  This is just an idea - not a formal
proposal.  It is intended to generate discussion and brainstorming.


Thanks,

Tantek

Received on Saturday, 29 September 2001 18:55:24 UTC