There are some repetitive width properties set in the admin interface. We can make these more consistent by created generic layout classes and applying them the relevant elements. Contrib modules could also use these for more complex admin interfaces without having to write their own layout CSS.

Test steps

The branding header margins and the general page margins should align
The admin/config page should be displayed in two columns on large screens.

CommentFileSizeAuthor
#86 Screen Shot 2014-06-06 at 19.52.10.jpg248.7 KBLewisNyman
#84 create_generic_layout-2017257-84.patch5.32 KBjason.bell
#83 seven-layout-styles-2017257-83.patch5.31 KBdead_arm
#76 layout-styles-admin-classes-before-after.png624.23 KBphilipz
#70 re-roll-2017257-70.patch5.18 KBLewisNyman
#66 screen1.png20.84 KBalexrayu
#66 screen2.png9.54 KBalexrayu
#66 re-roll-2017257-66.patch8.41 KBalexrayu
#59 interdiff.txt1.98 KBrteijeiro
#59 seven-layout-styles-2017257-59.patch7.53 KBrteijeiro
#58 seven-layout-styles-2017257-58.patch8.45 KBphilipz
#54 seven-layout-styles-2017257-52.patch8.87 KBLewisNyman
#48 Zrzut ekranu 2014-01-12 o 17.43.51.png146.58 KBphilipz
#48 interdiff.txt343 bytesphilipz
#48 seven-layout-styles-2017257-48.patch8.45 KBphilipz
#46 Screen Shot 2014-01-10 at 10.51.21.jpg145.36 KBLewisNyman
#45 interdiff.txt844 bytesphilipz
#45 seven-layout-styles-2017257-45.patch8.45 KBphilipz
#41 seven-layout-styles-2017257-41.patch7.63 KBphilipz
#40 seven-layout-styles-2017257-40.patch7.63 KBphilipz
#37 seven-layout-styles-2017257-37.patch8.61 KBLewisNyman
#35 seven-layout-styles-2017257-34.patch8.59 KBLewisNyman
#35 interdiff.txt879 bytesLewisNyman
#29 seven-layout-styles-2017257-28.patch7.73 KBrteijeiro
#27 seven-layout-styles-2017257-27.patch9.07 KBLewisNyman
#23 interdiff-2017257-22-23.txt2.91 KBidebr
#23 seven-layout-styles-2017257-23.patch8.98 KBidebr
#22 seven-layout-styles-2017257-22.patch8.67 KBrteijeiro
#19 seven-layout-styles-2017257-18.patch10.15 KBLewisNyman
#16 seven-layout-styles-2017257-16.patch8.68 KBemma.maria
#13 Screen Shot 2013-06-29 at 17.21.09.png120.38 KBemma.maria
#13 seven-layout-styles-2017257-13.patch16.4 KBemma.maria
#9 seven-layout-styles_3.patch6.51 KBfrankbaele
#7 seven-layout-styles_3.patch6.19 KBfrankbaele
#5 seven-layout-styles_2.patch5.2 KBfrankbaele
#1 seven-layout-styles.patch4.54 KBLewisNyman
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LewisNyman’s picture

Status: Active » Needs review
FileSize
4.54 KB

Status: Needs review » Needs work

The last submitted patch, seven-layout-styles.patch, failed testing.

LewisNyman’s picture

Issue tags: +CSS, +Novice, +CSS novice
frankbaele’s picture

Assigned: Unassigned » frankbaele
frankbaele’s picture

Status: Needs work » Needs review
FileSize
5.2 KB

updated the patch and used a fluid layout system

LewisNyman’s picture

Status: Needs review » Needs work

Hey Frank,

This looks good but it looks like there's an error in the patch. By default when you git diff a patch it won't include new files. The way I add files is like this:

  1. Stage (git add) every file that's part of the patch
  2. Run git diff --cached > the-patch.patch

That will include every file that is staged.

frankbaele’s picture

Status: Needs work » Needs review
FileSize
6.19 KB

Status: Needs review » Needs work

The last submitted patch, seven-layout-styles_3.patch, failed testing.

frankbaele’s picture

FileSize
6.51 KB

ok, hope i redeem myself with this patch,

frankbaele’s picture

Status: Needs work » Needs review
rteijeiro’s picture

Status: Needs review » Needs work

I guess we should use [dir="rtl"] statement for LTR selectors like margin, padding...

emma.maria’s picture

Assigned: frankbaele » emma.maria
emma.maria’s picture

