Re: [css3-lists] Published as WD!

On Jun 5, 2011, at 8:03 PM, fantasai wrote:

>> But here, with a positioning scheme, we can jettison the whole concept
>> of "candidates".  It's just positioning.  If you position multiple
>> things in the same place, well, it's your fault for doing so, and
>> they'll overlap.
>> 
>> This would just be a positioning scheme for elements, completely
>> disconnected from the normal list marker.  It would typically be
>> paired with "list-style-type: none;" to suppress the display of the
>> ::marker.  If you don't suppress the ::marker, it'll show up and be
>> positioned there as well, following normal overlap rules for abspos
>> elements.
>> 
>> This way, there's no confusion.  You have markers, and you have normal
>> elements.  You can just make the normal elements piggyback on the
>> marker positioning scheme if you want.
> 
> This makes sense to me. That it forces authors to style the marker-positioned
> element and not ::marker is a feature, not a bug: it ensures that if the
> marker-positioning doesn't take effect, you still get the correct-est styling
> possible.

That is also ensured if the 'content' property pulls in the marker content instead of having it pushed in via the 'position' property, because then only the ::marker rule will style it if it is a marker; nothing else will. So for if the marker rule doesn't take effect on a particular element, it can still be styled in the traditional way with styling that would be most appropriate. In fact, if fallback is your concern (or even accidentally selecting too many elements to be the marker), then having 'content' pull in the content of the marker is even better, because it allows you to have your choice of any position value you want when the ::marker rule doesn't take effect.

Consider the following, in which I want to control 'position' in the marker and in the fallback:

ul { margin-left:0; }
li { margin-left: 8em; position:relative; list-style-type:none; }
li b:first-of-type { position:absolute; left: -8em; width:8em;  color:red; }
li b:first-of-type i { position: absolute; left:100%; }

li::marker { content: descendant-select-first("b") ": " ; position: relative;  width:5em; color:green; }
li::marker i { position: absolute; left:100%; }

<ul>
	<li><b>1002.1984<i>.36</i></b> Thusly, heretofore, in recompense, bla bla bla...

The above markup would let me have the bold item in (about?) the same place as it would be as with ::marker, for fallback in earlier UAs. It also lets me have all the italic elements align with each other, while the text to the left of them can wrap if necessary (assume wrapping at the decimal). 

If ::marker content property works, then all the marker text is green; otherwise it is red.

I don't think that sort of thing is possible using 'position:marker', without more extensive workarounds.

Received on Monday, 6 June 2011 15:58:44 UTC