Greeting from #rdcHQ! In our Codes of the World Track we are experimenting with CSS styles to replicate the rules for citation used in legal materials such as court cases and journal articles as specified in The Bluebook: A Uniform System of Citation. The Bluebook is required by courts and law schools in the United States, and is considered an “edict of government,” a mandatory set of rules required to be followed by organizations such as the U.S. District Courts. It is an interesting exercise to code the diagrams so they render the same in every browser. In order to understand how this is achieved requires a closer look at the code.
Below shows one case citation. The citation below depicts a wealth of information such as parties, the deciding court, the Federal Reporter volume number, the pages referred to, date of decision, as well as parenthetical remarks about the decision. Each fragment of the citation is annotated, and since these notes are HTML and CSS-based they can be easily linked to additional materials for context.
We’re serving up our snippets at the insanely cool
CodePen … Check it out!
Under The Hood: HTML + CSS
Creating detailed notes such as this requires relative positioning of elements within a container <div> and finessing the “display” attribute on the <spans> enclosing the annotations. The combination of these two attributes ensure that the annotations align properly with the corresponding sentence fragments. The code can be viewed and edited at CodePen to get an idea how all of this interrelates.
Note that in order to get the annotations in the top row to align, they must be placed in the order they appear before the corresponding sentence fragment(s). The stem of the note can then be positioned precisely using the “background-position” attribute. The annotations in the bottom row must be placed in context in order to render properly cross-browser. Although it is possible to nest each annotation within a containing span in order for it to remain connected to its corresponding sentence fragment, this author could only get this to work as designed* in Firefox 18.0.2/Mac. We hope that as CSS(n) advances, simple inline annotations (without the aid of JavaScript and fancy frameworks) will be possible.
Footnote: SCSS / SASS / Canvas ++
As the astute coder can see, we were unable to solve this puzzle without the fancy CSS-positioning footwork mentioned above and the use of graphics, most notably the short hash tag that forms the enclosing brackets on the annotations. This was due to the fact that it is not possible to define the length of a border along any side of a <span> or <div> – the border must be the full length of the <span> or have no border at all. This is the kind of control designers need in a markup language.
Fortunately, frameworks like Compass are making control like this possible. Here is a similar diagram of a hyperlink coded within the Compass framework environment at Codepen (although it is much less dense in terms of information than the citation).
The code is elegant and delightfully concise … however, the caveat here is that the framework must be installed on the server that the document resides on (or on the local computer that the document is downloaded to) or the code will not render at all. This is definitely outside of the scope of the Codes of the World criteria that our final art is open and accessible. Hopefully a framework such as this will become part of the overall W3C spec to make the web more typographically beautiful for all!
We’re solving tomorrow’s problems today at #rdcHQ!