-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Background color does not stick when background overlay is used #161
Comments
@BoweFrankema I should have pointed you to the commit too, I guess! 7f85ef6 |
I'll keep adding some further notes on issues as I stumble across them... When the Background Color option is set for a menu (in this case the Below Header Menu), it appears that Infinity writes some CSS into 'dynamic.css'. However, it has no effect, because setting the body.theme-option .sub-menu {
background-color: #ff006f; /* my chosen bg-color */
background-image: none; /* clear gradient */
} For Sub-item Backgrounds, things get more complex, because the anchors themselves have their .base-menu ul li.current-cat a,
.base-menu ul li.current_page_item a,
.base-menu ul li.current-menu-item a {
font-weight: bold;
background: url('/wp-content/themes/cbox-theme/assets/images/bg-body.gif') repeat transparent;
} Therefore, the override has no effect as it is targetting the wrong element: body.theme-option .sub-menu ul ul {
background-color: #62ff00;
} I've had a quick look at |
@christianwach - Also see my related ticket on the Infinity repo: |
Okay gang, so how do we want to solve this? My fix in PressCrew/infinity#83 works. The only issue is the menus don't really gel after applying a custom background color. See the |
@r-a-y As far as I can tell, your fix only works to a degree. I've spent a while on this and I'm fairly sure now that there are deeper issues at play here. The CSS from the "Background Color" and "Sub-item Background" options suffer from the same issue I mention in #198 (comment) in that they generate declarations that are:
"Well if I were you, I wouldn't be starting from here" as the old joke goes... |
Thanks for looking into this, @christianwach. I didn't even see the "Sub-item Background" setting. (Too many options!) I have a potential fix for this. In
Needs a bit more work. This addresses the "Home" button background colour as well. I haven't looked into the background-image issue, but the overlay and background colour settings worked okay for me. |
@r-a-y Nice find - there's definitely progress to be made by tweaking the selectors in that file. I've tried a few variations there, but cannot come up with a solution that works for all combinations of options. Indeed, I'm now confused about the intent of the options... either there are too many or too few to be logical: "Font Color" and "Font Weight" apply to all items in a menu, while "Background Color" only applies to the menu "bar" (red in your screenshot) and not the background of the dropdowns, which have
applied to them in I think the "too few" or "too many" options issue is perhaps the key here. At present, people may expect the options to do different things because the options themselves are poorly defined. It seems to me (assuming that the current set of options remains in place) that the menu options should break down thus: Each menu has base properties such as:
Each menu then also has the following ancestry properties:
This may not be an exhaustive list. My point is that the current set of options do not reflect the actual functioning of the menus and that this leads to the CSS rule confusion. And then there's that pesky |
I wouldn't be against dropping these complex options from Infinity completely. It's apparent that either the original/older Infinity design was more compatible with these settings or simply weren't tested thoroughly enough. I would like to completely replace the superfish menu with something else in the future anyways, at which point we can rethink this from the ground up. Over time with feedback about Infinity coming in, it's become very clear to me that "forcing" end users to learn a bit of CSS if they want to get very specific is quite a bit less painful than trying to cover all cases with a GUI type solution. I'm not trying to throw your work so far out the window. I'm on board either way. Just wanted to let you guys know that I'm not married to these settings ;) |
@MrMaz I wholeheartedly agree! |
Yes :) @r-a-y @christianwach I've gotten a bit lost trying to parse out the possible solutions presented above. I definitely get the sense that there are a number of options - overlay, color, and each of these for the sub-items - and that actually "fixing" this issue is likely to involve rethinking the level of customizability that we actually want to provide here. But for the purposes of the maintenance release, that kind of rethinking is not viable, so let's instead do one of the following:
Thanks! |
Previously, when Infinity's "Background Color" theme option was set, the CSS used the "background-color" property. This makes logical sense, but when compiling the rest of the theme's CSS, other background theme options could take precedence, thereby not rendering the background color. Therefore, this commit uses the CSS "background" shorthand property to render the background color as this overrides various CSS background properties. See #161, #88.
I went with this option :) Going to leave this issue open though for the time being. |
@BoweFrankema before I do a pull request, could you please review the menu restyling that I've done on:
http://www.paulschacht.net/
It's my assumption that this is what the menus (both base and main) were supposed to look like, but that some odd CSS declarations crept in somewhere.
My update removes the (too generous) padding, lines up submenus correctly, makes the spans block elements (so the rollover state isn't lost when the page title wraps and you hover between the lines of the title) and extends the links to the full width of the menus and submenus so there aren't any inactive regions. It also leaves the "active trail" items in their highlighted state.
Cheers, Christian
The text was updated successfully, but these errors were encountered: