Re: [css3-lists] Proposal: list item marker from the content of the li element

-------- Original-Nachricht --------
> Datum: Tue, 30 Mar 2010 14:17:29 -0700
> Von: "Tab Atkins Jr." <jackalmage@gmail.com>
>
[...]
> A third option is to adapt some concepts that GCPM uses.  It reuses
> the float property to move footnotes and sidenotes into special areas,
> through the very simple "float: footnote" or "float: sidenote".  We
> could add a new value to this, "float: marker".  In terms of use, this
> is identical to your first idea, it just avoids the abuse of display
> that I dislike.  (I think reusing float is somewhat better, though
> perhaps still not ideal.)
> 
> We'd just have to define exactly how the ::marker's content property
> receives this, then.  Would content:normal allow accepting
> marker-floats?  We'd have make it explicit that a marker-float
> overrides list-style-type, then.  Perhaps a new list-style-type can be
> used as well?  I'm not sure if this is necessary.
> 
> 
> A fourth option is to use another concept from GCPM, that of Named
> Flows.  Ideally, you'd use markup like this:
> 
> ul > li > .marker {
>   float: to(marker);
> }
> 
> ul > li::marker {
>   content: from(marker);
> }
> 
> This has the benefit of being very explicit about how things work.
> However, Named Flows are not defined well enough to know if this sort
> of thing is intended to be possible.  NF seems to be designed for
> endnotes, where there's a single receiving element at the end of the
> document, while this sort of use would have multiple receiving
> elements.

The float property does not look really intuitive to me for this case, but if it provides the possibility to solve the use case at acceptable implementation cost, why not.

My first idea was actually to propose a function for the content property, similar to your last example, but the argument would not be a named float but rather a selector for the element to use as the marker:

li::marker {
  content: from(.marker);
}

I dropped it as I assumed this would introduce circular dependencies, and I also couldn't remember having seen a selector as a function argument in any CSS spec or draft (I haven't read all of them, though).

Anyway, a from() function could also take a keyword rather than a selector. I think of the following keywords:
- first-child
- first-word (anything before the first whitespace)
- first-letter (would not be too useful, but would not hurt either)

That would allow quite easy styling with no extra HTML markup necessary, and no danger of circular dependencies:

ol.legal li::marker {
  content: from(first-word);
}
form ul li::marker, ul.cv li::marker {
  content: from(first-element);
}

Maybe ther is a more appropriate function name than from(), but you see the concept. 
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

Received on Wednesday, 31 March 2010 07:57:15 UTC