Work carried out in this patch.

  1. Removed leftover margins and paddings on #page selectors in style.css that were clashing with layout.css.
  2. The h1 title and breadcrumb on the overlay and pages were missing the new layout classes or not lined up with the rest of the page elements, so I've amended CSS and Twig files for them.
  3. The overlay close wrapper that is positioned absolute was missing its positioning so I've added styles for that.
  4. All CSS files that I have changed I have replaced the [dir=rtl] with [dir="rtl"] as per #2015789: Remove language_css_alter() (RTL stylesheets) in favor of HTML 'dir' attribute.
  5. I have added "rtl" styles to layout.css
  6. I also noticed that a max-width in layout.css was breaking the layouts (see pic) I have removed the max-width and all is well again.
  7. There was also an IE7 fix within layout.css that shouldn't be there, so that has been removed too.
emma.maria’s picture

Assigned: emma.maria » Unassigned
Status: Needs work » Needs review
rteijeiro’s picture

Status: Needs review » Needs work
+++ b/core/modules/overlay/css/overlay-child.cssundefined
@@ -95,12 +97,12 @@ html[dir=rtl] {
+  margin: -28px 0 0 0; ¶

Remove trailing space :)

+++ b/core/themes/seven/layout.cssundefined
@@ -0,0 +1,68 @@
+    float:right;  ¶

Remove trailing spaces :P

