Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#18124 closed defect (bug) (invalid)

Child Theme Styles - Dark Theme and Link Colors

Reported by: adeptris's profile adeptris Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2.1
Component: Bundled Theme Keywords:
Focuses: Cc:

Description

With the introduction of twenty eleven and the dark theme and link colors, changes to the element styles in the child theme's style.css are lost, as the dark styleshhet and link color styles are loaded after the child styles.

If I selected the dark theme which changes the link color, or just changed the link color, I could not override the colors in the child themes style.css.

I know how to fix this with !important and have updated the Codex Child Theme page, I have also seen topics in the forum where users are using a child theme and hacking the parent theme files to change these colors for the dark theme.

I know it is low priority, but I thought I would create a ticket, as there might be a way of changing this in the core or twenty eleven theme.

David

Change History (7)

#1 @dd32
13 years ago

  • Component changed from General to Bundled Theme

#2 @chipbennett
13 years ago

  • Cc chip@… added

#3 @obenland
12 years ago

Twenty Eleven comes with the 'twentyeleven_enqueue_color_scheme' action, to enqueue your own (or dequeue Twenty Eleven's) color stylesheet. Additionally, the twentyeleven_print_link_color_style() callback function can be removed from the 'wp_head' action and replaced.

Is there really a need for a change?

#4 @adeptris
12 years ago

Hi Obenland,
You have missed the point, if you select the Dark Theme option from Appearance Theme Options, this will load the /colors/dark.css and the script/function to load the link colors, after the style.css is loaded.

People might want to affect one element and will be uncomfortable in the functions.php using enqueue and dequeue, but ok with adding a style to the style.css

WordPress promote the use of child themes, but the child theme style.css is loaded before the dark.css and the function, so styles cannot be changed in the child theme unless you use !important.

I wrote about it omn my website and updated the codex, there is a screenshot where you will see the dark.css is loaded after the child themes style.css

http://digitalraindrops.net/2011/07/twenty-eleven-dark-child-theme/
http://codex.wordpress.org/Child_Themes

HTH

David

Last edited 12 years ago by adeptris (previous) (diff)

#5 @obenland
12 years ago

I find it highly unlikely, that someone would be comfortable enough to create a Child Theme and add CSS, but don't dare to add a functions.php file and enqueue an additional stylesheet. And even then: using !important, would be perfectly fine in their case.

Additionally, changing the order in which CSS files are loaded would be a backwards compatibility nightmare.

#6 follow-up: @adeptris
12 years ago

Hi Obenland,
Not sure why we are discussing this 14 months after I posted.

Having answered many forum questions there are plenty that will change a style, but shy away from functions.php, and to create a stylesheet, functions.php and have to create functions to change a couple of styles, is a lot of work!

However, I have just had a look at the 'Twenty Twelve' theme which does not have the theme options for the dark theme, or the link color change code, so I would not put to much effort into the twenty eleven theme.

Regards

David

#7 in reply to: ↑ 6 @obenland
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Replying to adeptris:

Not sure why we are discussing this 14 months after I posted.

Because this was an open Ticket, waiting for review. :)

Version 0, edited 12 years ago by obenland (next)
Note: See TracTickets for help on using tickets.