diff --git a/core/modules/aggregator/aggregator.info b/core/modules/aggregator/aggregator.info
index 5954a87..66e1e51 100644
--- a/core/modules/aggregator/aggregator.info
+++ b/core/modules/aggregator/aggregator.info
@@ -4,5 +4,4 @@ package = Core
version = VERSION
core = 8.x
configure = admin/config/services/aggregator/settings
-stylesheets[all][] = aggregator.theme.css
dependencies[] = file
diff --git a/core/modules/aggregator/aggregator.pages.inc b/core/modules/aggregator/aggregator.pages.inc
index 0c04c7d..fb1f520 100644
--- a/core/modules/aggregator/aggregator.pages.inc
+++ b/core/modules/aggregator/aggregator.pages.inc
@@ -310,6 +310,7 @@ function theme_aggregator_summary_item($variables) {
* @see aggregator-wrapper.tpl.php
*/
function template_preprocess_aggregator_wrapper(&$variables) {
+ drupal_add_css(drupal_get_path('module', 'aggregator') . '/aggregator.theme.css');
$variables['pager'] = theme('pager');
}
diff --git a/core/modules/book/book.info b/core/modules/book/book.info
index 1f2be6f..b42a72b 100644
--- a/core/modules/book/book.info
+++ b/core/modules/book/book.info
@@ -5,4 +5,3 @@ version = VERSION
core = 8.x
dependencies[] = node
configure = admin/content/book/settings
-stylesheets[all][] = book.theme.css
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index f606e48..4e15fb3 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -1082,6 +1082,7 @@ function template_preprocess_book_all_books_block(&$variables) {
* @see book-navigation.tpl.php
*/
function template_preprocess_book_navigation(&$variables) {
+ drupal_add_css(drupal_get_path('module', 'book') . '/book.theme.css');
$book_link = $variables['book_link'];
// Provide extra variables for themers. Not needed by default.
diff --git a/core/modules/comment/comment.info b/core/modules/comment/comment.info
index 6028bda..340df76 100644
--- a/core/modules/comment/comment.info
+++ b/core/modules/comment/comment.info
@@ -6,4 +6,3 @@ core = 8.x
dependencies[] = node
dependencies[] = text
configure = admin/content/comment
-stylesheets[all][] = comment.theme.css
diff --git a/core/modules/comment/lib/Drupal/comment/CommentRenderController.php b/core/modules/comment/lib/Drupal/comment/CommentRenderController.php
index bc21cd2..88e5ba1 100644
--- a/core/modules/comment/lib/Drupal/comment/CommentRenderController.php
+++ b/core/modules/comment/lib/Drupal/comment/CommentRenderController.php
@@ -72,6 +72,7 @@ protected function alterBuild(array &$build, EntityInterface $comment, $view_mod
// Add indentation div or close open divs as needed.
if ($is_threaded) {
+ $build['#attached']['css'][] = drupal_get_path('module', 'comment') . '/comment.theme.css';
$prefix .= $comment->divs <= 0 ? str_repeat('', abs($comment->divs)) : "\n" . '
';
}
diff --git a/core/modules/field/field.info b/core/modules/field/field.info
index 88529e2..6ebd81e 100644
--- a/core/modules/field/field.info
+++ b/core/modules/field/field.info
@@ -5,4 +5,5 @@ version = VERSION
core = 8.x
dependencies[] = field_sql_storage
required = TRUE
+; @todo Add to field_attach_form() and field_attach_view().
stylesheets[all][] = theme/field.css
diff --git a/core/modules/forum/forum.info b/core/modules/forum/forum.info
index c348a2a..16fb879 100644
--- a/core/modules/forum/forum.info
+++ b/core/modules/forum/forum.info
@@ -8,4 +8,5 @@ package = Core
version = VERSION
core = 8.x
configure = admin/structure/forum
+; @todo
stylesheets[all][] = forum.css
diff --git a/core/modules/poll/poll.info b/core/modules/poll/poll.info
index 7cd674a..9a25d56 100644
--- a/core/modules/poll/poll.info
+++ b/core/modules/poll/poll.info
@@ -4,5 +4,6 @@ package = Core
version = VERSION
core = 8.x
dependencies[] = node
+; @todo
stylesheets[all][] = poll.base.css
stylesheets[all][] = poll.theme.css
diff --git a/core/modules/search/search.info b/core/modules/search/search.info
index 8fdbfaa..4e4ef23 100644
--- a/core/modules/search/search.info
+++ b/core/modules/search/search.info
@@ -4,4 +4,5 @@ package = Core
version = VERSION
core = 8.x
configure = admin/config/search/settings
+; @todo
stylesheets[all][] = search.theme.css
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index c3df4c1..bb8aa09 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -2314,8 +2314,9 @@ function system_filetransfer_info() {
*/
function system_init() {
$path = drupal_get_path('module', 'system');
- // Add the CSS for this module. These aren't in system.info, because they
- // need to be in the CSS_SYSTEM group rather than the CSS_DEFAULT group.
+ // Add the CSS for this module. These need to be loaded early, so use the
+ // CSS_SYSTEM group instead of the CSS_DEFAULT group.
+ // @todo Move into system_preprocess_page() or similar.
drupal_add_css($path . '/system.base.css', array('group' => CSS_SYSTEM, 'every_page' => TRUE));
if (path_is_admin(current_path())) {
drupal_add_css($path . '/system.admin.css', array('group' => CSS_SYSTEM));
@@ -2343,9 +2344,6 @@ function system_init() {
unset($_SESSION['ignore_slave_server']);
}
}
-
- // Add CSS/JS files from module .info files.
- system_add_module_assets();
}
/**
@@ -2369,24 +2367,6 @@ function system_get_localized_date_format($languages) {
}
/**
- * Adds CSS and JavaScript files declared in module .info files.
- */
-function system_add_module_assets() {
- foreach (system_get_module_info('stylesheets') as $module => $value) {
- foreach ($value as $media => $stylesheets) {
- foreach ($stylesheets as $stylesheet) {
- drupal_add_css($stylesheet, array('every_page' => TRUE, 'media' => $media));
- }
- }
- }
- foreach (system_get_module_info('scripts') as $module => $scripts) {
- foreach ($scripts as $script) {
- drupal_add_js($script, array('every_page' => TRUE));
- }
- }
-}
-
-/**
* Implements hook_custom_theme().
*/
function system_custom_theme() {
diff --git a/core/modules/system/tests/modules/common_test/common_test.info b/core/modules/system/tests/modules/common_test/common_test.info
index 9e6d24f..7a128ab 100644
--- a/core/modules/system/tests/modules/common_test/common_test.info
+++ b/core/modules/system/tests/modules/common_test/common_test.info
@@ -3,6 +3,4 @@ description = "Support module for Common tests."
package = Testing
version = VERSION
core = 8.x
-stylesheets[all][] = common_test.css
-stylesheets[print][] = common_test.print.css
hidden = TRUE
diff --git a/core/modules/user/user.info b/core/modules/user/user.info
index 7e497e6..d5a5449 100644
--- a/core/modules/user/user.info
+++ b/core/modules/user/user.info
@@ -5,4 +5,5 @@ version = VERSION
core = 8.x
required = TRUE
configure = admin/config/people
+; @todo
stylesheets[all][] = user.css