+++ b/core/themes/seven/style.cssundefined
@@ -63,8 +63,8 @@ dl dl {
+[dir="rtl"] dl dl {
   margin-right: 20px;
 }

Should add margin-left: 0; here?

emma.maria’s picture

Status: Needs work » Needs review
FileSize
8.68 KB

Thanks for pointing those things out. I have removed the trailing spaces and added the margin-left that was needed.

LewisNyman’s picture

Issue tags: -CSS, -Usability, -Novice, -styleguide, -CSS novice

Status: Needs review » Needs work
Issue tags: +CSS, +Usability, +Novice, +styleguide, +CSS novice

The last submitted patch, seven-layout-styles-2017257-16.patch, failed testing.

LewisNyman’s picture

Status: Needs work » Needs review
FileSize
10.15 KB

Re-rolled

rteijeiro’s picture

Status: Needs review » Reviewed & tested by the community

Patch applies well and code seems ok. Let's wait for "Green" and go fo RTBC!

webchick’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/themes/seven/templates/page.html.twig
index a58d60e..fe16cfc 100644
--- a/sites/default/default.settings.php

--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php

Erm. I'm pretty sure none of this has anything to do with this patch. :) Needs a re-roll?

rteijeiro’s picture

Status: Needs work » Needs review
FileSize
8.67 KB

Re-rolled!

idebr’s picture

Changes from #22:

  • Rerolled against HEAD; patch no longer applied
  • Fixed a few css coding standards along the way, see interdiff-22-23.txt
LewisNyman’s picture

The last submitted patch, 23: seven-layout-styles-2017257-23.patch, failed testing.

LewisNyman’s picture

Status: Needs review » Needs work
LewisNyman’s picture

FileSize
9.07 KB
LewisNyman’s picture

Status: Needs work » Needs review

rerollolololol

rteijeiro’s picture

Re-rolled.

Status: Needs review » Needs work

The last submitted patch, 29: seven-layout-styles-2017257-28.patch, failed testing.

emma.maria’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 29: seven-layout-styles-2017257-28.patch, failed testing.

LewisNyman’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 29: seven-layout-styles-2017257-28.patch, failed testing.

LewisNyman’s picture

Status: Needs work » Needs review
FileSize
879 bytes
8.59 KB

Status: Needs review » Needs work

The last submitted patch, 35: seven-layout-styles-2017257-34.patch, failed testing.

LewisNyman’s picture

Status: Needs work » Needs review
FileSize
8.61 KB

You SHALL pass!

philipz’s picture

Recently commited install-page.html.twig #2041793: install-page.html.twig markup and CSS adds one element with l-container class around all 'regions'.
This patch adds the class both inside #branding but on #page element. Is this made like that on purpose? Looks somewhat inconsistent.

It does not apply anymore too. I will re roll this in couple of hours.

LewisNyman’s picture

Let's re-roll this inline with the changes in #2041793: install-page.html.twig markup and CSS

philipz’s picture

First a re-roll of #37 just to have a starting point... and now I'll look what can be improved inline with #2041793: install-page.html.twig markup and CSS.

philipz’s picture

FileSize
7.63 KB

Small fix.

The last submitted patch, 40: seven-layout-styles-2017257-40.patch, failed testing.

philipz’s picture

After looking through the code I think it's the #2041793: install-page.html.twig markup and CSS that will need updating after this gets in not the other way around.

The install page css uses l-container class for more than just layout (background: #fff;) and duplicates it's layout rules.
So the current <div class="l-container"> in install-page.html.twig could probably become <div id="page" class="l-container"> and css in install-page.css will be simplified too.

This fill need a small follow up issue but let's get this one in first.

Status: Needs review » Needs work

The last submitted patch, 41: seven-layout-styles-2017257-41.patch, failed testing.

philipz’s picture

Status: Needs work » Needs review
FileSize
8.45 KB
844 bytes

Failing test fix added.

LewisNyman’s picture

Clicking around most things look fine, apart from the update page. Adding related issues that cross paths with this patch.

the update.php page looking off/

LewisNyman’s picture

Oh also, it would be great to replace #page with .page :)

philipz’s picture

I've added #page padding back (it was removed in #41). This was breaking other pages too but you might have not seen it if you didn't open any page with secondary tabs.
The reason why this sometimes was not seen is #console which - at least in Chrome - was making top padding on some pages.

Secondary tabs problem

philipz’s picture

Status: Needs work » Needs review

Changing #page to .page (or just moving all the styling to .page but leaving #page id in html?) might be a good idea but for a follow-up issue? :)
It's not only #page but #branding, #footer and more.

LewisNyman’s picture

It does, let's make another issue to clean up the Seven page.tpl.php. I think we can actually get rid of the #console div and get away with it.

LewisNyman’s picture

Status: Needs review » Needs work

The last submitted patch, 48: seven-layout-styles-2017257-48.patch, failed testing.

LewisNyman’s picture

Status: Needs work » Needs review

Reroll and tidy up. I also implemented the columns in the admin panels in the admin/config page.

LewisNyman’s picture

philipz’s picture

Status: Needs review » Reviewed & tested by the community

The patch looks good, applies correctly and needs cache clearing if anyone is testing too.

I think this could be commited and then a follow up applied to other places like node add/edit form, blocks layout and so on.
This should move forward so changing status:)

tstoeckler’s picture

+++ b/core/modules/system/system.admin.inc
@@ -177,7 +177,7 @@ function theme_admin_page($variables) {
-        $block['position'] = ++$stripe % 2 ? 'left' : 'right';
+        $block['position'] = ++$stripe % 2 ? 'boob' : 'right';

Is this some sort of new-age themer lingo? :-) Otherwise I don't think this is correct.

philipz’s picture

Status: Reviewed & tested by the community » Needs work

Haha, nice catch :D

philipz’s picture

Status: Needs work » Needs review
FileSize
8.45 KB

No more boob.

rteijeiro’s picture

Re-rolled and fixed some minor things.

Not sure about leaving $stripe variable and $block['position'] array in template_preprocess_admin_page() function, but if I remove it it breaks the two column layout in admin/config. Any ideas?

ckrina’s picture

Assigned: Unassigned » ckrina
ckrina’s picture

Assigned: ckrina » Unassigned

#59 patch applies fine.

philipz’s picture

Status: Needs review » Needs work

There's still some unnecessary left and right margins on #page - around line 435-450 in style.css.

Manuel Garcia’s picture

LewisNyman’s picture

Issue tags: +Needs reroll
alexrayu’s picture

Assigned: Unassigned » alexrayu

Taking up for re-roll.

alexrayu’s picture

FileSize
8.41 KB
9.54 KB
20.84 KB

Re-rolling the patch.

alexrayu’s picture

Re-rolling the patch.

alexrayu’s picture

Assigned: alexrayu » Unassigned
Status: Needs work » Needs review
LewisNyman’s picture

Status: Needs review » Needs work

Looks like the layout.css has falling out of the reroll. There are a few other unintentional changes to. I'll have another go rerolling it.

LewisNyman’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
5.18 KB

Ok, I've had a go at rerolling. The aim here is to have no UI changes but we now have reusable classes.

philipz’s picture

Status: Needs review » Reviewed & tested by the community

This looks RTBC. Nice and simple :)

I'll make a separate issue for my comment from #62.

cosmicdreams’s picture

+++ b/core/themes/seven/css/layout.css
@@ -0,0 +1,35 @@
+  .l-column + .l-column {
+    padding-left: 10px;
+  }
+  .l-column.half {
+    width: 50%;
+  }
+  .l-column.quarter {
+    width: 25%;
+  }
+  .l-column.three-quarter {
+    width: 75%;
+  }

To my knowledge, you can't name a class or an ID that starts with a number.

http://www.markinns.com/articles/full/using_numbers_as_css_class_or_id_v...

cosmicdreams’s picture

Oh is that an L nevermind.

sun’s picture

