Skip to content

Commit

Permalink
Styles cleanup and rudimentary IE6 png support.
Browse files Browse the repository at this point in the history
  • Loading branch information
yhahn committed Aug 12, 2009
1 parent 902baeb commit 9766d56
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 29 deletions.
9 changes: 9 additions & 0 deletions page.tpl.php
Expand Up @@ -3,6 +3,11 @@
<head>
<?php print $head ?>
<?php print $styles ?>

<!--[if lt IE 7]>
<style type="text/css" media="all"><?php print $styles_ie6 ?></style>
<![endif]-->

<title><?php print $head_title ?></title>
</head>
<body <?php print drupal_attributes($attr) ?>>
Expand Down Expand Up @@ -33,6 +38,10 @@
<?php if ($site_name): ?><h1 class='site-name'><?php print $site_name ?></h1><?php endif; ?>
</div>

<div id='utility'>
<?php if (!empty($breadcrumb)) print $breadcrumb ?>
</div>

<div id='page'>
<?php if ($title || $tabs): ?>
<div class='page-header'>
Expand Down
87 changes: 60 additions & 27 deletions style.css
@@ -1,7 +1,7 @@
body {
background:#011220 url(images/sea.png) 0% 0% repeat-x fixed;
background:#011220 url(images/sea.jpg) 0% 0% repeat-x fixed;
color:#333;
font:15px/25px "Helvetica Neue",Arial,Helvetica,sans-serif;
font:13px/20px "Helvetica Neue",Arial,Helvetica,sans-serif;
}

a {
Expand All @@ -18,8 +18,8 @@ a {
body.one-sidebar #root { width:960px; }

#sidebar {
-moz-border-radius-topright:10px;
-moz-border-radius-bottomright:10px;
-moz-border-radius-topright:5px;
-moz-border-radius-bottomright:5px;

font-size:13px;
line-height:20px;
Expand All @@ -33,8 +33,8 @@ a {
}

#main {
-moz-border-radius:20px;
-moz-border-radius:20px;
-moz-border-radius:10px;
-moz-border-radius:10px;
background:url(images/mask.png);
width:740px;
}
Expand All @@ -61,11 +61,6 @@ body.fluid #main {
body.fluid #sidebar { width:20%; }


/**
* Prose text =========================================================
*/
p { margin:0px 0px 25px; }

/**
* Branding ===========================================================
*/
Expand Down Expand Up @@ -102,7 +97,8 @@ p { margin:0px 0px 25px; }

#branding div.primary ul.links a {
-moz-border-radius:10px;
background:#111;
-webkit-border-radius:10px;
background:url(images/mask.png);
padding:0px 15px;
}

Expand All @@ -116,13 +112,32 @@ p { margin:0px 0px 25px; }
}

/**
* Page ===============================================================
* Breadcrumb =========================================================
*/
#page {
-moz-border-radius:5px;
background:#fff;
#utility {
-moz-border-radius-topleft:5px;
-moz-border-radius-topright:5px;
-webkit-border-top-left-radius:5px;
-webkit-border-top-right-radius:5px;

color:#ccc;
background:url(images/mask.png);
padding:0px 5px;
line-height:30px;
font-weight:300;
text-transform:lowercase;
}

#utility a {
margin:0px 5px;
color:#fff;
}

/**
* Page ===============================================================
*/
#page { background:#fff; }

/**
* Tabs ===============================================================
*/
Expand Down Expand Up @@ -236,14 +251,16 @@ div.left div.admin-panel { margin-right:10px; }
background:url(images/close.png) no-repeat;
}

#growl div.autoclose span.close { display:none; }

#growl div.messages {
-moz-border-radius:10px;
-moz-border-radius:5px;
-webkit-border-radius:5px;

margin:5px 0px;
background:#eff;
opacity:.9;
padding:20px;

cursor:pointer;
}

#growl div.error { background:#fee; }
Expand Down Expand Up @@ -291,7 +308,6 @@ dl dd {
#sidebar a { color:#adf; }
#sidebar a:hover { color:#fff; }


#sidebar div.block {
padding:10px 10px 10px 0px;
-moz-border-radius-topleft:5px;
Expand All @@ -301,10 +317,10 @@ dl dd {
}

#sidebar div.block h2.block-title {
padding:5px 10px 4px;
margin:0px 0px 1px;
background:url(images/mask.png);
font-size:13px;
padding:0px 10px 10px;
background:url(images/dots.png) 0px 100% repeat-x;
font-size:18px;
font-weight:300;
}

/* Menu blocks */
Expand All @@ -319,8 +335,8 @@ dl dd {
}

#sidebar ul.menu a.active {
background:#fff;
color:#333;
background:url(images/mask.png);
color:#fff;
}

#sidebar ul.menu li li a {
Expand All @@ -339,6 +355,23 @@ div.block ul.menu li li li li li li li li a { padding-left:80px; }
/**
* Nodes ==============================================================
*/
div.node {
padding:0px 0px 19px;
margin:0px 0px 20px;
border-bottom:1px solid #ddd;
}

div.node-page {
margin:0px;
padding:0px;
border:0px;
}

h2.node-title {
font-weight:300;
font-size:18px;
}

div.node-links,
div.node-submitted {
color:#666;
Expand All @@ -361,7 +394,7 @@ div.node-links ul.links {

div.node div.field { margin:0px 0px 10px; }

div.prose { line-height:25px; }
div.prose { line-height:20px; }

/**
* Pagers =============================================================
Expand Down
19 changes: 17 additions & 2 deletions template.php
Expand Up @@ -6,6 +6,7 @@
function singular_preprocess_page(&$vars) {
include_once(drupal_get_path('theme', 'singular') .'/styles.inc');
$vars['styles'] .= singular_style_css(singular_get_style_info());
$vars['styles_ie6'] = singular_style_ie6();

$settings = theme_get_settings('singular');
if (!empty($settings['layout'])) {
Expand All @@ -18,8 +19,12 @@ function singular_preprocess_page(&$vars) {
*/
function singular_preprocess_node(&$vars) {
$node = menu_get_object();
if ($node === $vars['node'] && !isset($_GET['print'])) {
unset($vars['title']);
if ($node === $vars['node']) {
$vars['attr']['class'] .= ' node-page';

if (!isset($_GET['print'])) {
unset($vars['title']);
}
}
}

Expand All @@ -44,6 +49,16 @@ function singular_style_css($info) {
return $output;
}

/**
* PNG transparency compatibility for IE6.
*/
function singular_style_ie6() {
$mask_path = base_path() . path_to_theme() . '/images/mask.png';
$property = "background:transparent; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src='{$mask_path}');";
$linkfix = "position:relative;";
return "#sidebar ul.menu a { height:1%; } #main,#utility,#sidebar,#branding div.primary ul.links a,#sidebar ul.menu a.active { $property } #main a,#utility a,#sidebar a,#branding div.primary ul.links a,#sidebar ul.menu a.active { $linkfix }";
}

/**
* Override of theme_status_message().
*/
Expand Down

0 comments on commit 9766d56

Please sign in to comment.