In page.tpl.php, clear-block class is used to clear float but I cannot find such a class in any of ninesixty css files.

CommentFileSizeAuthor
#1 960-clear-block.patch258 byteslaura s
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

laura s’s picture

Category: support » bug
Status: Active » Needs review
FileSize
258 bytes

I discovered this as well. It took me a while to figure this out, as it was breaking vertical tabs functionality in the node forms for me as well.

Assuming that ninesixty indeed does want to keep this class, I've attached a patch that adds clear-block class to the styles.css file.

dvessel’s picture

Status: Needs review » Closed (works as designed)

The .clear-block class is defined in a core style sheet (default.css). There would be a problem with using that class in Drupal 7 since it has been changed to .clearfix. I'm unsure how it can break the tabs. Laura, are you using this in 7?

The version for 7 will have this change.

adrianmak’s picture

The original 960gs has a clearfix class, why 960 drupal theme get rid of it ?

laura s’s picture

As tagged, this issue relates to 6.x-1.0. I don't recall what was disabling clear-block, but it was wreaking havoc on my subtheme of ninesixty. At the time I just added it to my theme and moved on.

I'm not sure why it would have been disabled. I just saw the issue today when I came here to check on D7 status, and whipped up a patch without really investigating.

dvessel’s picture

Since Drupal core uses .clear-block I thought it was better to remove .clearfix so there's only a single and consistent way to clear inner floats. They basically do the same thing. .clearfix is a commonly used name for the expected behavior while .clear-block is drupal specific. It might have been wiser to leave in .clearfix. I'm not really sure.

Laura, if that patch is exactly what you used to fix your issue, your experiencing a very different problem. The clear-block and clearfix class serve to clear inner floats from a containing element. Not clear elements set after a float.

patch rules:

.clear-block {
  clear: both;
}

vs. core rules:

/*
** Markup free clearing
** Details: http://www.positioniseverything.net/easyclearing.html
*/
.clear-block:after {
  content: ".";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}

.clear-block {
  display: inline-block;
}

/* Hides from IE-mac \*/
* html .clear-block {
  height: 1%;
}
.clear-block {
  display: block;
}
/* End hide from IE-mac */

laura s’s picture

I only noticed a problem on vertical tabs in webkit. Firefox was not affected. Neither were any other themes in any browser.

laura s’s picture

Just recalling now: Also, some divs would not respect placement or height in any browser. The only change I made was the above (except I added it to my own theme, not ninesixty) and that resolved all the issues.

laura s’s picture

Only now seeing what I was doing wrong with the issues in #7. Still don't know what #6 was about, though.

I should also note that I was thrown by the .clear-block name for ages now. I never connected it with clearfix until I went through the D7 theming changes just a few weeks ago. NineSixty is still pretty new to me -- only 5 sites so far -- so maybe I'm missing some other arcana, but I'm loving it!