Front End Help

Blurb Design Pattern

A blurb is the small summary box which provides a description of a work, bookmark, collection, user, or series. Blurbs appear on what we call index pages (e.g. the works index for the Alternate Universe tag or the bookmarks index for the user testy).

The Archive’s styles for blurbs are located in the style sheet named 13-group-blurb.css.

Structure

The work blurb is the most used chunk of HTML code in the Archive, so we’ve revised it a lot. It has to contain lots of information and allow different ways of accessing its material. The blurb is flexible, accessible, and has multiple redundancies (says the same thing in different ways).

work blurb in the default Archive style

Since we usually have many blurbs listed together, the index page that holds the blurbs is coded as an HTML list, and each blurb is coded as a list item.

XHTML diagram

  1. landmark heading level 3 "list of works" <h3 class="landmark heading">Listing Works</h3>
  2. list container work index <ul class="work index group">
    1. list item work blurb <li class="work blurb group">
      1. division header module <div class="header module">
        1. heading level 4 title link by user link <h4 class="heading" title="title">
        2. heading level 5 fandom tag link <h5 class="fandoms heading" title="fandom">
        3. unordered list of required tags <ul class="required-tags">
          1. list item with rating symbol<li>...<span class="rating...
          2. list item with warnings symbol<li>...<span class="warnings...
          3. list item with category symbol<li>...<span class="category...
          4. list item with work status symbol<li>...<span class="iswip...
        4. paragraph datetime <p class="datetime">
      2. landmark heading level 6 "tags" <h6 class="landmark heading">Tags</h6>
      3. unordered list of tags <ul class="tags commas">
        1. list item(s) with warnings tags <li class="warnings"><a class="tag"...
        2. list item(s) with relationship tags (if any) <li class="relationships"><a class="tag"...
        3. list item(s) with character tags (if any) <li class="characters"><a class="tag"...
        4. list item(s) with additional tags (if any) <li class="freeforms"><a class="tag"...
      4. landmark heading level 6 "summary" <h6 class="landmark heading">Summary</h6>
      5. blockquote of summary <blockquote class="userstuff summary" title="summary">
      6. landmark heading level 6 "series" <h6 class="landmark heading">Series</h6>
      7. unordered list of series <ul class="series">
        1. list item(s) with series <li>Part <strong>#</strong> of <a...</li>
      8. definition list of stats <dl class="stats" title="stats">
        1. definition list property: value pairs <dt>Words:</dt><dd>151</dd>...
    2. next list item work blurb

HTML

<h3 class="landmark heading">Listing Works</h3>
<ol class="work index group">
  <li class="work blurb group" id="work_1234" role="article">
    <!--title, author, fandom-->
    <div class="header module">

      <h4 class="heading" title="title">
        <a href="...">Work Title</a> by <a href="..." class="login author" rel="author">pseud (username)</a>  
      </h4>

      <h5 class="fandoms heading" title="fandom">
        <a href="..." class="tag">Fandom Tags</a>
  	  </h5>

      <!--required tags-->
  	  <ul class="required-tags">
        <li>
          <a href="..." aria-controls="#modal" class="help symbol question modal" title="Symbols key">
            <span class="rating" title="Rating Name">
              <span class="text">Rating Name</span>
            </span>
          </a>
        </li>
        <li> 
          <a href="..." aria-controls="#modal" class="help symbol question modal" title="Symbols key">
            <span class="warnings" title="Warning Names">
              <span class="text">Warning Names</span>
            </span>
          </a>
        </li>
        <li>
          <a href="..." aria-controls="#modal" class="help symbol question modal" title="Symbols key">
            <span class="category" title="Category Names"><span class="text">Category Names</span></span></a>
        </li>
        <li>
          <a href="..." aria-controls="#modal" class="help symbol question modal" title="Symbols key">
            <span class="iswip" title="Work Status">
              <span class="text">Work Status</span>
            </span>
          </a>
        </li>
      </ul>
  	  
  	  <p class="datetime">30 Sep 2013</p>
    </div>
	  
    <!--warnings again, cast, freeform tags-->
    <h6 class="landmark heading">Tags</h6>
    <ul class="tags commas">
  	  <li class='warnings'>
  	    <strong>
  	      <a href="..." class="tag">Warning Tag</a>
  	    </strong>
  	  </li>
  	  <li class='relationships'>
  	    <a href="..." class="tag">Relationship Tag</a>
  	  </li> 
  	  <li class='characters'>
  	    <a href="..." class="tag">Character Tag</a>
  	  </li>
  	  <li class='freeforms'>
  	    <a href="..." class="tag">Additional Tag</a>
  	  </li>
    </ul>

    <!--summary-->	
  	<h6 class="landmark heading">Summary</h6>
  	<blockquote class="userstuff summary" title="summary">
  		<p>This is the summary.</p>
  	</blockquote>
  	
  	<h6 class="landmark heading">Series</h6>
  	<ul class="series">
  	  <li>Part <strong>2</strong> of <a href="...">Series Title</a></li>
  	</ul>

    <!--stats-->
    <dl class="stats" title="stats">
  	  <dt>Words:</dt>
  	  <dd>#</dd>
  	  <dt>Chapters:</dt>
  	  <dd>#/#</dd>
      <dt>Hits:</dt>
      <dd>#</dd>
    </dl>

  </li>
