layout-fixed.css has the following code block:
.region-sidebar-second {
float: left; /* LTR */
width: 280px;
margin-left: 660px; /* LTR */ /* Width of content + sidebar-first. */
margin-right: -940px; /* LTR */ /* Negative value of .region-sidebar-second's width + left margin. */
padding: 0; /* DO NOT CHANGE. Add padding or margin to .region-sidebar-second .section. */
}
The code comment for the margin-left isn't strictly true. When sidebar-first is enabled it's correct. But when only sidebar-second is enabled it's not. In the latter case margin-left should be /* Width of content. */
Both values should of course be the same, but for an inexperienced user simply working their way down the stylesheet filling in values this comment could lead them astray.*
A clearer comment might be:
margin-left: 660px; /* LTR */ /* Width of content, or if sidebar-first is enabled Width of content + sidebar-first. *
But I'm not too keen on that wording either. Suggestions?
* Ok, I admit it. Out of laziness I often follow those comments and it's led me astray a couple of times :) Easy to fix when you engage brain and think, but I have a suspicion this causes a good few issue queue and #drupal-themes support requests.
Comments
Comment #1
barraponto@adrinux give this compass plugin a look: http://groups.drupal.org/node/97989#comment-338664
Comment #2
barrapontoAnd by the way, if there is no first-sidebar, then first-sidebar's width equals zero.
Comment #3
adrinux commentedThe thing about Drupal barraponto, is that a sidebar may or may not be present on different pages.
For a new user, as they work down the stylesheet setting these widths and margins, they first set content width + margins - all four versions, then first sidebar width + margins, now when they reach second sidebar and that comment says "Width of content + sidebar-first" they'll mostly likely look right above at the width they just entered for first sidebar, scroll up and take the width of content and add them together...but they may not take the width of content for when both sidebars are enabled. Remember there are four selectors for content with at least three different widths.
You're right, and you and I both know that content width, and content width + first sidebar width should be the same number, but I think that comment could be made a little clearer. Perhaps it should read:
In other words be completely explicit about which width value to use.
Comment #4
barraponto@adrinux: i see where you're going. we need to check every comment on layout-*.css rules for the layout.
to be honest, i'd rather use it as is or provide means to generate different layouts. http://drupal.org/project/zenophile is an example. i have developed a compass plugin to do that for me as well: http://rubygems.org/gems/compass-drupal-plugin
Comment #5
johnalbinComment #6
johnalbinActually, closing this since its so old.