Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
steps to reproduce:
- install a fresh head
- click the contextual links trigger in the 'powered-by' block
expected result:
contextual links are visible
actual result:
contextual links get cut off at the end of the block
conclusion:
overflow:hidden; is so cool, it must be applied to everything and everywhere, twice if we have to⸮⸮⸮
Comment | File | Size | Author |
---|---|---|---|
#42 | 875132-seutje.patch | 1.73 KB | Jacine |
#32 | 875132-bartik-overflow-6.patch | 1.36 KB | seutje |
#32 | 875132-bartik-overflow-7.patch | 1.15 KB | seutje |
#32 | 875132-bartik-overflow-8.patch | 1.17 KB | seutje |
#27 | drupal.block-clearfix.27.patch | 1.93 KB | sun |
Comments
Comment #1
Jeff Burnz CreditAttribution: Jeff Burnz commentednone might be as good as twice to often?
Comment #2
Jeff Burnz CreditAttribution: Jeff Burnz commentedWe may need to apply this more widely since blocks as inline menus could be added to a number of regions, or other sorts of very thin blocks where the contextual links could get cut off.
Comment #3
Jeff Burnz CreditAttribution: Jeff Burnz commented#1: bartik-overflow-hidden-footer.patch queued for re-testing.
Comment #4
watcha CreditAttribution: watcha commentedI agree that overflow hidden shouldn't be everywhere, however this patch will make sure this problem is independent of all themes.
Comment #5
aspilicious CreditAttribution: aspilicious commentedI like the approach off #4
Comment #6
Jeff Burnz CreditAttribution: Jeff Burnz commentedChanging component re #4.
Comment #7
watcha CreditAttribution: watcha commentedWorks as advertised. Achieves the request with minimal amount of code and makes sure that other themes cant break this
Comment #8
bleen CreditAttribution: bleen commentedAdding screenshot from #934540: Block Configuration drop down menu hidden in small blocks. which was marked as duplicate of this issue:
Comment #9
bleen CreditAttribution: bleen commentedwatcha ... you're not really supposed to mark your own patch as RTBC but this looks like a good solution to the issue.
RTBC++
Comment #10
webchickCommitted #4 to HEAD. Thanks!
Comment #11
webchickOh. And this is what it looks like now:
Comment #12
watcha CreditAttribution: watcha commented@bleen18 sorry forgot to mention that the patch was tested by
the team I work with. Won't be doing it in the future :)
Comment #13
seutje CreditAttribution: seutje commentedwtf, !important on a value that is the default? this is bonkers! o_o
not only is this widely regarded as bad practice, it makes a few very dangerous assumptions:
- ppl couldn't possibly want another overflow value on a block when it has active contextual links (imagine the delight when trying to make ur block into a progressive slider that falls back to a scrollable div, jolly good fun!)
- ppl couldn't possibly want to use D7 and still have some kind of support for IE6 (as it ignore !important altogether)
- ppl couldn't possibly want to put other stuff in a block in that region and offset it (as this creates a specific exception for regions with an active contextual link set)
- ppl enjoy watching the height of the entire document jerk around as they hover over a region (hover/unhover the region and watch that scrollbar go!)
I really wonder how this was tested, the body jerking around happens in pretty much every browser, as the (double) margin collapses without overflow:hidden, whereas it doesn't with the overflow:hidden, and I couldn't manage to reach the contextual menu in that block on IE6/7 in any way
so it "solved" 1 issue, and created 3 others. Add to that the fact that the only way to override this in a browser other than IE<7 is by using the same nasty practice and you can understand my "wtf?" reaction
no offense, but this feels a lot like "let's use a crappy method to attempt to cater for crappy themes instead fixing the crappy themes"
can any1 even justify the presence of the overflow:hidden? Are we so dead-set on endlessly overriding values that shouldn't even be there?
also note that this is being applied to the block wrapper *and* the content wrapper, so I seriously foresee this causing problems
re-opening
Comment #14
webchickThat was a nice rant.
Now can you suggest an alternative? #8 is a really nasty user-facing problem.
Comment #15
seutje CreditAttribution: seutje commentedwell, since it's presence can't be justified, just get rid of it? -> #1
the only thing that would change (aside from making the contextual menu visible) is that the combined margin on .block and .content will collapse, but that's how margins are supposed to work, and with the current solution, they still collapse on hover...
my apologies if it seemed like a harsh rant, but I've noticed that it significantly lowers the probability of it being ignored
Comment #16
Jeff Burnz CreditAttribution: Jeff Burnz commentedI still think #1 is the best fix, but I did not get a chance to test it really widely and have not kept a close eye on this issue - some good points raised, indeed important is a bit rough and actually goes against the policy of no !important in core (which really should have had an exception granted before being considered).
Comment #17
webchickOk, then let's get #1 RTBC and we can make the change.
Comment #18
sun@seutje is right.
Proper fix is non-trivial, and we faced the very same problem space in various other issues without resolution already, but the patch that went in should be reverted.
Comment #19
seutje CreditAttribution: seutje commentedI'm actually a bit confused on what the actual intend is here, as these 3 successive statements all touch the margin of blocks in the footer:
if the point of the overflow is to keep the margins from collapsing, padding would probably be a better fit
attached patch removes the
overflow: visible !important;
and splits up#footer .block
and#footer .block .content
, leaves the margin on#footer .block
and changes the margin to padding on#footer .block .content
. Themargin-top: 0;
statement is there because a preceding statement (.content { margin-top: 10px; }
, bartik's style.css line ~526) needs to be overriddenThis causes it to look exactly the same, aside from fixing the contextual links issue
tested in Chrome7, FF3.6 and IE8 (can't rly test in IE6/7 as the functionality is fundamentally broken for that region before & after, slapping a background color on it seems to fix it, but that's a whole other issue altogether)
Comment #20
seutje CreditAttribution: seutje commenteddo note I've only tested the effects on the powered-by block in the footer region, I am yet to test its effects on multiple blocks in the footer region and the main content region with and without block module enabled
Comment #21
seutje CreditAttribution: seutje commentedfound an unwanted repercussion when putting menu's in the footer
all menu links in the footer are floated, so the block doesn't rly clear anymore. Ideally, we'd want to apply clearfix to the block's .content , not the block wrapper itself
since the content class is hardcoded in the block.tpl.php and not built from the $content_attributes like all the rest, I see 3 options:
- copy the clearix declarations using
#footer .block .content
as selector (duplicate declarations no guud)- make a block--footer.tpl.php template and add clearfix to the class attribute (might be confusing to new ppl)
- live with a non-clearing block content for menu blocks in the footer, visually resulting in slightly less space in between the blocks (not as it was designed)
attached patch opts for the second option (lesser of 3 evils imo)
Comment #22
sunWhy don't we add .clearfix to all blocks? (however, on .block, not .block .content)
Comment #23
seutje CreditAttribution: seutje commentedthat's what I tried at first, but .block .content has padding, so if the menu in there doesn't clear, that padding won't have any effect and the spacing in between blocks would be less
compare:
current, with overflow:hidden
without overflow:hidden, clearfix on .block
without overflow:hidden, clearfix on .content
Comment #24
sunMoving into markup queue.
I only suggested .clearfix on .block to make it consistent with other template elements. Ideally, we'd do that and therefore achieve consistency.
However, if that won't be possible, then I don't really see a reason why we couldn't apply it on .block .content, or perhaps even on both.
Comment #25
Jeff Burnz CreditAttribution: Jeff Burnz commentedOuch...
As for the issue, yes the second option seems the lessor of the evils, but again, ouch, a whole template? Sorry, I'm so shocked since I haven't looked at core templates in lord knows how long, what a shame that travesty slipped through the cracks (hard coded content class).
I think understandably I am quite resistant to this, but what are the real alternatives?
Comment #26
Jeff Burnz CreditAttribution: Jeff Burnz commentedx post
Comment #27
sunComment #29
Jeff Burnz CreditAttribution: Jeff Burnz commentedTheres no real drawback to this that I can see, however for the majority of cases there is no win either - most blocks in most designs do not need clearfix, so in effect we're supporting edge cases here. Sure we need to fix the overflow issue in Bartiks footer blocks, but this seems a rather blanket solution to problems that don't yet exist. IMO core templates should be lean and mean, if we build to the 80% rule then this doesnt cut it, 80% of blocks don't need clearfixing.
Comment #30
Jeff Burnz CreditAttribution: Jeff Burnz commentedfreaken cross posts...
Comment #31
seutje CreditAttribution: seutje commented@sun: wouldn't it be more interesting to add the clearfix (on the block wrapper) to the $classes via preprocess or something? feels a bit silly to print $classes *and* just add clearfix to the end
but like Jeff pointed out, this is sort of an edge-case. modifying the core template for a problem that exists in 1 theme seems a bit backwards, I would much rather fix the theme tbh
I'ma have another quick go at it before I hit the sack
Comment #32
seutje CreditAttribution: seutje commentedk, here goes...
6 has a small discrepancy, but allows us to simply not care if the menu clears or not, puts clearfix on .block and tries to adjust the margins to accommodate
7 makes it look exactly the same, but slaps clearfix on all menu trees, not sure if this is desired
8 copies the clearfix css and applies it to
#footer .menu
(the first of the 3 evils stated in #21)Comment #33
Jacinere: @sun in #24:
I think this makes sense. I don't get why the clearfix class is applied to node templates and not block templates. I think most themes would end up adding the clearfix class anyway, so let's fix this and not make people override this template for such a stupid reason.
re: @seutje in #31:
Totally agree with this. I assume @sun did it this way, because that's the way the node template is setup. IMO both this should be done in preprocess with the rest of the classes for consistency.
As for the Bartik issue, I like this patch: 875132-bartik-overflow-7.patch. I think applying a .clearfix on the menu tree is perfectly fine (it might even make sense in theme_menu_tree() itself). I don't think it would have a negative effect amywhere and the code is much cleaner.
Comment #34
Jeff Burnz CreditAttribution: Jeff Burnz commentedIf you really must add clearfix to block template then no, I do not agree with this and how sun has it is better - because then its very easy to remove if you don't want it. Ramming this into the $classes variable means its much harder to get rid of and would be making big assumption about what themers/designers actually want. This is wrong - while certain assumptions must be made, its a very big assumption that a design demands float clearing, indeed that the designer wants or needs to use the clearfix method, which is just one clearing method of many. If its hard code we can remove it very easily (edit HTML), if its in the $classes variable then we're saying "learn PHP".
Comment #35
Jacine#34 I disagree. All of the default classes drupal provides are added via preprocess. The reason they are in this $classes variable and not in $attributes is to make "adding" classes easy. I am tired of these inconsistencies. What makes "that" class any more special than the others? Anyway, that's my 2 cents.
Comment #36
Jeff Burnz CreditAttribution: Jeff Burnz commentedThe default classes added to templates via $classes typcially do not carry any declarations, they're mere tokens without style - styling hooks the themer can use if they want to, otherwise they do nothing - clearfix is not the same, it carries a lot of style, and implications - that is the key difference here - I think whoever wrote this put a lot of thought into it and got it right, I believe it was JohnAlbin and EclipseGC and co but I can't recall, we're going back a bit now.
Edit: clarifying why I don't really like the idea of placing clearfix in the $classes variable and would prefer it stayed hard coded as per suns patch.
Comment #37
JacineJeff - So then say you do not support adding clearfix class, if that's your gripe. I am aware of how/when these were added. I don't agree with it, and I am entitled to that opinion. We can disagree on that, it's fine. Just saying...
Comment #38
JacinePatches in #32 need more reviews. As I said in #33, I'm good with http://drupal.org/files/issues/875132-bartik-overflow-7.patch.
It doesn't touch core templates, and there haven't been any other objections, so I'm changing this to needs review, because it's not clear what actually needs work, if anything.
Comment #39
Jeff Burnz CreditAttribution: Jeff Burnz commentedSure Jacine, I know you understand all this stuff, I was just clarifying my objection to those who may not understand my position or why I am bitching about this, no disrespect intended, my apologies if it came across that way.
I'm good with #33, http://drupal.org/files/issues/875132-bartik-overflow-7.patch also and fwiw this is what I do in my own themes.
Comment #40
JacineJeff, no worries. You are entitled to your opinion too, of course. I'm not offended, just trying to keep the "bitching" and the number of comments to fix an issue at a minimum these days. Otherwise, it's hard to focus on fixing things, for me at least. ;)
So, it looks like we agree on the fix for this! YAY :D
Marking http://drupal.org/files/issues/875132-bartik-overflow-7.patch RTBC!
Thanks @seutje ;)
Comment #41
webchickThat new function needs some PHPDoc.
Comment #42
JacineOops. Here you go @webchick.
Comment #43
seutje CreditAttribution: seutje commentedhaven't been able to find any unwanted repercussions, but this feels a lot like RTBCing my own patch :x
Comment #44
JacineAll I did was add a comment, and I think this is ready, so RTBC +1. :)
Comment #45
tom_o_t CreditAttribution: tom_o_t commented#42: 875132-seutje.patch queued for re-testing.
Comment #46
webchickCommitted to HEAD. Thanks!