This is a follow-up issue of #1337554: Develop and use separate branding for the installer.

Hey guys, great work but I don't like the how how the vertical aligning was solved. There is a much better way, check it out (and the blog post). With that way we wouldn't need any additional wrapper.

We are modern and not old school ;)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LewisNyman’s picture

Component: install system » Seven theme
Issue tags: +CSS, +Novice, +CSS novice

This is so much better. Let's keep the reusable class. Moving to Seven as that's where the CSS is.

yannickoo’s picture

Status: Active » Needs review
FileSize
4.28 KB

Let's start!

I'm confused with the CSS because we make use of body.install-page but the install-page.css is not used at any other places. The install-page-rtl.css is gone and everywhere we use [dir="rtl"] now, right?

LewisNyman’s picture

Looks good to me. Once we get green this is RTBC from me. Unfortunately we need to keep body.install-page in some cases because we need to override stronger selectors. See the comment at the top of the install-page.css

Screen Shot 2013-07-02 at 11.05.21.jpg

yannickoo’s picture

I talked with patrickd (creator of simplytest.me <3) and it's not bad that the status bar is also centered but this is not a Drupal core issue ;)

LewisNyman’s picture

All we need is a review or screenshot on IE9

yannickoo’s picture

FileSize
466.5 KB
24.91 KB

That solution works from IE7 (if you include *display: inline; *zoom: 1;) but here are two screenshots.

IE9
ie9.png

IE10
ie10.png

LewisNyman’s picture

Status: Needs review » Reviewed & tested by the community

Great stuff

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/system/templates/install-page.html.twigundefined
@@ -20,59 +20,55 @@
+      <div id="content" class="column">
+          {% if title %}<h1 class="title" id="page-title">{{ title }}</h1>{% endif %}
+          {% if messages %}{{ messages }}{% endif %}
+          <div id="content-content" class="clearfix">
+            {{ content }}
+      </div> <!-- /content -->

We should be fixing the spacing here...

The final close div here is closing content-content not content

+++ b/core/modules/system/templates/install-page.html.twigundefined
@@ -20,59 +20,55 @@
-        </div> <!-- /container -->
+    </div> <!-- /container -->

This seems to be closing content not container

... and also we are missing a closing div here...

balsama’s picture

Status: Needs work » Needs review
FileSize
3.29 KB
+++ b/core/modules/system/templates/install-page.html.twigundefined
@@ -20,59 +20,55 @@
+      <div id="content" class="column">
+          {% if title %}<h1 class="title" id="page-title">{{ title }}</h1>{% endif %}
+          {% if messages %}{{ messages }}{% endif %}
+          <div id="content-content" class="clearfix">
+            {{ content }}
+      </div> <!-- /content -->

After fixing the spacing, it looks to me like we're missing a closing div on #content-content. That also fixes the (perceived) missing div at the end.

Status: Needs review » Needs work

The last submitted patch, drupal-better_vertial_aligning_technique-2032895-9.patch, failed testing.

balsama’s picture

Status: Needs work » Needs review
FileSize
4.32 KB

That patch was missing the CSS file updates. New patch attached.

LewisNyman’s picture

Status: Needs review » Needs work
+++ b/core/themes/seven/install-page.cssundefined
@@ -29,23 +29,25 @@ body.install-page {
+    margin-right: -.3em;

This property seems slightly off, when I compare before/after side by side the after seems to be shifted slightly to the right.

yannickoo’s picture

Status: Needs work » Needs review
FileSize
518 bytes
4.32 KB

It's centered when we use margin-right: -.35em;. I also removed the space in the content property, it's unnecessary :)

LewisNyman’s picture

Status: Needs review » Reviewed & tested by the community

Great! Thanks.

tim.plunkett’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/themes/seven/install-page.cssundefined
@@ -29,23 +29,25 @@ body.install-page {
+    margin-right: -.35em;

-0.35em, might as well get it right the first time.

Also, can you post a -do-not-test patch rolled with git diff -w so the template file changes are clearer?

yannickoo’s picture

Status: Needs work » Needs review
FileSize
1.88 KB

Oh yeah, totally forgot that -w option ;)

tim.plunkett’s picture

Thanks, that makes it very very clear what is happening here, and shows what an improvement it is!

Just reupload #13 but with -0.35m instead of -.35em and it should be RTBC.

balsama’s picture

I'm stealing this patch back. Swoop.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

LewisNyman’s picture

I read this article today: http://html5hub.com/centering-all-the-directions/#i.bwg1ds4z3emh11

Is there a better technique we could use?

LewisNyman’s picture

I read this article today: http://html5hub.com/centering-all-the-directions/#i.bwg1ds4z3emh11

Is there a better technique we could use?

