Issue #1924430 by echoz, JohnAlbin, izus, kim.pepper, LewisNyman: Add drupal.base library for base CSS styles.

8.0.x
Alex Pott 2013-07-10 12:48:56 +01:00
parent a7a57faafa
commit be502b46a7
5 changed files with 109 additions and 88 deletions

View File

@ -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');

89
core/misc/drupal.base.css Normal file
View File

@ -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;
}

View File

@ -229,16 +229,6 @@ tr .ajax-progress-throbber .throbber {
width: 16em;
}
/**
* 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.
*/
@ -353,25 +343,3 @@ input {
.align-justify {
text-align: justify;
}
/**
* 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;
}

View File

@ -3,55 +3,6 @@
* Basic styling for common markup.
*/
/**
* 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.
*/
@ -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 {

View File

@ -1533,11 +1533,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',
@ -2355,6 +2367,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);