Updated: 1/26/2014

More Seven Theme issues: #1986434: New visual style for Seven

Problem/Motivation

TheStyle Guide for Seven aims to bring a stronger consistency to the Drupal admin interface, allowing contrib module UI components instead of writing their own custom CSS.

One common tool conveying information heirachy is proper use of headers. Web UIs are often limited on how they can use HTML header elements because they must respect the order of the DOM tree for accessibility reasons. This forces modules to write their own CSS to style the header elements. We aim to introduce several header CSS classes that are completely separated from the html elements.

Another tool for conveying heirachy is whitespace. It common for modules to have to write their own CSS to insert spacing between elements. We aim to introduce reuseable utility classes that applies vertical spacing consistency and inline with the base line height of the admin theme, improving vertical rhythm.

Proposed resolution/Demonstration

http://drupalcode.org/sandbox/ry5n/1932040.git/blob_plain/refs/heads/mas...

Remaining tasks

None

User interface changes

None

API changes

None

Comments

lewisnyman’s picture

Title: Add typographic components ad utility classes » Add typographic styles, components, and utility classes
frankbaele’s picture

Assigned: Unassigned » frankbaele
frankbaele’s picture

Issue summary: View changes

Updated issue summary.

lewisnyman’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new2.49 KB

No implementation yet, a good example would be applying .header-f to table headers and summary/legend elements.

Status: Needs review » Needs work

The last submitted patch, 3: seven-type-2028053.patch, failed testing.

rootwork’s picture

Assigned: frankbaele » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2.41 KB

Updated #3, which no longer applied.

Additionally, because Drupal 8 isn't supporting IE8, I don't think we need the pixel fallbacks for rems, so I didn't include them.

There might be more we want to do, but I at least wanted to get this applying to HEAD.

rootwork’s picture

Issue tags: +SprintWeekend2014

Tagging with the global sprint.

oheller’s picture

I'm going to review this patch.

oheller’s picture

I'm not sure how to test this. I've updated the summary to include the template and included some possible follow up actions.

Status: Needs review » Needs work

The last submitted patch, 5: drupal-seven-type-2028053-5.patch, failed testing.

The last submitted patch, 5: drupal-seven-type-2028053-5.patch, failed testing.

rootwork’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: drupal-seven-type-2028053-5.patch, failed testing.

rootwork’s picture

I don't understand why changing some CSS definitions would cause this test to fail -- it appears to be testing whether the CSS stylesheets exist and are in the right place. Maybe someone else could take a look.

lewisnyman’s picture

If you add a new stylesheet to Seven you need to add it to the array in the test in ThemeHandlerTest.php. Around line 292.

internetdevels’s picture

Status: Needs work » Needs review
StatusFileSize
new3.3 KB
new771 bytes

Hm, let's see...

rootwork’s picture

Ah, of course. Thanks.

lewisnyman’s picture

There isn't much wrong with this apart from missing the uppercase from header-c

This is a bit tricky because the font size changes were made with Source Sans in mind. Maybe we should keep the font sizes of h1,h2,h3 the same for now and just copy them over into the header-x classes?

lewisnyman’s picture

Issue tags: +frontend
dcam’s picture

Issue summary: View changes
Issue tags: +Needs reroll

Updating in preparation for DrupalCon Austin sprints. See http://www.hook42.com/blog/prepping-drupalcon-austin-sprints-sprint-lead....

#15 does not apply to HEAD and needs a reroll.

dcam’s picture

Status: Needs review » Needs work

Forgot the status, sorry.

vegantriathlete’s picture

Assigned: Unassigned » vegantriathlete

Working on this to re-roll.

vegantriathlete’s picture

Assigned: vegantriathlete » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new3.4 KB

rerolled patch attached

kbasarab’s picture

Status: Needs review » Needs work

Reroll looks good. Great work vegantriathlete. Only remaining issue is adding the text-transform: uppercase from #17.

vegantriathlete’s picture

Assigned: Unassigned » vegantriathlete

Will add changes as requested.

vegantriathlete’s picture

Assigned: vegantriathlete » Unassigned
Status: Needs work » Needs review
StatusFileSize
new3.42 KB
new386 bytes

New patch and interdiff attached.

lewisnyman’s picture

Issue summary: View changes
Status: Needs review » Needs work

Hey, just noticed that the h1 and h2 font size is the same.

+++ b/core/themes/seven/css/components/typography.css
@@ -0,0 +1,60 @@
+.header-a {
+  font-size: 20px;
+  font-size: 1.25rem;
+}

