CSS styling breaks form layout

sun - December 5, 2008 - 03:56
Project:Menu block
Version:6.x-2.x-dev
Component:User interface
Category:bug report
Priority:critical
Assigned:Unassigned
Status:reviewed & tested by the community
Description

First of all, the new option to select the starting menu item seems to work fine! :)

However, some weird styling was introduced somewhere, which completely breaks the form layout, rendering it almost unusable.

As the goal of this module is Drupal core, this styling should be removed IMHO, because it is not in line with any other form in Drupal core. If we can save some KB by doing this, even better.

I'll work on a patch tomorrow.

AttachmentSize
menu_block-styling.png14.98 KB

#1

JohnAlbin - December 6, 2008 - 00:41
Status:active» postponed (maintainer needs more info)

Which browser is this? I could have sworn I tested it on IE6, IE7, Firefox3 and Safari3.

#2

sun - December 6, 2008 - 02:10

Firefox 3/Windows. However, this issue is rather not related to a styling error, it's related to the styling at all. Counter question: Did you test any other theme than Garland? ;)

Really, I see no reason why Menu Block should suddenly start to introduce an own form layout/styling in this *part* of the block configuration form. If there was a completely separated form on an own page and the styling would actually be required to display the form elements properly, it would start to make sense. But this is not the case with Menu Block.

Admittedly, the screenshot was taken on a custom theme, which displays form elements in a two-column layout (label - element). However, all other forms of other modules are displayed correctly, so it's definitely not an issue with this theme.

...

After studying this styling in Firebug, it seems like the intention was exactly to introduce a two-column form layout. That's cool - but not really the job of this module. It's rather the job of a theme to apply appropriate styles - consistently - to all forms throughout Drupal.

Therefore, attached patch removes this styling. I'm also attaching another screenshot, which shows the default/resulting layout/styling of this form and hopefully convinces you that such styling is the job of the theme.

AttachmentSize
menu_block.layout.patch 4.87 KB
menu-block-form.png 13.35 KB

#3

sun - December 8, 2008 - 03:57
Status:postponed (maintainer needs more info)» needs review

#4

sun - July 17, 2009 - 01:57

Bump!

John... please! This is not the job of a module, it's the job a theme... :)

#5

sun - August 13, 2009 - 19:06
Status:needs review» reviewed & tested by the community

Repeating myself once again:

It seems like the intention was to introduce a two-column form layout. That's cool - but not really the job of this module. It's rather the job of a theme to apply appropriate styles - consistently - to all forms throughout Drupal.

The current CSS only alters Menu Block's fieldset, but not the other fields in the same form, which makes the inconsistency obvious. Custom CSS would be appropriate if there was a special form containing form elements that require special placement to make any sense. However, the applied CSS styles are completely cosmetical and only serve to apply a different layout to this fieldset of the form. The implemented CSS presumes that forms are strictly using the styles applied by Drupal core (specifically Garland) only - which is a wrong assumption. By doing so, this breaks any other form layout that may have been applied globally to all forms in a Drupal site (overriding exactly those defaults by Drupal core to achieve a consistent, but different form layout).

I needed to apply this patch to 3 Drupal sites in the meantime. Not sure whether it still applies cleanly (it should), but I'm also happy to re-roll if required. At the very least, this is RTBC.

 
 

Drupal is a registered trademark of Dries Buytaert.