diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc index de519a2..bd90379 100644 --- a/core/includes/theme.maintenance.inc +++ b/core/includes/theme.maintenance.inc @@ -92,8 +92,10 @@ function _drupal_maintenance_theme() { } _drupal_theme_initialize($themes[$theme], array_reverse($base_theme), '_theme_load_offline_registry'); - // These CSS files are normally added by system_page_build() -except maintenance.css. - // When the database is inactive it's not called so we add them here. + // These CSS files are normally added by system_page_build(), except + // system.maintenance.css. When the database is inactive, it's not called so + // we add them here. + drupal_add_library('system', 'drupal.base'); $path = drupal_get_path('module', 'system'); drupal_add_css($path . '/css/system.module.css'); drupal_add_css($path . '/css/system.theme.css'); diff --git a/core/misc/drupal.base.css b/core/misc/drupal.base.css new file mode 100644 index 0000000..6e0d0c6 --- /dev/null +++ b/core/misc/drupal.base.css @@ -0,0 +1,89 @@ +/** + * @file + * Provides a base styling for HTML elements in Drupal. + */ + +/** + * Block-level HTML5 display definition. + * + * Provides display values for browsers that don't recognize the new elements + * and therefore display them inline by default. + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +main, +nav, +section, +summary { + display: block; +} + +/** + * Form elements. + */ +form { + margin: 0; + padding: 0; +} +fieldset { + border: 1px solid #ccc; + margin: 1em 0; + padding: 0.5em; +} +label { + display: block; + font-weight: bold; +} +input { + /* Keep form elements from overflowing their containers. */ + max-width: 100%; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +/** + * Table elements. + */ +table { + border-collapse: collapse; + width: 100%; +} +caption { + text-align: left; /* LTR */ +} +[dir=rtl] caption { + text-align: right; +} +th { + padding-right: 1em; /* LTR */ + text-align: left; /* LTR */ +} +[dir=rtl] th { + text-align: right; + padding-left: 1em; + padding-right: 0; +} +thead > tr { + border-bottom: 1px solid #000; +} +tr { + border-bottom: 1px solid #ccc; + padding: 0.1em 0.6em; +} + +/** + * Miscellaneous elements. + */ +hr { + border: 1px solid gray; + height: 1px; +} +img { + border: 0; +} diff --git a/core/modules/system/css/system.module.css b/core/modules/system/css/system.module.css index cf08f02..3faef3b 100644 --- a/core/modules/system/css/system.module.css +++ b/core/modules/system/css/system.module.css @@ -230,16 +230,6 @@ tr .ajax-progress-throbber .throbber { } /** - * Keep form elements from overflowing their containers. - */ -input { - max-width: 100%; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} - -/** * Inline items. */ .container-inline div, @@ -337,25 +327,3 @@ input { display: table; clear: both; } - -/** - * Block-level HTML5 display definition. - * - * Provides display values for browsers that don't recognize the new elements - * and therefore display them inline by default. - */ -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -menu, -nav, -section, -summary { - display: block; -} diff --git a/core/modules/system/css/system.theme.css b/core/modules/system/css/system.theme.css index af122e5..dd1057f 100644 --- a/core/modules/system/css/system.theme.css +++ b/core/modules/system/css/system.theme.css @@ -4,55 +4,6 @@ */ /** - * HTML elements. - */ -fieldset { - border: 1px solid #ccc; - margin: 1em 0; - padding: 0.5em; -} -form { - margin: 0; - padding: 0; -} -button { - font-size: 1em; -} -hr { - border: 1px solid gray; - height: 1px; -} -img { - border: 0; -} -table { - border-collapse: collapse; - width: 100%; -} -th { - padding-right: 1em; /* LTR */ - text-align: left; /* LTR */ -} -[dir=rtl] th { - text-align: right; - padding-left: 1em; - padding-right: 0; -} -thead > tr { - border-bottom: 1px solid #000; -} -tr { - border-bottom: 1px solid #ccc; - padding: 0.1em 0.6em; -} -caption { - text-align: left; /* LTR */ -} -[dir=rtl] caption { - text-align: right; -} - -/** * Publishing status. */ .unpublished { @@ -107,10 +58,6 @@ tr.even .form-item { .form-item .description { font-size: 0.85em; } -label { - display: block; - font-weight: bold; -} label.option { display: inline; font-weight: normal; @@ -223,6 +170,7 @@ button.link { cursor: pointer; margin: 0; padding: 0; + font-size: 1em; } label button.link { diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 8802ead..dfef727 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1546,11 +1546,23 @@ function system_library_info() { 'css' => array( 'core/assets/vendor/normalize-css/normalize.css' => array( 'every_page' => TRUE, - 'weight' => -10, + 'weight' => CSS_BASE - 20, ), ), ); + // Drupal's base CSS. + $libraries['drupal.base'] = array( + 'title' => 'Drupal base CSS', + 'version' => VERSION, + 'css' => array( + 'core/misc/drupal.base.css' => array( + 'every_page' => TRUE, + 'weight' => CSS_BASE - 10, + ), + ), + ); + // jQuery UI. $libraries['jquery.ui.core'] = array( 'title' => 'jQuery UI: Core', @@ -2514,6 +2526,8 @@ function system_filetransfer_info() { * Implements hook_page_build(). */ function system_page_build(&$page) { + // Note: ensure the same CSS is loaded in _drupal_maintenance_theme(). + $page['#attached']['library'][] = array('system', 'drupal.base'); $path = drupal_get_path('module', 'system'); // Adjust the weights to load these early. $page['#attached']['css'][$path . '/css/system.module.css'] = array('weight' => CSS_COMPONENT - 10, 'every_page' => TRUE);