From 554a2808a3f337c5a3d578e9b53e6009f1491da6 Mon Sep 17 00:00:00 2001
From: Neil Drumm <drumm@3064.no-reply.drupal.org>
Date: Fri, 25 Aug 2006 09:01:12 +0000
Subject: [PATCH] #78656 by m3avrck. Drupal Core's first CSS hack.

---
 CHANGELOG.txt                              |  6 ++++--
 modules/help/help.module                   |  4 ++--
 modules/node/node.module                   |  8 +++----
 modules/system/defaults.css                | 25 ++++++++++++++++++++--
 modules/user/user.module                   |  4 ++--
 themes/engines/phptemplate/comment.tpl.php | 11 ++++------
 themes/engines/phptemplate/node.tpl.php    | 11 ++++------
 7 files changed, 43 insertions(+), 26 deletions(-)

diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 63206aec1565..c7d8823f6dea 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -51,8 +51,10 @@ Drupal x.x.x, xxxx-xx-xx (development version)
 - forms API:
     * made it possible to programmatically submit forms.
     * improved api for multistep forms.
-- split up and removed drupal.css.
-- added nested lists generation.
+- theme system:
+    * split up and removed drupal.css.
+    * added nested lists generation.
+    * added a self-clearing block class.
 
 Drupal 4.7.0, 2006-05-01
 ------------------------
diff --git a/modules/help/help.module b/modules/help/help.module
index c4ae90256962..8f6edcbc51f0 100644
--- a/modules/help/help.module
+++ b/modules/help/help.module
@@ -80,14 +80,14 @@ function help_links_as_list() {
 
   // Output pretty four-column list
   $break = ceil(count($modules) / 4);
-  $output = '<div class="help-items"><ul>';
+  $output = '<div class="help-items clear-block"><ul>';
   foreach ($modules as $i => $module) {
     $output .= '<li>'. l(t($module), 'admin/help/'. $module) .'</li>';
     if (($i + 1) % $break == 0) {
       $output .= '</ul></div><div class="help-items'. ($i + 1 == $break * 3 ? ' help-items-last' : '') .'"><ul>';
     }
   }
-  $output .= '</ul></div><br class="clear" />';
+  $output .= '</ul></div>';
 
   return $output;
 }
diff --git a/modules/node/node.module b/modules/node/node.module
index 488cde59ce69..216e89a8c8ca 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1334,7 +1334,7 @@ function theme_node_filter_form($form) {
  * Theme node administraton filter selector.
  */
 function theme_node_filters($form) {
-  $output .= '<ul>';
+  $output .= '<ul class="clear-block">';
   if (sizeof($form['current'])) {
     foreach (element_children($form['current']) as $key) {
       $output .= '<li>' . drupal_render($form['current'][$key]) . '</li>';
@@ -1356,7 +1356,7 @@ function theme_node_filters($form) {
 
   $output .= '</dl>';
   $output .= '<div class="container-inline" id="node-admin-buttons">'. drupal_render($form['buttons']) .'</div>';
-  $output .= '</li></ul><br class="clear" />';
+  $output .= '</li></ul>';
 
   return $output;
 }
@@ -2440,8 +2440,8 @@ function node_form_alter($form_id, &$form) {
     $form['advanced']['submit'] = array(
       '#type' => 'submit',
       '#value' => t('Advanced search'),
-      '#prefix' => '<div class="action">',
-      '#suffix' => '</div><br class="clear" />',
+      '#prefix' => '<div class="action clear-block">',
+      '#suffix' => '</div>',
     );
 
     $form['#validate']['node_search_validate'] = array();
diff --git a/modules/system/defaults.css b/modules/system/defaults.css
index 58f17d7b70a3..87b45d74cab1 100644
--- a/modules/system/defaults.css
+++ b/modules/system/defaults.css
@@ -26,7 +26,28 @@ th {
   padding-right: 1em;
   border-bottom: 3px solid #ccc;
 }
-br.clear {
-  clear: both;
+
+/*
+** 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 */
diff --git a/modules/user/user.module b/modules/user/user.module
index 7ef97b1cd49e..ad93224465a4 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -2504,7 +2504,7 @@ function theme_user_filter_form($form) {
  * Theme user administraton filter selector.
  */
 function theme_user_filters($form) {
-  $output .= '<ul>';
+  $output .= '<ul class="clear-block">';
   if (sizeof($form['current'])) {
     foreach (element_children($form['current']) as $key) {
       $output .= '<li>'. drupal_render($form['current'][$key]) .'</li>';
@@ -2526,7 +2526,7 @@ function theme_user_filters($form) {
 
   $output .= '</dl>';
   $output .= '<div class="container-inline" id="user-admin-buttons">'. drupal_render($form['buttons']) .'</div>';
-  $output .= '</li></ul><br class="clear" />';
+  $output .= '</li></ul>';
 
   return $output;
 }
diff --git a/themes/engines/phptemplate/comment.tpl.php b/themes/engines/phptemplate/comment.tpl.php
index 2456c5819145..d9dc3fd36033 100644
--- a/themes/engines/phptemplate/comment.tpl.php
+++ b/themes/engines/phptemplate/comment.tpl.php
@@ -1,15 +1,12 @@
-<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ($comment->status == COMMENT_NOT_PUBLISHED) ? ' comment-unpublished' : ''; ?>">
-<?php if ($comment->new) : ?>
+<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ($comment->status == COMMENT_NOT_PUBLISHED) ? ' comment-unpublished' : ''; ?> clear-block">
+  <?php if ($comment->new) : ?>
   <a id="new"></a>
   <span class="new"><?php print $new ?></span>
-<?php endif; ?>
+  <?php endif; ?>
 
-<div class="title"><?php print $title ?></div>
+  <div class="title"><?php print $title ?></div>
   <?php print $picture ?>
   <div class="author"><?php print $submitted ?></div>
   <div class="content"><?php print $content ?></div>
-  <?php if ($picture) : ?>
-    <br class="clear" />
-  <?php endif; ?>
   <div class="links"><?php print $links ?></div>
 </div>
diff --git a/themes/engines/phptemplate/node.tpl.php b/themes/engines/phptemplate/node.tpl.php
index 028aeb3ce809..6da685329159 100644
--- a/themes/engines/phptemplate/node.tpl.php
+++ b/themes/engines/phptemplate/node.tpl.php
@@ -1,4 +1,4 @@
-<div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
+<div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?> clear-block">
   <?php if ($page == 0): ?>
     <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
   <?php endif; ?>
@@ -8,11 +8,8 @@
   <div class="content">
     <?php print $content ?>
   </div>
-<?php if ($links): ?>
 
-    <?php if ($picture): ?>
-      <br class='clear' />
-    <?php endif; ?>
-    <div class="links"><?php print $links ?></div>
-<?php endif; ?>
+  <?php if ($links): ?>
+  <div class="links"><?php print $links ?></div>
+  <?php endif; ?>
 </div>
-- 
GitLab