Obviously, this theme was themed by someone not familiar with Drupal theming.

Note that this is just a start. Most of the styles in in defaults.css + system.css + vertical-tabs.css can most probably vanish.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Tagging.

Nick Lewis’s picture

Title: Seven flexxx - rrrrrrrrrrrrrrrrrrrrrrrrr » Seven's Stylesheet Could Lose Weight

(seemed like at least a slightly better title)

A generalized clearfix solution would be nice to have available to any drupal theme -- not just seven.

Some of this patch is pretty opinionated it seems, but i happen to agree with a lot of the opinions (sneaking clearfix into commonly used css classes instead of just clearfixing the markup is harder to track down -- imho... the less clearfixing done the better anyhow -- )

alanburke’s picture

We already have a clearfix class in defaults.css
#371231: Rename clear-block CSS class to clearfix

alanburke’s picture

I talked to cwgordan [at least I think that's who it was] at DC Paris in relation to the Seven theme.
Does it have a particular maintainer?

We discussed the reset.css file which is in the theme.
I would prefer a reset.css file to be at the top of the list of CSS files.
He believed the Seven theme reset.css file had to be in the middle of the stack as it reset a number of Drupal's default styling in modules css files.

I would prefer an overall reset.css [for resetting browser defaults] file at the top, and a second reset file [reset-drupal.css perhaps], which then undoes any default drupal styling if required.

The patch is good start!

Some issues.
Because a new defaults.css file is declared, Drupal's own defaults.css file is not loaded.
There is no need for this new file as the clearfix class is contained within Drupals own defaults.css file.

While could could copy, and customise Drupal's own css files to our needs.
I would rather just override what we need to, as the theme originally did.

I'm pretty sure I heard there is some relatively simple way to override how Drupal loads the css files,
so that we could push the reset.css in the theme to the top of the stack.
Anybody know how?

alanburke’s picture

FileSize
16.23 KB

Updated patch.
The only change to Sun's patch is leaving defaults.css where it is.

alanburke’s picture

FileSize
16.42 KB

Another version of this patch.

A new file called drupal-reset.css,
Just used to reset Drupal default styling.
It currently contains the only change I could find between Sun's system.css and Drupal's default system.css.

Removed the defaults.css declaration from the info file.
Added the inclusion of drupal-reset.css file.

Will need to find a way to move the reset.css file up the stack.

alanburke’s picture

Priority: Critical » Normal
FileSize
16.46 KB

Another update.
Resetting of Drupal elements was removed.
Moved into drupal-reset.css file.

Debateable exactly how much of this resetting is needed.

alanburke’s picture

FileSize
16.53 KB

Moved one element of styling into style.css that was in drupal-reset.css.

sun’s picture

To clarify what I was doing:

- reset.css in Seven should only contain the usual browser reset styles. Either we keep the beginning of reset.css (dropping the rest) or simply replace it with one of the many snippets on the net.

- There is no point in overriding all stylesheets that happen to appear somewhere in core when Seven uses completely different styles anyway. This is a totally customized theme, so it's totally senseless to load the original defaults.css, system.css, system-menus.css, and, and, and, just to override 90% of all styles defined in there.

- This means that Seven theme in core is literally facing the same issue as every other themer on this planet: We want to override a bunch of stylesheets - but we don't really want to load them all of the time. Instead, those overrides should only be loaded when the original ought to be loaded. Therefore I created #575298: Provide non-PHP way to reliably override CSS. That issue should also tackle the major problem that overridden stylesheets are currently loaded/appended to the end of the stylesheet stack - instead of replacing the original position of the original stylesheet in the stack.

- There is no point in having a drupal-reset.css for the aforementioned reasons. (Aside from that, this file doesn't seem to be contained in the patches)

Bojhan’s picture

Issue tags: -Needs usability review

Does not sound like something, I or anyone from the team should review.

alanburke’s picture

I'm pretty sure I heard there is some relatively simple way to override how Drupal loads the css files,
so that we could push the reset.css in the theme to the top of the stack.
Anybody know how

For anybody following along....
Found it - http://api.drupal.org/api/function/drupal_add_css/7

alanburke’s picture

FileSize
19.04 KB

My ham-fisted patching attempts continue.

This should include the new reset-drupal.css.

Instead of listing the reset.css file in seven.info,
it is now added in seven_preprocess_page through drupal_add_css which lets us assign a weight which pushes it to the top of the css stack.

Now all that done, I'll have a look at Sun's comments later on.

Status: Needs review » Needs work

The last submitted patch failed testing.

sun’s picture

Issue tags: +API clean-up

Your patch doesn't apply.

sun’s picture

Title: Seven's Stylesheet Could Lose Weight » Seven theme clean-up
Priority: Normal » Critical
droplet’s picture

some css can clean up with css shorthand


 tr.even, tr.odd {
   border-width: 0 1px 0 1px;
   border-style: solid;
   border-color: #bebfb9;
   background: #f3f4ee;
 }

 tr.even, tr.odd {
   border:1px solid #bebfb9; /* OR border:solid #bebfb9; */
   border-width: 0 1px 0 1px;
   background: #f3f4ee;
 }

/* --------------- ------------------- --------------- */

   border: 1px solid #e4e4e4;
   border-bottom: 1px solid #b4b4b4;
   border-left-color: #D2D2D2;
   border-right-color: #D2D2D2;


   border: 1px solid #e4e4e4;
   border-color: #e4e4e4 #D2D2D2 #b4b4b4;

/* --------------- ------------------- --------------- */

/* remove css already defined in reset.css. if it necessary, we can combine them into shorthand */

body {
   font-style:normal;
   line-height: 20px; 
}

for international user, I don't recommand font-size small than 11px.
it brings some language like Chinese / Japanese very hard to read.

Bojhan’s picture

cough, for any user I don't recommend smaller then 11px.

jix_’s picture

Regarding the massive CSS reset; I just posted #592018: Re-organize styles across stylesheets from system.module and separate presentational and behavior-supporting styles

If it gets in, we could remove like half the reset and just override defaults.css. system.css should just contain functional stuff (like #autocomplete and body.drag) that themers don't need to touch.

Damien Tournoud’s picture

Marked #595806: larger font-size in Seven theme as a duplicate of this issue.

quicksketch’s picture

This is a good patch but could use a splitting up. Specifically I think these should be separate patches:

- Removing the extra white spaces.
- Removing the wacky clear-fix redundancy.
- Adding reset.css through drupal_add_css() instead of through the .info file.

Also #592018: Re-organize styles across stylesheets from system.module and separate presentational and behavior-supporting styles is a great patch that I think we should get in first.

Gábor Hojtsy’s picture

@sun: I hope @yhahn will not take it personally that "obviously, this theme was themed by someone not familiar with Drupal theming" with which you kicked off this thread. Cleanups are welcome, but let's not refer to personal qualities.

sun’s picture

I'm pretty sure that the theme didn't went in as it was.

Regardless of that, the theme is a total mess. And it seems like no one really cares. We definitely need a monster patch like one of the patches in this issue, because there's almost nothing in this theme that looks correct.

Due to that, I started to completely skip checking proper output/look in Seven theme when doing UX/UI patches. There's no "proper" in there at all.

sun’s picture

FileSize
20.5 KB

Honestly, I have no idea why Seven was so horribly destroyed when it was moved into core. What was wrong with this?

admin-theme.png

Bojhan’s picture

I dont get why you are pointing to Dev Seed its theme. Its clearly not, what we wanted to do?

jensimmons’s picture

Where is this at?

I was looking today at a bug / something that I think needs improvement (any body of text, like help text, in Seven has no margin on p or anything on li so everything just runs together in a giant pile of words — and I think some margins would make text more readable...)

but, it's hard to know where to jump in with a format fix like that for Seven because this patch, and #592018: Re-organize styles across stylesheets from system.module and separate presentational and behavior-supporting styles, are in limbo.

What does this need? Where is it stuck? Should we just move on without these two patches and ignore them?

Gábor Hojtsy’s picture

@sun: that is an admin theme proposal submitted by DevelopmentSeed and did not implement the theme designed in the D7UX process. There are various admin themes to choose from for site maintainers, including this theme/module you posted the screenshot of in contrib: http://mogdesign.eu/blog/10-drupal-administration-themes so people will be able to pick what fits them best.

yoroy’s picture

I'm not sure if this issue is helpful anymore at this stage. The screenshot in #23 has nothing to do with the theme we're supposed to be cleaning up here. Should we instead start working on incremental fixes like

#634724: Seven has inconsistent fonts on form elements - which asks the good question of "What do we think about a separate stylesheet that does the equivalent job of zen's html-elements.css?"
#634498: Filters layout is broken on admin/content and admin/people
#563390: Seven theme lacks formatting on common html elements such as lists, paragraphs & <code>
#563390: Seven theme lacks formatting on common html elements such as lists, paragraphs & <code>
#634224: Seven theme needs vertical space between paragraphs
#634218: Seven theme: CODE elements are too small

?

Lets get this back on track if possible, I find it hard to tell if those should be fixed in parallel or if this one is holding the others up.

jix_’s picture

I don't think this one holds it up. Code added from other patches probably doesn't affect the code in this one too much. This patch is basically about a better way to reset Drupal's default styles and about coding standards, it doesn't change the actual look of the theme. (Ideally, the way the styles from the other issues are inherited doesn't change.)

Only thing holded up is this issue itself :(
(see #20)

sun.core’s picture

Priority: Critical » Normal

Does anyone actually care for Seven theme? ;)

Bojhan’s picture

Priority: Normal » Critical

@sun.core jeez

yoroy’s picture

Seven is a beautiful exercise in restraint. Its clean and simple visual styling of admin ui patterns is a big big opportunity for more consistent looks and behaviour across core and contrib.

It's also true that the CSS that defines this clean look is itself not yet as elegant. Needs work.

It is critical we give the Seven CSS at least one more thorough massage to make its selectors more future-proof/extandable.

Issue mentioned in #20/#28 is committed/fixed, any takers?

Haarek’s picture

Status: Needs work » Needs review

drupal.seven-flex.patch queued for re-testing.

mcrittenden’s picture

Sub.

jide’s picture

I may give it a try. Is it possible to have more details on what has room for improvements here ?

jide’s picture

FileSize
545 bytes

I noticed a few glitches on Seven :

- fieldset legends are misplaced on IE and FF
- buttons are too wide on IE

Could not fix the fieldset for now, but the attached patch fixes the button width for IE.

Maybe it would be better to summarize all remaining issues and fix them all in a single patch, but I attach this patch here anyway.

Anyone who could help to find remaining bugs ? What other things can be enhanced or cleaned up on style.css ?

jide’s picture

A screenshot of the fieldset problem on FF.
2 screenshots of button size on IE before and after the patch.

jide’s picture

The fieldset problem is also discussed here : #676800: Fieldsets break design badly

yoroy’s picture

Status: Needs review » Needs work

Patch in #35 does not include the previous changes so that throws us out of the loop here, right?

What this issue is about is 3 things as quicksketch noted in comment #20 above:

- Remove the extra white spaces.
- Remove the wacky clear-fix redundancy.
- Add reset.css through drupal_add_css() instead of through the .info file.

Last actual patch for this is in #12 above and tries to do all 3 and then some at once. I'll do a reroll for the whitespaces here and create a seperate issue for the last add_css() move.

yoroy’s picture

Title: Seven theme clean-up » Add reset.css through drupal_add_css() instead of through the .info file
FileSize
13.22 KB

Scratch that. We'll keep the critical part of the discussion here: see #4 to #12 & #20, skip the noise and continue from here I think.

Splitting of the non-critical stuff to seperate issues instead:

#726276: CSS Code style cleanups for Seven

#726286: Remove the wacky clear-fix redundancy – Somebody please clarify this particular isse a bit better in there.

Here, we will continue with these bits:

Index: themes/seven/template.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/seven/template.php,v
retrieving revision 1.5
diff -u -p -r1.5 template.php
--- themes/seven/template.php	22 Aug 2009 14:34:23 -0000	1.5
+++ themes/seven/template.php	13 Sep 2009 01:50:08 -0000
@@ -8,7 +8,10 @@ function seven_preprocess_page(&$vars) {
   $vars['primary_local_tasks'] = menu_primary_local_tasks();
   $vars['secondary_local_tasks'] = menu_secondary_local_tasks();
   $vars['ie_styles'] = '<!--[if lt IE 7]><style type="text/css" media="screen">@import ' . path_to_theme() . '/ie6.css";</style><![endif]-->';
-}
+  $data = path_to_theme() . '/reset.css';
+  $options['weight'] = CSS_SYSTEM -1;
+  drupal_add_css($data, $options);
+ }

and

Index: themes/seven/seven.info
===================================================================
RCS file: /cvs/drupal/drupal/themes/seven/seven.info,v
retrieving revision 1.1
diff -u -p -r1.1 seven.info
--- themes/seven/seven.info	31 Jul 2009 19:35:57 -0000	1.1
+++ themes/seven/seven.info	13 Sep 2009 01:50:08 -0000
@@ -4,9 +4,10 @@ description = A simple one-column, table
 core = 7.x
 version = VERSION
 engine = phptemplate
-stylesheets[screen][] = reset.css
-stylesheets[screen][] = style.css
+stylesheets[all][] = reset-drupal.css
 stylesheets[all][] = vertical-tabs.css
+stylesheets[all][] = system-menus.css
+stylesheets[all][] = style.css
 regions[content] = Content
 regions[help] = Help
 regions[page_top] = Page top
Index: themes/seven/style.css

I think :) See #12 for last patch that thouched this.

seutje’s picture

catch’s picture

Priority: Critical » Normal
Status: Needs work » Postponed (maintainer needs more info)

Given the title, I think this is a duplicate of #575298: Provide non-PHP way to reliably override CSS. If that issue is critical, it should be marked at such, if it's not, nor is hacking around with drupal_add_css() (or #attached) here.

Otherwise it looks like everything else here has been split to other issues, so I'm downgrading this and marking needs more info - just in case there's something left which isn't a duplicate of 575298.

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

I'm guessing that all the other issues have been spun out of this, so closing.