LewisNyman’s picture

I read this article today: http://html5hub.com/centering-all-the-directions/#i.bwg1ds4z3emh11

Is there a better technique we could use?

LewisNyman’s picture

I read this article today: http://html5hub.com/centering-all-the-directions/#i.bwg1ds4z3emh11

Is there a better technique we could use?

Status: Reviewed & tested by the community » Needs work
Issue tags: -CSS, -Novice, -CSS novice

The last submitted patch, drupal-better_vertial_aligning_technique-2032895-18.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
Issue tags: +CSS, +Novice, +CSS novice
yannickoo’s picture

@#17 why is the zero important?

tim.plunkett’s picture

It makes it more readable (it's not -35em), and it's in our coding standards.

Status: Needs review » Needs work

The last submitted patch, drupal-better_vertial_aligning_technique-2032895-18.patch, failed testing.

yannickoo’s picture

Status: Needs work » Needs review

position: absolute; is not a good idea because it does not work when the content is longer than the wrapper.

balsama’s picture

Let's try this again from a fresh clone.

LewisNyman’s picture

Status: Needs review » Reviewed & tested by the community

The code looks good, the patch applies.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

LewisNyman’s picture

Status: Closed (fixed) » Needs work
FileSize
598.1 KB

We noticed a bug with that appears when the page container is longer than the viewport. We attempted to fix it as part of #2094445: Fix installer right padding - make it look balanced but it was more complex than it first appears... I think that the vertical centering introduced here is not capable of accommodating both situations.

Let's give it another try otherwise I think we should revert this commit.

Screen Shot 2013-09-21 at 15.37.51.png

Berdir’s picture

FileSize
802.95 KB

I have the LastPass browser plugin installed and it displays a message at the top which causes a beautifully blue page ;) Aka, the actual content is moved down below what I can see. Was asked to put a screenshot in here.

blue.png

balsama’s picture

Status: Needs work » Needs review
FileSize
908 bytes

If I understand correctly, we just want some blue space above and below `#page` when `#page` takes up all or more than the available vertical area. We can accomplish this by adding top padding to the `body` (1em), top margin to `#page` (1em) and relatively positioning `#page` to -1em. Patch attached (I also alphabetized the rules within the `body.install-page #page` selector).

yannickoo’s picture

Works fine for me :) We could discuss whether it's better to use margin-top or top but I'm fine with top :)

mcrittenden’s picture

Status: Needs review » Needs work

I have the same exact issue as Berdir in #35 (also caused by lastpass) and the patch in #36 does not fix it for me.

It's because lastpass adds a div like this directly after the opening body tag:

<div id="lptopspacer58606835" style="height: 27px;"></div>

Setting display:none; on that fixes the issue, so that's definitely the culprit.

LewisNyman’s picture

I'm not sure what to do here, plugins shouldn't be adding elements to the page that affects the flow of the DOM. That's asking for trouble. Is it possible to open an issue against the plugin?

LewisNyman’s picture

Issue tags: -Novice, -CSS novice

This is no longer novice

LewisNyman’s picture

Status: Needs work » Needs review
Kendall Totten’s picture

I applied the patch from #36 but that does not appear to solve the problem. My understanding is the goal of this issue is to vertically align the #page element, not just add a bit of space (1em) above it which is what #36 does.

From what I can tell, the issue is that the lastpass plugin (and likely other password plugins like it) inject a div as the first element inside the body tag. It ends up right in between the body:before element and the #page element, which causes the :before element to sit above the #page element instead of being in line with it. This is what causes the giant blue gap.

I changed the pseudo class to :after, which fixes the problem. I also removed the negative right margin and instead used font-size: 0px to combat the small horizontal #page shift that the pseudo element causes.

Tested in Chrome & Firefox.

This patch was created as a part of the code sprint at #dcATL

jlporter’s picture

#42 works for me, although I don't use last pass. Tested against freshly pulled 8.x-dev on existing site and viewed in chrome on a chromebook.

nod_’s picture

It's the install page, i don't mind adding 3 lines of JS to center this thing if the content height is smaller than the screen.

eigentor’s picture

Some feedback from a Design perspective: When I last installed 8.x I think I saw the outcome of the patch:
The box is always centered vertically in the window when it is not higher than the screen.
Is that right?

I have done site designs like this and turned away from if for reasons: It may make the top of the page jump around on different pages depending on their height.
This looks inconsistent and probably not what we want.
So the approach that apparently #36 uses would be more in line with what web pages normally do.

The submit button might be in a different place for every page, but I'm pretty sure it is easier to find if the top of the box and thus the header is always in the same place.

I think the isue started because the box did not have any space above it when it was higher than the screen and touched the top of the browser window. This looks wrong indeed.

