Skip to content

Latest commit

 

History

History
81 lines (67 loc) · 2.57 KB

File metadata and controls

81 lines (67 loc) · 2.57 KB
layout page
title Stats Pattern
parent Design Patterns
nav_order 5
redirect_from
/front_end_coding/patterns/stats

Stats Pattern

{: .no_toc }

Stats are a list of paired properties and values that we use at the end of meta, blurbs, and similar descriptive blocks. They are usually countable values (e.g., Hits: 100) or some kind of binary status (e.g., Status: Complete).

The stats style is declared in 10-types-groups.css.

Table of contents {: .text-delta } * TOC {:toc}

Rules

Stats are always a dl.stats. You can never have any other kind of stats.

Stats always come at the end of meta and work blurbs. Stats may also appear in other contexts.

dl.stats may appear within a dd.stats, but it can't be depended on. Blurbs do not use that structure, but meta does.

Property and value pairs may be given matching class names. Never give a class to the property and not the value (or vice verse).

Quick reference

[...]
always included
{...}
sometimes included
[dl stats]
  [dt][/dt]
  [dd][/dd]
[/dl]

HTML diagram

This diagram is taken from work meta.

  1. <dl class="work meta group">
    1. <dt...
    2. <dd...
    3. <dt class="stats">
    4. <dd class="stats">
      1. <dl class="stats">
        1. <dt class="published">
        2. <dd class="published">
        3. <dt class="words">
        4. <dd class="words">
        5. <dt class="chapters">
        6. <dd class="chapters">
        7. <dt class="comments">
        8. <dd class="comments">
        9. <dt class="kudos">
        10. <dd class="kudos">
        11. <dt class="hits">
        12. <dd class="hits">