[wp-ui] Admin header background color: light or dark?

Toon Van de Putte toon at automaton.be
Wed Jun 2 05:57:42 UTC 2010


I would avoid the use of !important. I'd also put the colours in specific
classes, like .header-red, .header-green, etc. Then let PHP decide which
class to attach to the header. Hardcoded styles like in your example are a
lot less flexible and future-proof.
Generally, it's a good idea for plugin authors/developers to just attach
relevant (general and specific) classes to every element, and let
stylesheets decide the styling specifics. Kind of like Wordpress itself does
with the body tag and post divs.

On Wed, Jun 2, 2010 at 12:30 AM, Alex Hempton-Smith <hempsworth at gmail.com>wrote:

> Quick solution to this:
>
> <?php
> /*
> Plugin Name: Site Colors
> Plugin URI: http://www.alexhemptonsmith.com
> Description: Lets you define the header color for specific sites
> Author: Alex Hempton-Smith
> Version: 0.0.1-dev
> Author URI: http://www.alexhemptonsmith.com
> */
>
> function site_colors(){
>
>     $site = get_current_site();
>
>     // Site with ID of 1 has a header with a red background
>     if ($site->blog_id == 1)
>         $header_color = 'red';
>
>     // Site with ID of 2 has a header with a black background
>     if ($site->blog_id == 2)
>         $header_color = '#000';
>
>     if ($header_color)
>         echo "<style type='text/css'>#wphead {background: $header_color
> !important;}</style>";
> }
> add_action('admin_print_styles', 'site_colors');
>
> -- Alex  (Hempsworth)
>
>
>
> On Tue, Jun 1, 2010 at 11:10 PM, andrea_r <andrea at ronandandrea.com> wrote:
>
>> Or on a site-by-site basis when using the new network feature. ;)
>>
>> Yes, the titles are different but color can be a great visual cue.
>>
>
>
> _______________________________________________
> wp-ui mailing list
> wp-ui at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-ui
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.automattic.com/pipermail/wp-ui/attachments/20100602/013c6c74/attachment.htm>


More information about the wp-ui mailing list