Dogme11.11.11 -a Vow of frontend Chastity
Sometimes it happens that a talk about "all thats wrong" fires up my mind - Tonight was one of those nights. I sat down, dropped the sleep & plotted out a very rough draft for a Dogme Ruleset. Its been discussed numerous times over the last 3 years in quite dark corners, between those called themers in the Drupalsphere that there needed to be somekind of manifest.
I call this the Dogme11.11.11 (Insert Drumroll + horns)
Drupal Frontend Developerment
I swear to the following set of rules drawn up and confirmed by Dogme11.11.11
1. Clearfix is a nessasary evil
It Should not be used as a general cleanup tool. and should not be hardcoded into the markup.
try as much as possible not to add this into the markup as a hardcoded class. It makes it very hard to remove/overwrite
2. Every elements & class must have a reason and be explained
just adding markup/css, basend on what we were used to do (during the cold days of ie5-ie67ie7) ia not an explenation of why its there.
3. Markup & css must be flexible & in line with "real world" techniques
Every layout techniques, must have multiple examples that demonstrates RTL/LTR compability , horizontal & vertical versions (fx sliding doors)
So we don't wanna end up with markup/css that isn't flexible for what we use it for.
4. a wrapper element must know what it wraps and not be a mindless container
5. Keep class names small & semantic
theres no reason .to_have_a_name_thats_so_long_its_gonna_be_a_pain_to_work_with, .notEvenInCamelCase if a shorter .short-identifier is as easy understood.
6. Think forward not backward.
Its nessasary to keep fixes for crappy browsers, document these, so we can remove em quickly as old browsers dies.
Drupal is not set to be backward compatible with everything in the world. Were the system for the future not yesterday (insert violins here, and a man choir) - while we kill ie7 support
7. the right solution not the Quickfix
How can another theme overwrite / change this markup easy -
stop the hunt for the Quickfix ans find the right solution.
8. Stop the reset madness,
Makes the css painfull to read in firebug, theres other ways around it.
9. work with core
Remeber that the theme/frontend is the glue between the design, the content & drupal, check with core that we dont break (to much ;)
10. Keep it minimal
keep the margin, padding borders etc to a minimum -someone wants to overwrite you stuff in a year.
okay then now what?
Now the question is - is this to much & should I have gone to bed early?
If not what should be changed or are this rules to live by as a Drupal Frontend Developer?
Drupal is complex & very flexible, which is one of the many reasons for succes.
The "frontend" have been ignored mainly, because the focus have been based on hardcore backend development & architecure - which imho is the reason that Drupal Rocks(tm) .
For to long its been a "they can just overwrite it in the css" kinda attitude - fortunately that have changedover the last couple of years :)