CSS: Stop using `wp-admin.min.css` and instead queue the individual stylesheets up through `load-styles.php`.

We still generate the `wp-admin.*` files for compabitility purposes, however they only include the `@import()` lines.

Fixes #35229

Built from https://develop.svn.wordpress.org/trunk@36341


git-svn-id: http://core.svn.wordpress.org/trunk@36308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2016-01-18 09:57:29 +00:00
parent fcd674ca6c
commit 987ce83cfc
39 changed files with 117 additions and 25 deletions

1
wp-admin/css/about-rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/about.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/admin-menu-rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/admin-menu.min.css vendored Normal file

File diff suppressed because one or more lines are too long

8
wp-admin/css/common-rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

8
wp-admin/css/common.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/dashboard-rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/dashboard.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/edit-rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/edit.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/farbtastic-rtl.min.css vendored Normal file
View File

@ -0,0 +1 @@
.farbtastic{position:relative}.farbtastic *{position:absolute;cursor:crosshair}.farbtastic,.farbtastic .wheel{width:195px;height:195px}.farbtastic .color,.farbtastic .overlay{top:47px;right:47px;width:101px;height:101px}.farbtastic .wheel{background:url(../images/wheel.png) no-repeat;width:195px;height:195px}.farbtastic .overlay{background:url(../images/mask.png) no-repeat}.farbtastic .marker{width:17px;height:17px;margin:-8px -8px 0 0;overflow:hidden;background:url(../images/marker.png) no-repeat}

1
wp-admin/css/farbtastic.min.css vendored Normal file
View File

@ -0,0 +1 @@
.farbtastic{position:relative}.farbtastic *{position:absolute;cursor:crosshair}.farbtastic,.farbtastic .wheel{width:195px;height:195px}.farbtastic .color,.farbtastic .overlay{top:47px;left:47px;width:101px;height:101px}.farbtastic .wheel{background:url(../images/wheel.png) no-repeat;width:195px;height:195px}.farbtastic .overlay{background:url(../images/mask.png) no-repeat}.farbtastic .marker{width:17px;height:17px;margin:-8px 0 0 -8px;overflow:hidden;background:url(../images/marker.png) no-repeat}

1
wp-admin/css/forms-rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/forms.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/l10n-rtl.min.css vendored Normal file
View File

@ -0,0 +1 @@
.locale-he-il em,.locale-zh-cn #local-time,.locale-zh-cn #utc-time,.locale-zh-cn .form-wrap p,.locale-zh-cn .howto,.locale-zh-cn .inline-edit-row fieldset span.checkbox-title,.locale-zh-cn .inline-edit-row fieldset span.title,.locale-zh-cn .js .input-with-default-title,.locale-zh-cn .link-to-original,.locale-zh-cn .tablenav .displaying-num,.locale-zh-cn p.description,.locale-zh-cn p.help,.locale-zh-cn p.install-help,.locale-zh-cn span.description{font-style:normal}.locale-de-de #customize-header-actions .button,.locale-de-de-formal #customize-header-actions .button,.locale-ru-ru #customize-header-actions .button{padding:0 5px 1px}body.rtl,body.rtl .press-this a.wp-switch-editor{font-family:Tahoma,Arial,sans-serif}.rtl h1,.rtl h2,.rtl h3,.rtl h4,.rtl h5,.rtl h6{font-family:Arial,sans-serif;font-weight:700}body.locale-he-il,body.locale-he-il .press-this a.wp-switch-editor{font-family:Arial,sans-serif}.locale-he-il em{font-weight:700}.locale-zh-cn .hdnle a{font-size:12px}.locale-zh-cn form.upgrade .hint{font-style:normal;font-size:100%}.locale-zh-cn #sort-buttons{font-size:1em!important}.locale-de-de #customize-header-actions .spinner,.locale-de-de-formal #customize-header-actions .spinner{margin:16px 3px 0}.locale-ru-ru #adminmenu{width:inherit}.locale-ru-ru #adminmenu,.locale-ru-ru #wpbody{margin-right:0}.locale-ru-ru .inline-edit-row fieldset label span.title,.locale-ru-ru .inline-edit-row fieldset.inline-edit-date legend{width:8em}.locale-ru-ru .inline-edit-row fieldset .timestamp-wrap,.locale-ru-ru .inline-edit-row fieldset label span.input-text-wrap{margin-right:8em}.locale-ru-ru.post-new-php .tagsdiv .newtag,.locale-ru-ru.post-php .tagsdiv .newtag{width:165px}.locale-ru-ru.press-this .posting{margin-left:277px}.locale-ru-ru .press-this-sidebar{width:265px}.locale-ru-ru #customize-header-actions .spinner{margin:16px 3px 0}.locale-lt-lt .inline-edit-row fieldset label span.title,.locale-lt-lt .inline-edit-row fieldset.inline-edit-date legend{width:8em}.locale-lt-lt .inline-edit-row fieldset .timestamp-wrap,.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap{margin-right:8em}@media screen and (max-width:782px){.locale-lt-lt .inline-edit-row fieldset .timestamp-wrap,.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap,.locale-ru-ru .inline-edit-row fieldset .timestamp-wrap,.locale-ru-ru .inline-edit-row fieldset label span.input-text-wrap{margin-right:0}}

