Commit 090d5570 authored by webchick's avatar webchick

Issue #2368739 by Wim Leers: Fixed user_page_attachments() unnecessarily adds...

Issue #2368739 by Wim Leers: Fixed user_page_attachments() unnecessarily adds an individual CSS file on every page.
parent d806a9bb
/**
* @file
* Admin styling for the User module.
*/
#permissions td.module {
font-weight: bold;
}
#permissions td.permission {
padding-left: 1.5em; /* LTR */
}
[dir="rtl"] #permissions td.permission {
padding-left: 0;
padding-right: 1.5em;
}
#permissions tr.odd .form-item,
#permissions tr.even .form-item {
white-space: normal;
}
#user-admin-settings .details-description {
font-size: 0.85em;
padding-bottom: .5em;
}
#permissions td.module {
font-weight: bold;
}
#permissions td.permission {
padding-left: 1.5em; /* LTR */
}
[dir="rtl"] #permissions td.permission {
padding-left: 0;
padding-right: 1.5em;
}
#permissions tr.odd .form-item,
#permissions tr.even .form-item {
white-space: normal;
}
#user-admin-settings .details-description {
font-size: 0.85em;
padding-bottom: .5em;
}
/**
* Password strength indicator.
*/
......
......@@ -65,6 +65,8 @@ public function buildForm(array $form, FormStateInterface $form_state) {
$mail_config = $this->config('user.mail');
$site_config = $this->config('system.site');
$form['#attached']['library'][] = 'user/drupal.user.admin';
// Settings for anonymous users.
$form['anonymous_settings'] = array(
'#type' => 'details',
......
......@@ -10,6 +10,12 @@ drupal.user:
- core/drupal
- core/jquery.once
drupal.user.admin:
version: VERSION
css:
theme:
css/user.admin.css: {}
drupal.user.permissions:
version: VERSION
js:
......@@ -19,6 +25,7 @@ drupal.user.permissions:
- core/jquery.once
- core/drupal
- core/drupalSettings
- user/drupal.user.admin
drupal.user.icons:
version: VERSION
......
......@@ -107,14 +107,6 @@ function user_theme() {
);
}
/**
* Implements hook_page_attachments().
*/
function user_page_attachments(array &$page) {
$path = drupal_get_path('module', 'user');
$page['#attached']['css'][$path . '/css/user.module.css'] = array('every_page' => TRUE);
}
/**
* Implements hook_js_alter().
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment