Download & Extend

Rename clear-block CSS class to clearfix

Project:Drupal core
Version:7.x-dev
Component:theme system
Category:feature request
Priority:normal
Assigned:JohnAlbin
Status:closed (fixed)
Issue tags:Needs Documentation

Issue Summary

Drupal uses a CSS class called "clear-block" that allows a container DIV to always enclose any floated children elements.

The CSS community calls this class "clearfix". I'm not sure why Drupal decided to change that. A quick Google search shows that there are over 167,000 references to clearfix css, but only about 1000 references to clear-block.

So, I think we should change "clear-block" to "clearfix".

  1. The CSS community already calls knows this technique as a "clearfix".
  2. Drupal already has too many "blocks". "clear-block" adds to the namespace collision because it sounds like it has to do with Drupal's block system.

Comments

#1

Status:active» needs review

Here's the patch that saves the kittens.

AttachmentSizeStatusTest resultOperations
drupal-clearfix-371231.patch20.82 KBIdlePassed: 9731 passes, 0 fails, 0 exceptionsView details

#2

I like it - we'll need to make sure this gets into the theming handbook here on d.o as well.

On second glance, I still can't see any problems. It applies and all is well here.

#3

Rerolled against current head. I tested this out and things seem pretty good, but was not applied against two additional files.

modules/field/field.form.inc.orig (?? this doesn't appear in my patch, doesn't get unpatched when I reverse it, gets repopulated by cvs when I delete it, I assume this is some sort of file that's purely archival?)
themes/chameleon/chameleon.theme (is this getting removed in 7?)

Other than that it all looks good. I would have marked to RTBC otherwise.

Eclipse

AttachmentSizeStatusTest resultOperations
clearfix.patch21.69 KBIdlePassed: 9731 passes, 0 fails, 0 exceptionsView details

#4

Status:needs review» reviewed & tested by the community

No occurrences of clear-block left after this patch. Seems logical.

#5

Yes, my patch did miss the chameleon.theme file. Good catch, EclipseGC! I'll be more careful when letting BBEdit do global search and replaces. Note to self: click the "File Type: All File Types" toggle.

#6

Status:reviewed & tested by the community» needs work

Great. Committed to HEAD!

Please update the theme upgrade documentation.

#7

#8

Status:needs work» reviewed & tested by the community

Just want to give a +1 to changing the name here. It is an odd drupalism that is just another bump on the road. Using the common terminology for this standard design fix makes way more sense to me.

#9

Status:reviewed & tested by the community» needs work

aw cross-posted

#10

Status:needs work» reviewed & tested by the community

Oi! Gimmie back mah tag! ;)

Thanks, add1sun. :)

#11

Status:reviewed & tested by the community» needs work

GRR! one. last. time.

#12

Status:needs work» fixed

Is good? http://drupal.org/node/254940#clearfix

#13

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here