1
wp-admin/css/l10n.min.css vendored Normal file
View File

@ -0,0 +1 @@
.locale-he-il em,.locale-zh-cn #local-time,.locale-zh-cn #utc-time,.locale-zh-cn .form-wrap p,.locale-zh-cn .howto,.locale-zh-cn .inline-edit-row fieldset span.checkbox-title,.locale-zh-cn .inline-edit-row fieldset span.title,.locale-zh-cn .js .input-with-default-title,.locale-zh-cn .link-to-original,.locale-zh-cn .tablenav .displaying-num,.locale-zh-cn p.description,.locale-zh-cn p.help,.locale-zh-cn p.install-help,.locale-zh-cn span.description{font-style:normal}.locale-de-de #customize-header-actions .button,.locale-de-de-formal #customize-header-actions .button,.locale-ru-ru #customize-header-actions .button{padding:0 5px 1px}body.rtl,body.rtl .press-this a.wp-switch-editor{font-family:Tahoma,Arial,sans-serif}.rtl h1,.rtl h2,.rtl h3,.rtl h4,.rtl h5,.rtl h6{font-family:Arial,sans-serif;font-weight:700}body.locale-he-il,body.locale-he-il .press-this a.wp-switch-editor{font-family:Arial,sans-serif}.locale-he-il em{font-weight:700}.locale-zh-cn .hdnle a{font-size:12px}.locale-zh-cn form.upgrade .hint{font-style:normal;font-size:100%}.locale-zh-cn #sort-buttons{font-size:1em!important}.locale-de-de #customize-header-actions .spinner,.locale-de-de-formal #customize-header-actions .spinner{margin:16px 3px 0}.locale-ru-ru #adminmenu{width:inherit}.locale-ru-ru #adminmenu,.locale-ru-ru #wpbody{margin-left:0}.locale-ru-ru .inline-edit-row fieldset label span.title,.locale-ru-ru .inline-edit-row fieldset.inline-edit-date legend{width:8em}.locale-ru-ru .inline-edit-row fieldset .timestamp-wrap,.locale-ru-ru .inline-edit-row fieldset label span.input-text-wrap{margin-left:8em}.locale-ru-ru.post-new-php .tagsdiv .newtag,.locale-ru-ru.post-php .tagsdiv .newtag{width:165px}.locale-ru-ru.press-this .posting{margin-right:277px}.locale-ru-ru .press-this-sidebar{width:265px}.locale-ru-ru #customize-header-actions .spinner{margin:16px 3px 0}.locale-lt-lt .inline-edit-row fieldset label span.title,.locale-lt-lt .inline-edit-row fieldset.inline-edit-date legend{width:8em}.locale-lt-lt .inline-edit-row fieldset .timestamp-wrap,.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap{margin-left:8em}@media screen and (max-width:782px){.locale-lt-lt .inline-edit-row fieldset .timestamp-wrap,.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap,.locale-ru-ru .inline-edit-row fieldset .timestamp-wrap,.locale-ru-ru .inline-edit-row fieldset label span.input-text-wrap{margin-left:0}}

