Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Clearfix is an out-dated hack and unreliable cross-browser.
Regardless of the wisdom of it's use, it shouldn't be hardcoded into modules intended for general use with a variety of themes - it should be left to the theming layer and template customisation provided by end developers.
Comments
Comment #1
markedup CreditAttribution: markedup commentedAgreed;
.clearfix
makes assumptions around layouts that can interfere with more modern approaches to CSS.In these instances, the
.clearfix
hack is also prone to actually causing immovable layout problems in older, less-capable browsers (you can guess which).And by "immovable" I mean that you can't later remove junk added by
content
instructions once that class has already been processed by the browser. You can just add more junk to it.The simplest solution would be to make
.clearfix
an optional "base" class, not a mandatory one. That way you won't break existing layouts for people who still rely on it, but also don't foist it onto those who no longer need it (or want it).Comment #2
tsi CreditAttribution: tsi commentedI agree.
What are you suggesting ?
I guess - remove all clearfixes from templates and apply them with sasson's
@include clear
?Comment #3
mint5auce CreditAttribution: mint5auce commentedAs long as the clearfix class is removed from base html I'd be a happy developer :)
Comment #4
erutan CreditAttribution: erutan commented@include clear seems like an improvement to me.
Comment #5
tsi CreditAttribution: tsi commentedhttp://drupal.org/commitlog/commit/31168/cb0008d7213e324d4ec9ea0175c7075...
No clearfix in templates !
Thanks.