Learning from CSS: Inheritance, Structure and Bibliographic Formatting

Was just reading this interview with web design guru Eric Meyer:

Russ: For designers and developers who are just getting into web standards, what is the most important aspect of css to get a handle on?

Eric: The #1 most important aspect? I’d have to say the “cascading” part, which encompasses not just the cascade but also inheritance, specificity, and selector construction. Once you get all that down, the rest is visual details.

This document explains why:

Inheritance quickly becomes nothing short of vital for applying style information when you consider the following:

  • It reduces recundancy of author effort and storage space because a rule only needs to be declared once for multiple nodes of a document tree. Beyond this, only exceptions to the inherited styles need to be given to override these rules.
  • When a document’s structure will be ambiguous, as is possible in XML markup languages, inheritance will often be the author’s best tool to control rendering with complex documents.

I don’t know why I didn’t make the connection before (duh!), but I suppose this — CSS-like inheritance — is exactly what I was wanting to do with the BiblioX XML formatting spec.

So, I decided to experiment a bit, using span tags with class attributes, and inheritance-based styling. I’ve posted the result here. It makes use of CSS definitions like this:

    .title { font-style:normal; }
    .container-monograph:before { content: "In "; }
    .part .title:before { content: " “"; }
    .part .title:after { content: "”"; }

Now, the trick is, how to adapt this thinking to the BiblioX DTD.

Comments are closed.


Creative Commons License Creative Commons License