1
wp-admin/css/list-tables-rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/list-tables.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/media-rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/media.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/nav-menus-rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/nav-menus.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
embed,iframe,img,object{max-width:100%}a,a:visited{color:#0073aa}a:active,a:focus,a:hover{color:#00a0d2}ul{list-style:disc}ol{list-style:decimal}li>ol,li>ul{margin-bottom:0;margin-right:1.5em}dt{font-weight:700}dd{margin:0 1.5em 1.5em}img{height:auto}body{color:#404040;font-family:"Open Sans",Helvetica,Arial,sans-serif;font-size:20px;font-weight:400;line-height:1.6}@media (max-width:640px){body{font-size:16px}}@media (max-width:320px){body{margin:0 15px}}#tinymce b,#tinymce strong{font-weight:700!important}blockquote{margin:1em 1.5em;color:#9ea7af;font-size:em(25px);font-style:italic}@media (max-width:900px){body#tinymce{padding-top:30px!important}blockquote{margin:1.5em 1em}}ol,ul{margin:0 .75em 1.5em 0}

View File

@ -0,0 +1 @@
embed,iframe,img,object{max-width:100%}a,a:visited{color:#0073aa}a:active,a:focus,a:hover{color:#00a0d2}ul{list-style:disc}ol{list-style:decimal}li>ol,li>ul{margin-bottom:0;margin-left:1.5em}dt{font-weight:700}dd{margin:0 1.5em 1.5em}img{height:auto}body{color:#404040;font-family:"Open Sans",Helvetica,Arial,sans-serif;font-size:20px;font-weight:400;line-height:1.6}@media (max-width:640px){body{font-size:16px}}@media (max-width:320px){body{margin:0 15px}}#tinymce b,#tinymce strong{font-weight:700!important}blockquote{margin:1em 1.5em;color:#9ea7af;font-size:em(25px);font-style:italic}@media (max-width:900px){body#tinymce{padding-top:30px!important}blockquote{margin:1.5em 1em}}ol,ul{margin:0 0 1.5em .75em}

1
wp-admin/css/revisions-rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/revisions.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/site-icon-rtl.min.css vendored Normal file
View File

@ -0,0 +1 @@
.site-icon-preview .favicon-preview{margin:5px 0 20px;overflow:hidden;position:relative;max-width:180px}.site-icon-preview .browser-title,.site-icon-preview .favicon{height:16px;right:88px;overflow:hidden;position:absolute;top:16px}.site-icon-preview .favicon{width:16px}.site-icon-preview .browser-title{right:109px}.site-icon-preview .app-icon-preview{background-color:#000;-webkit-border-radius:16px;border-radius:16px;height:64px;overflow:hidden;width:64px;margin-top:5px}

1
wp-admin/css/site-icon.min.css vendored Normal file
View File

@ -0,0 +1 @@
.site-icon-preview .favicon-preview{margin:5px 0 20px;overflow:hidden;position:relative;max-width:180px}.site-icon-preview .browser-title,.site-icon-preview .favicon{height:16px;left:88px;overflow:hidden;position:absolute;top:16px}.site-icon-preview .favicon{width:16px}.site-icon-preview .browser-title{left:109px}.site-icon-preview .app-icon-preview{background-color:#000;-webkit-border-radius:16px;border-radius:16px;height:64px;overflow:hidden;width:64px;margin-top:5px}

1
wp-admin/css/themes-rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/themes.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/widgets-rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

1
wp-admin/css/widgets.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -15,7 +15,11 @@ require( ABSPATH . 'wp-admin/includes/noop.php' );
require( ABSPATH . WPINC . '/script-loader.php' );
require( ABSPATH . WPINC . '/version.php' );
$load = preg_replace( '/[^a-z0-9,_-]+/i', '', $_GET['load'] );
$load = $_GET['load'];
if ( is_array( $load ) ) {
$load = implode( '', $load );
}
$load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load );
$load = array_unique( explode( ',', $load ) );
if ( empty($load) )
@ -44,6 +48,11 @@ foreach ( $load as $handle ) {
continue;
$style = $wp_styles->registered[$handle];
if ( empty( $style->src ) ) {
continue;
}
$path = ABSPATH . $style->src;
if ( $rtl && ! empty( $style->extra['rtl'] ) ) {

View File

@ -249,6 +249,7 @@ if ( isset( $_GET['replytocom'] ) )
// Login actions
add_action( 'login_head', 'wp_print_head_scripts', 9 );
add_action( 'login_head', 'print_admin_styles', 9 );
add_action( 'login_head', 'wp_site_icon', 99 );
add_action( 'login_footer', 'wp_print_footer_scripts', 20 );
add_action( 'login_init', 'send_frame_options_header', 10, 0 );

View File

@ -718,8 +718,24 @@ function wp_default_styles( &$styles ) {
$suffix = SCRIPT_DEBUG ? '' : '.min';
// Admin CSS
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array( 'open-sans', 'dashicons' ) );
$styles->add( 'login', "/wp-admin/css/login$suffix.css", array( 'buttons', 'open-sans', 'dashicons' ) );
$styles->add( 'common', "/wp-admin/css/common$suffix.css" );
$styles->add( 'forms', "/wp-admin/css/forms$suffix.css" );
$styles->add( 'admin-menu', "/wp-admin/css/admin-menu$suffix.css" );
$styles->add( 'dashboard', "/wp-admin/css/dashboard$suffix.css" );
$styles->add( 'list-tables', "/wp-admin/css/list-tables$suffix.css" );
$styles->add( 'edit', "/wp-admin/css/edit$suffix.css" );
$styles->add( 'revisions', "/wp-admin/css/revisions$suffix.css" );
$styles->add( 'media', "/wp-admin/css/media$suffix.css" );
$styles->add( 'themes', "/wp-admin/css/themes$suffix.css" );
$styles->add( 'about', "/wp-admin/css/about$suffix.css" );
$styles->add( 'nav-menus', "/wp-admin/css/nav-menus$suffix.css" );
$styles->add( 'widgets', "/wp-admin/css/widgets$suffix.css" );
$styles->add( 'site-icon', "/wp-admin/css/site-icon$suffix.css" );
$styles->add( 'l10n', "/wp-admin/css/l10n$suffix.css" );
$styles->add( 'wp-admin', false, array( 'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus', 'widgets', 'site-icon', 'l10n', 'open-sans', 'dashicons' ) );
$styles->add( 'login', "/wp-admin/css/login$suffix.css", array( 'buttons', 'forms', 'l10n', 'open-sans', 'dashicons' ) );
$styles->add( 'install', "/wp-admin/css/install$suffix.css", array( 'buttons', 'open-sans' ) );
$styles->add( 'wp-color-picker', "/wp-admin/css/color-picker$suffix.css" );
$styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie', 'imgareaselect' ) );
@ -761,7 +777,9 @@ function wp_default_styles( &$styles ) {
// RTL CSS
$rtl_styles = array(
// wp-admin
'wp-admin', 'install', 'wp-color-picker', 'customize-controls', 'customize-widgets', 'customize-nav-menus', 'ie', 'login', 'press-this',
'common', 'forms', 'admin-menu', 'dashboard', 'list-tables', 'edit', 'revisions', 'media', 'themes', 'about', 'nav-menus',
'widgets', 'site-icon', 'l10n', 'install', 'wp-color-picker', 'customize-controls', 'customize-widgets', 'customize-nav-menus',
'ie', 'login', 'press-this',
// wp-includes
'buttons', 'admin-bar', 'wp-auth-check', 'editor-buttons', 'media-views', 'wp-pointer',
'wp-jquery-ui-dialog',
@ -1100,6 +1118,7 @@ function print_late_styles() {
return;
}
script_concat_settings();
$wp_styles->do_concat = $concatenate_scripts;
$wp_styles->do_footer_items();
@ -1134,10 +1153,14 @@ function _print_styles() {
if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP )
$zip = 'gzip';
if ( !empty($wp_styles->concat) ) {
if ( $concat = trim( $wp_styles->concat, ', ' ) ) {
$dir = $wp_styles->text_direction;
$ver = $wp_styles->default_version;
$href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}&load=" . trim($wp_styles->concat, ', ') . '&ver=' . $ver;
$concat = str_split( $concat, 128 );
$concat = 'load%5B%5D=' . implode( '&load%5B%5D=', $concat );
$href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}&" . $concat . '&ver=' . $ver;
echo "<link rel='stylesheet' href='" . esc_attr($href) . "' type='text/css' media='all' />\n";
if ( !empty($wp_styles->print_code) ) {
@ -1167,7 +1190,7 @@ function script_concat_settings() {
if ( ! isset($concatenate_scripts) ) {
$concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true;
if ( ! is_admin() || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) )
if ( ( ! is_admin() && ! did_action( 'login_init' ) ) || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) )
$concatenate_scripts = false;
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-1453085953122';
$wp_version = '4.5-alpha-1453111034627';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -68,7 +68,7 @@ function login_header( $title = 'Log In', $message = '', $wp_error = '' ) {
<title><?php bloginfo('name'); ?> &rsaquo; <?php echo $title; ?></title>
<?php
wp_admin_css( 'login', true );
wp_enqueue_style( 'login' );
/*
* Remove all stored post data on logging out.
@ -87,6 +87,7 @@ function login_header( $title = 'Log In', $message = '', $wp_error = '' ) {
* @since 3.1.0
*/
do_action( 'login_enqueue_scripts' );
/**
* Fires in the login page header after scripts are enqueued.
*