Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#26188 closed enhancement (fixed)

Twenty Fourteen: Improve the Basic Child Theming Experience

Reported by: celloexpressions's profile celloexpressions Owned by: lancewillett's profile lancewillett
Milestone: 3.8 Priority: normal
Severity: normal Version: 3.8
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

As a default theme, Twenty Fourteen should be very easy to customize with CSS and child themes. For visual changes, this means our CSS should be a simple as possible, so that developers (and the many new devs or non-devs that will try to make tweaks) don't have to hunt down hundreds of selectors to make common, seemingly simple changes.

Twenty Fourteen is okay at this right now, but we can do a bit better and will save a lot of time and effort by removing things that we don't need but everyone else would need to override, for example.

The best way to approach this is to try to make changes that you might want in a child theme (universally bigger fonts, for example), then looking for places where it seems like there's too much to override. In those cases, check whether there are redundant rules in Twenty Fourteen's style.css. Redundant rules are places where a child element has identical rules to a parent that could be removed without changing anything visually (do make sure the rules aren't needed for responsive or other dynamic components).

For an initial pass, I've identified a few potential simplifications relating to the process of changing the header, sidebar and footer from a dark to a light background. Screenshots and patches coming.

Attachments (7)

26188.header-nav.diff (419 bytes) - added by celloexpressions 12 years ago.
Remove unnecessary color layer in header nav (same as header background)
2014-child-ttheming-site-header.png (638.9 KB) - added by celloexpressions 12 years ago.
Before and after of header nav issue -- removing our unneeded property saves people needing to hunt it down
26188.site-description.diff (560 bytes) - added by celloexpressions 12 years ago.
Fix site description padding with header shadow (this IS a visual change, but should be considered because it's almost an issue for vanilla Twenty Fourteen - shadow overlaps text a bit but we're on a pure black background)
2014-site-description-issue.png (2.4 KB) - added by celloexpressions 12 years ago.
Site description overlaps header shadow if background color is *anything* but #000
2014-light-header-side-bar-footer-custom-css.css (734 bytes) - added by celloexpressions 12 years ago.
Custom CSS I used for testing header/sidebar/footer color changes.
26188.site-description.2.diff (406 bytes) - added by celloexpressions 12 years ago.
Remove header text shadow to fix issues with non-black sidebar background colors and give a cleaner look.
26188.mediaelement-players-inner-background.diff (536 bytes) - added by celloexpressions 12 years ago.
Create the MediaElements players' time rail and volume container backgrounds with a semi-transparent color so that it adjusts with the player background color if that's changed.

Download all attachments as: .zip

Change History (16)

@celloexpressions
12 years ago

Remove unnecessary color layer in header nav (same as header background)

@celloexpressions
12 years ago

Before and after of header nav issue -- removing our unneeded property saves people needing to hunt it down

@celloexpressions
12 years ago

Fix site description padding with header shadow (this IS a visual change, but should be considered because it's almost an issue for vanilla Twenty Fourteen - shadow overlaps text a bit but we're on a pure black background)

@celloexpressions
12 years ago

Site description overlaps header shadow if background color is *anything* but #000

#1 follow-up: @celloexpressions
12 years ago

I found three issues in the header/sidebar/footer for color changes:

  • unneeded selector on the header nav
  • site description is set to overlap the shadow on the header. We should probably give it some more padding/margin; it's only not an issue for us by default because the background is pure black (#000), anything else and it'll show up.
  • it is almost impossible to figure out how the sidebar's background color is set. Took me forever, and I'm pretty familiar with Twenty Fourteen and using tools to find where style rules are set. If Chrome hadn't recently added pseudo-elements to the document tree in their inspector, I wouldn't have found it. On top of the fact that we're using a pseudo-element, the rule is burried 3500 lines into our main css file. I think this will be one of the most common things people will want to change, and the solution is simple if you know it. We either need a good way of documenting this, or to use a different, more cumbersome method for setting the sidebar background color (I do really like how this is being done, haven't seen this approach before, but it's unexpected).

See patches and screenshots above for the first two. The third one is certainly fixable, but will be less eloquent. We need to decide if we'd rather have a solution that's beautiful code or easy to customize for coloring the left sidebar background.

@celloexpressions
12 years ago

Custom CSS I used for testing header/sidebar/footer color changes.

#2 in reply to: ↑ 1 @iamtakashi
12 years ago

@celloexpressions,

I prefer to remove the shadow rather than moving down the site description. I'd like to keep it to be aligned with the bottom of the header. We can remove the background color from .primary-navigation as you suggested.

@celloexpressions
12 years ago

Remove header text shadow to fix issues with non-black sidebar background colors and give a cleaner look.

#3 @celloexpressions
12 years ago

  • Keywords has-patch added

First two things have patches and are good to go. Third needs discussion.

Additional areas we should audit:

  • Featured Content colors
  • Main content colors
  • Changing font sizes
  • Changing site width
  • Centering the site in the browser

And anything else that would be a very commonly made change in child themes/custom css.

#4 follow-up: @iamtakashi
12 years ago

I don't think we need to alter how the left sidebar is colored. It might not be a familiar way for some but it works very well and we should educate users by doing this rather than taking an expected, hacky, cumbersome method.

#5 @iamtakashi
12 years ago

  • Cc takashi@… added

@celloexpressions
12 years ago

Create the MediaElements players' time rail and volume container backgrounds with a semi-transparent color so that it adjusts with the player background color if that's changed.

#6 in reply to: ↑ 4 @celloexpressions
12 years ago

Replying to iamtakashi:

I don't think we need to alter how the left sidebar is colored. It might not be a familiar way for some but it works very well and we should educate users by doing this rather than taking an expected, hacky, cumbersome method.

I agree, let's try to document it somewhere, though (Codex page?).

Just added a patch that improves the handling of the MediaElements players' gray color.

#7 @lancewillett
12 years ago

  • Milestone changed from Awaiting Review to 3.8

#9 @lancewillett
12 years ago

  • Owner set to lancewillett
  • Resolution set to fixed
  • Status changed from new to closed

In 26579:

Twenty Fourteen: CSS fixes, props celloexpressions. Fixes #26188.

  • Remove unnecessary color layer in header nav (same as header background).
  • Fix site description padding with header shadow.
  • Create the MediaElements players' time rail and volume container backgrounds with a semi-transparent color so that it adjusts with the player background color if that's changed.
Note: See TracTickets for help on using tickets.