+++ b/core/themes/seven/seven.base.css
@@ -37,20 +37,26 @@ h6 {
 h1 {
-  font-size: 1.538em;
+  font-size: 1.25rem;
 }

These should be set to 21px and 1.3125rem for both

The h1,h2,h3 etc value should be identical to .header-a, .header-b, .header-c, etc values. It feels like we should just move them together into the same selectors instead of having to maintain the properties in two places.

I've updated the issue summary with all the places in Seven and system.admin.css that we could optimised with these classes. I'm not sure if it's a good idea to do it all in this issue but let's find out.

lewisnyman’s picture

Issue summary: View changes

I've just remembered that we already do this for a/.link selectors in seven.base.css. We should follow the same procedure here.

franxo’s picture

I had a look at that issue and I don't fully understand what you mean in the first part of #2028053-26: Add typographic styles, components, and utility classes:

+++ b/core/themes/seven/seven.base.css
@@ -37,20 +37,26 @@ h6 {
 h1 {
-  font-size: 1.538em;
+  font-size: 1.25rem;
 }
 h2 {
-  font-size: 1.385em;
+  font-size: 1.125rem;
 }

The h1 and h2 tags have different sizes: 1.25 and 1.125. I think that's correct. Is there any issue here?

franxo’s picture

Status: Needs work » Needs review
StatusFileSize
new2.92 KB
new4.31 KB

I think I fixed all the remaining reported problems from the issue summary. This is my first contribution, so be benevolent :)

Let me know if there is something wrong.

rootwork’s picture

franxo, thanks for contributing!

I think this happened further upthread, but the pixel fallback values seem to have reappeared. As I said in #5, as D8 isn't supporting IE8, I don't think these values are necessary any longer, and they should be removed. Lewis, what do you think?

rootwork’s picture

Status: Needs review » Needs work
lewisnyman’s picture

That is correct! it feels weird, but we should go rem only! Lets document this #2298015: [policy] Document when we should use each CSS unit

Let's remove the px values and then get some below/after screenshots just to make sure we haven't messed up the header sizes by mistake.

+++ b/core/themes/seven/style.css
@@ -1292,6 +1282,7 @@ details.fieldset-no-legend {
 .views-ui-display-tab-bucket h3 {
   font-size: 12px;
+  font-size: 0.75rem;
   text-transform: uppercase;
 }

I'd rather we deleted the CSS here and then added the correct class through the php/theme function, same with the CSS on admin/appearance

lewisnyman’s picture

Looks like #2298015: [policy] Document when we should use each CSS unit is put to bed, so we do want the px + rem values here.

    Two more things to update:

  1. +++ b/core/themes/seven/css/components/typography.css
    @@ -0,0 +1,20 @@
    +.trailer-double {
    +  margin-bottom: 40px;
    +  margin-bottom: 3.076rem;
    +}
    

    In #2307533: Insufficient space at page bottom we're adding an 80px value to page bottom, can we add trailer/leader triple and quadruple classes so we can replace it with a reusable class?

  2. +++ b/core/themes/seven/seven.base.css
    @@ -27,30 +27,55 @@ summary,
    -h1 {
    -  font-size: 1.538em;
    +h1,
    +.header-a {
    +  font-size: 20px;
    +  font-size: 1.25rem;
     }
    

    I think we need to maintain the same font sizes that we had before, to remove any potential for visual regressions from this issue.

lewisnyman’s picture

I think this issue has gotten stuck on the CSS units problem when we don't have to change the units to implement what we need, what if we just add the header-x classes next to the equivalent h1, h2, h3, etc selectors and ignore the units until we have a final decision?

thamas’s picture

Issue tags: +Amsterdam2014
thamas’s picture

Assigned: Unassigned » thamas
thamas’s picture

Assigned: thamas » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2.88 KB

Here is a new patch with a smaller scope. Unfortunately I can't provide an interdiff file, because the old patch cant be applied anymore and I was not able to make patchutils work on my machine…

I'm going to add screenshots a little bit later…

thamas’s picture

Assigned: Unassigned » thamas
rootwork’s picture

I'm not sure what kind of screenshots would be most helpful here, but from what I can tell this doesn't change the look of anything (which is the idea).

I had trouble finding admin pages with any header elements other than the title, but here's the available updates page, without the patch and with the patch:

And here's a sample page, with the theme set to Seven, without and with the patch:

Thamas are you still working on this? If not we should unassign it for the sprints tomorrow.

Leaving screenshots needed tag in case there's something more we want to see.

rootwork’s picture

Assigned: thamas » Unassigned

Unassigning so others can work on reviewing this today.

lewisnyman’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -needs screenshots

Thanks a lot for the screenshots! It would be great to get this in.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update

The issue summary and the patch do not match. Either the patch needs work to address everything listed in the summary or we need to update the summary.

lewisnyman’s picture

Issue summary: View changes
Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs issue summary update

Ah sorry Alex, I forgot to change the issue summary after simplifying the issue. Much better to start switching out classes in individual issues, so it's easier to test.

wim leers’s picture

  1. +++ b/core/themes/seven/css/base/typography.css
    @@ -0,0 +1,36 @@
    +* Reuseable utility classes that applies vertical spacing consistency
    

    s/applies/apply/

  2. +++ b/core/themes/seven/css/base/typography.css
    @@ -0,0 +1,36 @@
    +* and inline with the base line height of Seven.
    

    s/inline/in line/

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 93c6556 and pushed to 8.0.x. Thanks!

diff --git a/core/themes/seven/css/base/typography.css b/core/themes/seven/css/base/typography.css
index 1883adf..fd8e8eb 100644
--- a/core/themes/seven/css/base/typography.css
+++ b/core/themes/seven/css/base/typography.css
@@ -1,6 +1,6 @@
 /**
-* Reuseable utility classes that applies vertical spacing consistency
-* and inline with the base line height of Seven.
+* Reusable utility classes that apply vertical spacing consistency and in line
+* with the base line height of Seven.
 */
 .leader {
   margin-top: 20px;

Fixed #44 on commit and also the spelling of reusable.

  • alexpott committed 93c6556 on 8.0.x
    Issue #2028053 by vegantriathlete, franxo, InternetDevels, thamas,...

Status: Fixed » Closed (fixed)

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