Status: Reviewed & tested by the community » Needs review

This patch removes generic styles from system.admin.css.

Therefore, we need screenshots of affected output in Stark (and possibly also Bartik).

philipz’s picture

Assigned: Unassigned » philipz

I'm on it. I'll make some screenshots of config page, blocks page and node edit page.

philipz’s picture

Assigned: philipz » Unassigned
FileSize
624.23 KB

Since this patch removes from system.admin.css mostly div.admin .left and div.admin .right (and a top padding for div.admin) the only page that changes is admin/config.

Layout classes admin/config before and after

emma.maria’s picture

Issue tags: +frontend
emma.maria’s picture

Title: Create generic layout classes » [META] Create generic layout classes
emma.maria’s picture

Title: [META] Create generic layout classes » Create generic layout classes
LewisNyman’s picture

Issue tags: +focus

We are almost there with this one. Let's get this done in Austin

emma.maria’s picture

Status: Needs review » Needs work

All .l-... classes need to be converted to .layout-.. classes to match the policy change in [policy, no patch] Use layout- prefixes instead of l- in CSS Coding Standards

dead_arm’s picture

Assigned: Unassigned » dead_arm

Sprinting on this

dead_arm’s picture

Status: Needs work » Needs review
FileSize
5.31 KB

Changed classes to use "layout-"

jason.bell’s picture

Couple of issues I hit in review:

  • layout.css is in the wrong place as set in seven.info.yml
  • .layout-colum + .layout-column was broken

Attached fixes those.

LewisNyman’s picture

Issue summary: View changes
Issue tags: +Needs manual testing

Added test pages

LewisNyman’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: -CSS novice, -Needs manual testing
FileSize
248.7 KB

This patch actually doesn't touch the install/update pages. Lets do that in another patch. I updated the issue summary and took a screenshot of the layout lining up using the generic classes. Looking forward to removing more custom layout CSS.

jason.bell’s picture

Just looking over that patch again and wondering about usage of px vs. em. Should we make one last change?

.layout-column + .layout-column {
  padding-left: 1em;
}
LewisNyman’s picture

Good point, the margins for the container use em. I'm not actually sure if it is desirable behaviour to increase gutters when font size increases. we generally want more space not less? Feel free to have a play around with the value, as long as the two column layout on the config page doesn't look weird.

jason.bell’s picture

Just playing around with adjusting the base font-size in seven.base.css it’s a very minor difference between 10px and 1em, though I might prefer the proportional measurement. It doesn't seem important enough to hold back this last patch unless we have consensus to focus on proportional vs. fixed units as a rule.

LewisNyman’s picture

I'm happy to audit all the unit in Seven and figure out a consistent pattern in another issue

dead_arm’s picture

Assigned: dead_arm » Unassigned
bdevore’s picture

Proportional units are in my opinion more future-proof and device agnostic.

  • webchick committed 7f55520 on 8.x
    Issue #2017257 by jason.bell, dead_arm, alexrayu, philipz, idebr,...
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Hey, folks. Really sorry about how long this sat there. My post-DrupalCon life got a bit hectic. :(

Aside from unit concerns mentioned above, the only part here that looks a little questionable to me is:

+++ b/core/modules/system/templates/admin-page.html.twig
@@ -16,8 +16,8 @@
-  {% for position, container in containers %}
-    <div class="{{ position }} clearfix">
+  {% for container in containers %}
+    <div class="layout-column half clearfix">

because "half" seems pretty prescriptive of how this is going to be displayed, for a core template.

OTOH, I think there's a lot of value in splitting off the layout-specific stuff into a separate CSS that can be overridden. We can probably go with this for now and make further tweaks in follow-up issues.

Committed and pushed to 8.x. Thanks!

LewisNyman’s picture

Status: Fixed » Needs work

Here are two follow ups to this issue:

#2298001: Remove #page CSS from Seven
#2298015: [policy] Document when we should use each CSS unit

@webchick Thanks :) Maybe we need to have a policy discussion about non semantic helper classes. Seven's style guide is based around reusable classes for modules, because there's no way to style contrib.

LewisNyman’s picture

Status: Needs work » Fixed
chx’s picture

There should be a third which fixes poor minimal admin pages becoming single column .

LewisNyman’s picture

@chx Yep I'm definitely up for adding more and expanding them.

chx’s picture

That was a bug report...

LewisNyman’s picture

Ok then I don't understand the report. Screenshot?

chx’s picture

http://i.imgur.com/LkPY9H2.png that's admin/config and should be two columns.

LewisNyman’s picture

Status: Fixed » Closed (fixed)

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