Re: List-style-type Proposal for the Disclosure Triangle of <details>

On Thu, Apr 7, 2011 at 7:53 AM, Lachlan Hunt <lachlan.hunt@lachy.id.au> wrote:
> Hi,
>  For the new HTML <details> and <summary> elements, we are making use of the
> display: list-item and associated list-style-* properties to achieve the
> desired default rendering.  The rendering requires that a disclosure widget
> be rendered, typically a triangle arrow, and the 'list-style-type' property
> and the ::marker pseudo element suits this use case well.
>
> Full details of our proposal can be found on the whatwg list [1] (Scroll
> down to the section labelled "Proposed Solution").
>
> However, list-style currently lacks a suitable set of glyphs that can be
> used to represent a disclosure triangle, and so we have created our own.
>
> We have introduced '-o-disclosure-open' and '-o-disclosure-closed' values,
> which correspond to a down-pointing arrow, and a right- and left-pointing
> arrows (depending on writing direction), respectively.
>
> We have opted to use these glyphs for this [2].
>
> U+25B8 (▸) BLACK RIGHT-POINTING SMALL TRIANGLE
> U+25C2 (◂) BLACK LEFT-POINTING SMALL TRIANGLE
> U+25BE (▾) BLACK DOWN-POINTING SMALL TRIANGLE
>
> We also think that these glyphs would be suitable for use as general purpose
> list markers too, and so it's worth standardising them as list-style-types.
>
> A demo of how we intend to use these is available [3], illustrated using
> list-style-image with SVG images. (The demo works in Firefox and Opera.
> WebKit won't render the SVG for list-style-image).

The current Editor's Draft of Lists defines a mechanism for authors
(and UAs) to define their own list-styles.  Thus, this could be
defined in the UA stylesheet like so:

@counter-style disclosure-open {
  type: repeating;
  glyphs: "▾";
  suffix: "";
}
/* the two closed markers are similar */

I'm not opposed to adding these to the default UA stylesheet defined
in the Lists spec, though, if other implementors agree that these are
good default glyphs to use for that purpose.

~TJ

Received on Thursday, 7 April 2011 16:06:17 UTC