[development] Drupal 5.0 Theme - v2

Gary Feldman dpal_gaf_devel at marsdome.com
Fri Sep 29 22:04:34 UTC 2006

Morbus Iff wrote:
> You simplify it greatly. The intent of CSS is to separate the 
> presentation of a document with its structure. No longer, for ...
> This is (relatively, for a quick example) strong document structure: 
> each div has a meaning, and has been given a CSS class that represents 
> its presentation. From the DOM standpoint, it is easy for us to, say, 
> style just chapter, just the first chapter, just the section of 
> chapter one, or what have you. With XSLT or an XML capable browser, we 
> can query the model to "give us all chapters" or "give us all 
> contents". From a jQuery standpoint, we can do the same thing. This is 
> a strong DOM.
> Rounded corners, when implemented as CSS, traditionally pollute this 
> DOM, in much the same way that all the empty 
> ...
> some presentation to them. They are presentation logic, mucking up my 
> document structure. Much like the empty
Pedantry aside, this remains a religious argument.  Terms like "pollute" 
and "mucking" are subjective, emotional terms that do not directly 
represent anything of objective value.  Taking your example, it is still 
possible to query the DOM to find all chapters or contents.
> And *that* is why I -1 to rounded edges, unless they are applied via 
> jQuery, which does NOT mess with the DOM in a way that negatively 
> affects my document (the modifications are applied by the client 
> software, at user request, NOT hardcoded into the document itself).
And here's the flaw:  It's not your document; it's a transient, internal 

The separation of presentation from content makes perfect sense when the 
HTML is the data.  And that's the way things were in the early days, or 
with tools like FrontPage.  But that's not the case for Drupal, where 
the data model is the SQL, and the presentation layer is the theme.  The 
HTML generated by the theme is then presentation, along with the CSS.  
Issues such as whether the login block goes into the same sidebar as the 
calendar or the recent posts are captured by the HTML.  Yes, clever 
enough CSS can rearrange divs from their natural order in the HTML, but 
that just illustrates the absurdity of taking a hard line.  Decisions 
around which text can be displayed in alternative fonts are captured by 
<span> and related tags; these frequently have underlying semantics, but 
not necessarily.  Or you get into arguments over whether a decision to 
visually emphasize a word is a semantic or presentational issue.

Rather than going down this rathole, it just makes more sense to deal in 
real value.  Does using clever HTML/CSS for rounded corners make it 
harder to maintain the theme?  more so than other CSS cleverness?  Does 
it create problems for the person looking at it?  Is it harder to do 
client-side JavaScript because of is?  In other words, focus on the 
impact on people, and not the impact on theoretical models.


More information about the development mailing list