diff --git a/core/modules/user/css/user.admin.css b/core/modules/user/css/user.admin.css new file mode 100644 index 00000000000..09387a3e6d9 --- /dev/null +++ b/core/modules/user/css/user.admin.css @@ -0,0 +1,24 @@ +/** + * @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; +} diff --git a/core/modules/user/css/user.module.css b/core/modules/user/css/user.module.css index 8a03bdb20b0..869d0168949 100644 --- a/core/modules/user/css/user.module.css +++ b/core/modules/user/css/user.module.css @@ -1,22 +1,3 @@ -#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. */ diff --git a/core/modules/user/src/AccountSettingsForm.php b/core/modules/user/src/AccountSettingsForm.php index 28f9b7b9f22..bce6a6064f7 100644 --- a/core/modules/user/src/AccountSettingsForm.php +++ b/core/modules/user/src/AccountSettingsForm.php @@ -65,6 +65,8 @@ class AccountSettingsForm extends ConfigFormBase { $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', diff --git a/core/modules/user/user.libraries.yml b/core/modules/user/user.libraries.yml index c32a17165fb..037023a6fbc 100644 --- a/core/modules/user/user.libraries.yml +++ b/core/modules/user/user.libraries.yml @@ -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 diff --git a/core/modules/user/user.module b/core/modules/user/user.module index c2037de051b..9c49486f6c8 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -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(). */