In the normal site state, the pagestyle module injects a pagestyle_standard body class which, because of the CSS associated with that class, means that all text with font-weight: bold as defined by the theme or content is rendered as font-weight: normal.
A workaround is suggested here http://drupal.org/node/837552#comment-4445010 for D6, but I gather the template preprocessors have changed somewhat for D7.
Regardless of this workaround, I think the module should not inject CSS classes for the standard style.
Has anyone got any thoughts on this?
Comments
Comment #1
mshepherd commentedI've made a workaround for this, but I'd rather this was dealt with inside of the module. Adding the current style's class into the body tag is really useful, but it should only appear for non-standard styles.
I added this into my theme's template.php file. It works by looking for pagestyle_standard in the classes_array and removing it if it exists.
Comment #2
CZ commentedOK, you will not the body class "pagestyle_standard"? I read the issue #837552: Add current style to $body_classes? as it is "add current style to the body". The standard CSS is a style. But clear, it is possible to add no standard class.
The code for the pagestyle.module file:
And then the JavaScript file, like the php file. Is this ok for you?
Comment #3
mshepherd commentedHi,
Let me test the change you suggest to pagestyle.module. I'm getting weird side effects from the change I suggested above. And the behaviour is significantly different in firefox7 and chrome14.
Is there some change I need to make to javascript also?
Matthew
Comment #4
mshepherd commentedHi,
The change you suggested to pagestyle.module makes the module work as I expected without any javascript changes.
There is a minor niggle in that when I switch back to pagestyle_standard from any other style, the pagestyle module's
font-weight: normal !important;overrides my theme's font weights. But when I navigate to another page or reload the page, the theme's styles prevail. I see this as a relatively minor niggle.Is this a change you'd consider committing?
Matthew
Comment #5
CZ commentedWell, the CSS for the "standard" style is basically empty in "pagestyle/css/style_standard.css". "font-weight" for the standard style is not required. But the definition of "font-weight" for the standard style in the admin page is required for the JavaScript switch (from another style - except "standard" - to another style), because the other pagestyle styles use "!important".
So, you have to make the style "Standard font weight" consistent with your theme. Or is this a problem?
PS: Line 22 in jquery.pagestyle.js
But that's not enough.
Comment #6
mshepherd commentedHi Christian,
The problem is that in most content, there's a mixture of text with
font-weight: boldandfont-weight: normal. Out-of-the-box, the pagestyle module adds the body class pagestyle-standard who's styles override the theme's variation in font weight and makes it all normal. I don't think this is desirable out-of-the box behaviour.The code in #2 fixes the out-of-the-box behaviour, but obviously there are some implications when switching back to the standard style, at least until a new page is loaded. I, for one, can live with those more than I can live with the current behaviour.
Matthew
Comment #7
CZ commentedOK, the problem exists only if the browser use JavaScript.
But I think the problem is the linked CSS. So the one and only solution (also for #1184054: Can't switch back to Standard) is, a feature to remove the style changer in the browser menue. And this maybe by default?
Comment #8
mshepherd commentedNo, this problems exists with or without javascript enabled.
Example (A fresh install of D7.9 with the most recent dev version of pagestyle, enabled but with no other settings changed, not even with the pagestyle block displayed)
Before enabling pagestyle
With pagestyle module enabled, no pagestyle block enabled, javascript disabled
Notice title is no longer bold & text in body that was bold, no longer is.
Comment #9
CZ commentedYes. Thank you. In fact, the definition "Standard font weight" can be removed (?), because the "style_standard.css" do not use this defnition. I will fix these both bugs.
Comment #10
mshepherd commentedThanks for patience and help Christian.
Comment #11
CZ commentedNo longer required to fix this bug.
Comment #12
mshepherd commentedoh, have you made some other change to make it unnecessary?
Matthew
Comment #13
CZ commentedYes, removed "font-weight" for normal style. This issue marked as "fixed", is better :-).
Comment #14
mshepherd commentedChristian - that's great - thanks for your time.
Matthew