If this would not strike up the problem of someone having to do it, it might be up for some quick and dirty user testing. Away with vertical centering, it is so 2000, when webpages lived in little boxes that were smaller than the screen.

corbacho’s picture

I'm a Lastpass user for more than 2 years and I've never seen the Lastpass bar to mess up a page like this.
This is the HTML introduced by Lastpass. It's just creating a empty space that is actually covered by an iframe that is position:absolute'd

<div id="lptopspacer33521325" style="height: 27px;"></div>
Database_configuration___Drupal.png

The patch #42 by Kendall works perfectly (as you can see in the screenshot). I tested in Chrome.

The only problem...

+++ b/core/themes/seven/install-page.css
@@ -50,6 +50,10 @@ body.install-page {
+    margin-top: 1em;
+    max-width: 770px;
+    top: -1em;
+    vertical-align: middle;

The vertical-align and max-width properties are duplicated, so the duplicated ones are removed in this patch:

LewisNyman’s picture

Status: Needs review » Needs work
FileSize
699.1 KB

The latest patch does not appear to fix the problem, we are still missing some space at the top when the content is taller than the screen.

Screen Shot 2013-10-23 at 09.14.11.png

yannickoo’s picture

Status: Needs work » Needs review
FileSize
697 bytes
  1. +++ b/core/themes/seven/install-page.css
    @@ -33,13 +33,13 @@ body.install-page {
    -  body:before {
    +  body:after {
    

    I don't care when a 3rd party extension breaks a website because it changes the HTML structure. That also could happens when an extension puts stuff before the </body> but that is a good idea.

  2. +++ b/core/themes/seven/install-page.css
    @@ -33,13 +33,13 @@ body.install-page {
    -    margin-right: -0.35em;
    +    font-size: 0;
    

    You cannot fix that with setting the font size to 0. We need the margin right.

  3. +++ b/core/themes/seven/install-page.css
    @@ -50,6 +50,8 @@ body.install-page {
    +    margin-top: 1em;
    +    top: -1em;
    

    That doesn't make sense because you don't really move it. I set it to 6em and pull it by 3em to the top so that the #page has more space to breathe.

I also changed the order due to the CSS formatting guidelines but we also need a follow-up issue for that. Try to put all the CSS of the install-page.css into CSScomb then you can see that we have to work on that ;)

corbacho’s picture

Thanks Yannick for the fixes and the CSS guidelines links. I didn't know about CSSComb :)
About 2: True, now is really centered. The margin-right was needed.
About 3 . I will prefer that there is smaller top margin

margin-top: 2em;
top: -1em;

makes the same effect. And the less scrolling the better IMHO, but it's good.

I tested throughly the patch in different browsers and only 2 things to say:

* The margin-right works in Webkit browsers, but not Firefox or IE. I've tried different solutions. The easiest: Apply a "width:1px" and it will work.

* This is very very minor thing. But the negative "top" creates a taller viewport somehow, that makes the scrollbar appears when still there is no need (compared to same page of the installer without the patch). That's why also, the smaller the margin, smaller side-effect.

Reroll of #48, addressing these 2 issues and screenshot attached

LewisNyman’s picture

Is this solution really better than the display: table-cell; it replaced? This CSS seems extremely fragile and tricky to understand.

corbacho’s picture

I agree is getting hairy. What about this?
Here is a patch only touching CSS, no markup, no pseudoselectors and no negative values.
It works in all browsers equally where I tested, even IE9. No conflicts with LastPass bar and neither with Simplytest.me bottom bar.

Vertically aligned with
display:table-cell
The classic for horizontal alignment:
margin: 0 auto;

I applied CSSComb to the selectors I've touched. I removed all the text-align, white-space, etc that was introduced originally in https://github.com/drupal/drupal/commit/cb829e19065ebfe120d36db84c5a64e7...

yannickoo’s picture

Status: Needs review » Needs work

Works fine! The solution was from here but in this case we also can use another easy CSS solution with no additional markup.

There is only one minor thing: We don't have to set the width because we already have a max-width.

+++ b/core/themes/seven/install-page.css
@@ -27,28 +27,24 @@ body.install-page {
+    width: 75%;

This is not necessary.

LewisNyman’s picture

Status: Needs work » Needs review

The width property was already in the CSS. Let's just stick to fixing the problem in the title. We need some width set.

yannickoo’s picture

Status: Needs review » Reviewed & tested by the community

I would say that the patch from #51 is RTBC :)

LewisNyman’s picture

Yep this looks good, RTBC++

yannickoo’s picture

It is funny that we use the same technique but just with less markup now :D

yannickoo’s picture

Issue summary: View changes

Just added missing bracket.

alexpott’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Committed 52de922 and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.