WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/13/2013 07:37:10 PM (6 years ago)
Author:
helen
Message:

Merge the color schemes component from MP6. Introduces Light, Blue, and Midnight.

Color scheme selection on your own profile page gives you a preview and autosaves the selection.

Also introduces the usage of a preprocessor for core files, namely Sass. For 3.8, we will not expand its implementation past the color schemes. This does require Ruby as well as Sass 3.3.0+ due to the usage of the sourcemap option.

Note that only the default color scheme is available when running out of src. Use build to test the rest as well as the color picker.

props ryelle, melchoyce, tillkruess, drw158, littlethingsstudio, helen. see #25858, #22862.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r26096 r26137  
    20862086 * @param string $url The url of the css file containing the colour scheme.
    20872087 * @param array $colors Optional An array of CSS color definitions which are used to give the user a feel for the theme.
    2088  */
    2089 function wp_admin_css_color($key, $name, $url, $colors = array()) {
     2088 * @param array $icons Optional An array of CSS color definitions used to color any SVG icons
     2089 */
     2090function wp_admin_css_color( $key, $name, $url, $colors = array(), $icons = array() ) {
    20902091    global $_wp_admin_css_colors;
    20912092
     
    20932094        $_wp_admin_css_colors = array();
    20942095
    2095     $_wp_admin_css_colors[$key] = (object) array('name' => $name, 'url' => $url, 'colors' => $colors);
     2096    $_wp_admin_css_colors[$key] = (object) array(
     2097        'name' => $name,
     2098        'url' => $url,
     2099        'colors' => $colors,
     2100        'icon_colors' => $icons,
     2101    );
    20962102}
    20972103
     
    21022108 */
    21032109function register_admin_color_schemes() {
    2104     wp_admin_css_color( 'fresh', _x( 'Default', 'admin color scheme' ), admin_url( 'css/colors-fresh.min.css' ),
    2105         array( '#222', '#333', '#0074a2', '#2ea2cc' ) );
     2110    $suffix = SCRIPT_DEBUG ? '' : '.min';
     2111
     2112    wp_admin_css_color( 'fresh', _x( 'Default', 'admin color scheme' ),
     2113        admin_url( "css/colors-fresh$suffix.css" ),
     2114        array( '#222', '#333', '#0074a2', '#2ea2cc' )
     2115    );
     2116
     2117    // Other color schemes are not available when running out of src
     2118    if ( ! strpos( $GLOBALS['wp_version'], '-src' ) ) {
     2119        wp_admin_css_color( 'light', _x( 'Light', 'admin color scheme' ),
     2120            admin_url( "css/color-schemes/light/colors$suffix.css" ),
     2121            array( '#e5e5e5', '#999', '#d64e07', '#04a4cc' ),
     2122            array( 'base' => '#999', 'focus' => '#ccc', 'current' => '#ccc' )
     2123        );
     2124
     2125        wp_admin_css_color( 'blue', _x( 'Blue', 'admin color scheme' ),
     2126            admin_url( "css/color-schemes/blue/colors$suffix.css" ),
     2127            array( '#096484', '#4796b3', '#52accc', '#74B6CE' ),
     2128            array( 'base' => '#e5f8ff', 'focus' => '#fff', 'current' => '#fff' )
     2129        );
     2130
     2131        wp_admin_css_color( 'midnight', _x( 'Midnight', 'admin color scheme' ),
     2132            admin_url( "css/color-schemes/midnight/colors$suffix.css" ),
     2133            array( '#25282b', '#363b3f', '#69a8bb', '#e14d43' ),
     2134            array( 'base' => '#f1f2f3', 'focus' => '#fff', 'current' => '#fff' )
     2135        );
     2136    }
    21062137}
    21072138
Note: See TracChangeset for help on using the changeset viewer.