Personally, I’m a big proponent of both progressive enhancement as well as graceful degradation (fault tolerance). While both concepts are similar in nature, they both possess small unique parts that set them apart.
To me, keeping graceful degradation in mind while developing will aim to leave you with a functioning document no matter the circumstances. Progressive enhancement on the other hand, is a level of functionality present only if the reader has the needed technology readily available. While it may seem that both are nearly identical, to me graceful degradation seems to be more passive in nature when comparing it to progressive enhancement, which is a more active. Progressively enhancing a document gives the ability to make alterations where applicable in an effort to make a document that much more useful, while graceful degradation is more of a fall back plan.
Separation of structure, style & behavior
font tags to set some text apart. In my opinion, a better way to handle something like this is to provide the element with a
class as opposed to directly altering the rendered style. This way, the only edit made using the DOM is an element’s
class, which is styled within the style sheet.
A more interesting situation
While directly changing the style of an element can be easily resolved, there are many circumstances which make a solution much more complicated. The combination of (X)HTML and CSS gives designers and developers a fantastic tool set to create amazing, accessible, standard websites. While many great things can be done with markup and style alone, there are many times a design needs to be brought to the next level. Whether it be a client request or an unforeseen hurdle during a design phase, there are certain times that (X)HTML and CSS aren’t going to provide everything needed by you as the designer or developer.
Using the DOM to prepare for your CSS
I’m timid about using scripts such as these due to the fact that it seems as though you’re using the document behavior to alter the document structure for the sole purpose of styling the document differently. It is a bit of a gray area to me because while the structure, style, and behavior are still maintained separately, the resulting markup is bloated and has lost semantic value at the cost of adding a design element that is not otherwise possible.
On one hand you are striving to include a design element keeping best practices in mind, but on the other hand your resulting markup (after interacting with the DOM) is anything but ideal. At this point, what is the solution? Is it better to neglect the issue as a whole and work with what you’ve got? Is a bit of code bloat while DOM scripting an issue that needs serious consideration?
Some time ago I was browsing the threads of a forum with a particular discussion being centered around proper markup used to create accessible
forms. I took a minute to provide my opinion, which, at the time seemed to me like the best solution. The technique was using as little markup as possible in an effort to avoid code bloat, something I was working very hard to do in all cases. Shortly after, two developers whom I hold in high regard, offered their opinion on the matter explaining the faults in my suggestion and offering their own. The developers were Jonathan Snook and Kyle Neath, two people with opinions I greatly respect and use their writing to expand my own knowledge. Their solution called for a bit of extra markup, but the additions made sense in the overall structure of the document in consideration. Point being; not all additional markup can be labeled as bloat.
Some questions I’d like to discuss
I’ve got some questions for the community as a whole as a response to an issue such as this. First and foremost: do you feel this is an issue at all? Is it simply making effective use of accepted technologies to achieve results not otherwise possible? Is using the DOM to generate bloated documents for the purpose of more elaborate style taking things to an unacceptable level? As designers, should we only be allowed to work with the tools we’re given and leave design elements limited to what can be done with (X)HTML and CSS alone? What other opinions do you have on the matter?