</ol>

Here are some of the important things to understand about this layout:

The structure of blurbs should be changed only with extreme caution! Everything about the display can be reorganized (and in fact the blurb can be skinned pretty easily by our users), but the HTML should not be altered.

Reasons for the structure

This structure means it is easy for a piece of software to accurately count the number of items (blurbs) shown in an index. Each new item —- work, index, page region – is announced by a heading, so users know what information is attached to what title. As a result, a list of headings summarizes the entire index page.

This markup, which counts, groups, and names data, allows both linear and non-linear interactions. This means the page makes sense if you read it top to bottom, makes sense if you read parts of it out of context, and helps you jump around.

For example, a screen reader user may:

  1. enter search query tag: bab5 het long
  2. jump to the Work List landmark heading
  3. hear "list of 17 items"
  4. hear heading level 4 "fic title"
  5. list headings level 4
  6. jump to item 4 and select title link

Without the blurb’s current HTML structure, it’s hard to give alternative access technologies the kind of spatial interaction that a visual, mousing browser affords.

Display

While the HTML structure of the blurb is incredibly important and should not be altered unless the actual content and purpose of the blurb changes, the display, which is governed entirely by CSS, is much more flexible.

Here you see two different examples of the work blurb from the AO3, one using the default CSS and one using a skin, which have some of their fields mapped to the blurb diagram to help give you the idea.

work blurbs

These blurbs use the same HTML. The only thing different is the CSS.

Generic styles

There are many different blurbs in the Archive – the work blurb, the bookmark blurb, the collection blurb, and so on – which are all quite similar in their underlying purpose. Rather than having one set of CSS code for the work blurb, another very similar set for the slightly-different-looking bookmark blurb, and so forth, we have made the generic blurb style rules contain everything that these blurbs have in common (which we have deliberately made a lot!).

The generic blurb style is controlled by the single HTML class blurb. Every blurb in the Archive should use this class. As you saw in the work blurb HTML, a work blurb uses it:

<li class="work blurb group" id="work_1234" role="article">

If you look at a bookmark index, you will see bookmark blurbs use it as well:

<li id="bookmark_5678" class="bookmark blurb group" role="article">.

Let’s examine the first generic blurb rule block from the blurb style sheet:

.blurb ul li, .blurb dd ul li {
  display: inline;
}
.blurb ul li
This is the selector that tells the browser how to identify (select) the HTML elements that the CSS rule should be applied to. This selector says, to translate it into English, any list item (li) that appears inside an unordered list (ul) that appears inside any element that has the CSS class "blurb".
.blurb dd ul li
A second selector (you can have as many as you want in a CSS rule, comma-separated as here) that tells the browser to apply the style to any list item (li) that appears inside an unordered list (ul) that appears inside a definition list description (dd) that appears inside any element that has the CSS class "blurb".
{...}
The declaration block is a semicolon-separated list of property: value pairs that tell the browser how to style the selected elements.
display: inline;
This is the declaration. It is a property: value pair that, in this case, says to display these selected HTML elements inline (that is, following one another on the same line) instead of one after another each on a new line (which would otherwise be the default behavior for list items).

Can you tell which parts of the work blurb this rule affects? What about the parts of the bookmark blurb?

Specific styles

Notice that the class declaration of our blurbs also includes a class that describes the type of blurb: work blurbs have the class work and bookmark blurbs have the class bookmark.

This enables us to modify the basic setup slightly for different classes of blurb using the more specific class name. Normally these modifications are only going to be one or two lines. The most modification is for bookmark blurbs:

.bookmark p.status {
  position: absolute;
  right: 0.25em;
  width: 60px;
  margin-top: 0.429em;
}

.bookmark .status span, .bookmark .status a {
  display: block;
  width: 25px;
  height: 25px;
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0;
}

.bookmark .status a:focus {
  overflow: hidden;
}

.bookmark span.count {
  line-height: 1.875em;
  position: absolute;
  top: 0;
  left: 28px;
  text-align: center;
}

.bookmark .count a {
  border-bottom: none;
  color: #069;
}

.bookmark .count a:hover, .bookmark .count a:focus {
  color: #111;
}

.bookmark .datetime {
	top: 28px;
}

.bookmark .user {
  border: 1px solid #ccc;
  clear: right;
  overflow: hidden;
}

.bookmark .user .meta {
	display: inline;
	font-family: Georgia, serif;
	font-size: 0.875em;
	line-height: 2;
}

/* line break between types of meta */
.bookmark .user ul.meta:after {
	content: '\A';
	white-space: pre;
}

.bookmark .short .header {
	min-height: 30px;
}

.bookmark .user .datetime, .bookmark .work .datetime {
  top: 0;
}

.bookmark .short .status {
	left: 30px;
	margin-top: 0;
	top: 0;
	width: 25px;
}

.bookmark .dynamic {
	position: static;
}

.bookmark .recent .index {
    width: 100%;
}

So what this means is, if we decided to add individual user blogs to the Archive and wanted an index of blogs, we wouldn’t need to code it from scratch. Instead, we could copy the HTML structure used for work blurbs or user blurbs and we would only add a few lines of CSS using something like the .blog .blurb class names combined in order to make the blog blurbs look the way you wanted them to, keeping everything as consistent as possible with the other blurbs.