diff --git a/core/core.libraries.yml b/core/core.libraries.yml index 3d5fcefba0fadd9d1b748a5a9231e4c3f63e79bb..3e933c5c9807e9323c32846b7d818e18b5413562 100644 --- a/core/core.libraries.yml +++ b/core/core.libraries.yml @@ -161,9 +161,6 @@ drupal.dialog: misc/dialog/dialog.js: {} misc/dialog/dialog.position.js: {} misc/dialog/dialog.jquery-ui.js: {} - css: - theme: - misc/dialog.theme.css: {} dependencies: - core/jquery - core/drupal @@ -199,8 +196,6 @@ drupal.dropbutton: css: component: misc/dropbutton/dropbutton.css: {} - theme: - misc/dropbutton/dropbutton.theme.css: {} dependencies: - core/jquery - core/drupal diff --git a/core/modules/file/css/file.theme.css b/core/modules/file/css/file.theme.css deleted file mode 100644 index e17e2b83c5c45cf5d285133ab96ee358f0250fec..0000000000000000000000000000000000000000 --- a/core/modules/file/css/file.theme.css +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @file - * Default style for file module. - */ - -/* File icons.*/ - -.file { - padding-left: 20px; /* LTR */ - display: inline-block; - min-height: 16px; - background-repeat: no-repeat; - background-position: left center; /* LTR */ -} -[dir="rtl"] .file { - padding-left: inherit; - padding-right: 20px; - background-position: right center; -} -.file--general, -.file--application-octet-stream { - background-image: url(../icons/application-octet-stream.png); -} -.file--package-x-generic { - background-image: url(../icons/package-x-generic.png); -} -.file--x-office-spreadsheet { - background-image: url(../icons/x-office-spreadsheet.png); -} -.file--x-office-document { - background-image: url(../icons/x-office-document.png); -} -.file--x-office-presentation { - background-image: url(../icons/x-office-presentation.png); -} -.file--text-x-script { - background-image: url(../icons/text-x-script.png); -} -.file--text-html { - background-image: url(../icons/text-html.png); -} -.file--text-plain { - background-image: url(../icons/text-plain.png); -} -.file--application-pdf { - background-image: url(../icons/application-pdf.png); -} -.file--application-x-executable { - background-image: url(../icons/application-x-executable.png); -} -.file--audio { - background-image: url(../icons/audio-x-generic.png); -} -.file--video { - background-image: url(../icons/video-x-generic.png); -} -.file--text { - background-image: url(../icons/text-x-generic.png); -} -.file--image { - background-image: url(../icons/image-x-generic.png); -} diff --git a/core/modules/file/file.libraries.yml b/core/modules/file/file.libraries.yml index c44af55c5e8da3edd96af2a5588c5c426a379145..f72a2eb61569fff7df81ae6329e4869f67d19ce5 100644 --- a/core/modules/file/file.libraries.yml +++ b/core/modules/file/file.libraries.yml @@ -12,10 +12,3 @@ drupal.file: - core/jquery.once - core/drupal - core/drupalSettings - -drupal.file.formatter.generic: - version: VERSION - css: - theme: - css/file.theme.css: {} - diff --git a/core/modules/file/src/Plugin/Field/FieldFormatter/GenericFileFormatter.php b/core/modules/file/src/Plugin/Field/FieldFormatter/GenericFileFormatter.php index a157d96678f740cd1416ca17793332b09e24fd58..6219cd00ae183d77eb12d09a6c4ef85d6cabce02 100644 --- a/core/modules/file/src/Plugin/Field/FieldFormatter/GenericFileFormatter.php +++ b/core/modules/file/src/Plugin/Field/FieldFormatter/GenericFileFormatter.php @@ -47,11 +47,6 @@ public function viewElements(FieldItemListInterface $items, $langcode) { unset($item->_attributes); } } - if (!empty($elements)) { - $elements['#attached'] = array( - 'library' => array('file/drupal.file.formatter.generic'), - ); - } return $elements; } diff --git a/core/modules/forum/forum.libraries.yml b/core/modules/forum/forum.libraries.yml deleted file mode 100644 index bf7079edd7fa47c1794481d8713828fa7ace305f..0000000000000000000000000000000000000000 --- a/core/modules/forum/forum.libraries.yml +++ /dev/null @@ -1,5 +0,0 @@ -forum.index: - version: VERSION - css: - component: - css/forum.theme.css: {} diff --git a/core/modules/forum/src/Controller/ForumController.php b/core/modules/forum/src/Controller/ForumController.php index 7f84a025ec3d4ec87ed0d54c3d3f75512b7c8bc6..7e2a8152c66c9ae40db7741f212e7a1ca5d65779 100644 --- a/core/modules/forum/src/Controller/ForumController.php +++ b/core/modules/forum/src/Controller/ForumController.php @@ -224,7 +224,6 @@ protected function build($forums, TermInterface $term, $topics = array(), $paren '#sortby' => $config->get('topics.order'), '#forums_per_page' => $config->get('topics.page_limit'), ); - $build['#attached']['library'][] = 'forum/forum.index'; if (empty($term->forum_container->value)) { $build['#attached']['feed'][] = array('taxonomy/term/' . $term->id() . '/feed', 'RSS - ' . $term->getName()); } diff --git a/core/modules/image/image.libraries.yml b/core/modules/image/image.libraries.yml index fbf9ef4b2294a4b4f52fb9056a0a6cd7e12bbe71..e9061a42e424560f6bfb455cb4fd1ea85b6101af 100644 --- a/core/modules/image/image.libraries.yml +++ b/core/modules/image/image.libraries.yml @@ -1,9 +1,3 @@ -form: - version: VERSION - css: - theme: - css/image.theme.css: {} - admin: version: VERSION css: diff --git a/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php b/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php index 1449c7f594768292a07618f39fce7f57249f9468..ec83970d07ecb8b5287290b86daa0ca7fbb18207 100644 --- a/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php +++ b/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php @@ -160,7 +160,6 @@ public static function process($element, FormStateInterface $form_state, $form) $item['fids'] = $element['fids']['#value']; $element['#theme'] = 'image_widget'; - $element['#attached']['library'][] = 'image/form'; // Add the image preview. if (!empty($element['#files']) && $element['#preview_image_style']) { diff --git a/core/modules/user/css/user.icons.theme.css b/core/modules/user/css/user.icons.admin.css similarity index 100% rename from core/modules/user/css/user.icons.theme.css rename to core/modules/user/css/user.icons.admin.css diff --git a/core/modules/user/user.libraries.yml b/core/modules/user/user.libraries.yml index e11cbfa29e7ffdac2f302472c33bcf7388b19e2f..73e4e15814686fe538a964a711efb69e86de0e6a 100644 --- a/core/modules/user/user.libraries.yml +++ b/core/modules/user/user.libraries.yml @@ -5,8 +5,6 @@ drupal.user: css: component: css/user.module.css: {} - theme: - css/user.theme.css: {} dependencies: - core/jquery - core/drupal @@ -33,4 +31,4 @@ drupal.user.icons: version: VERSION css: theme: - css/user.icons.theme.css: {} + css/user.icons.admin.css: {} diff --git a/core/themes/classy/classy.libraries.yml b/core/themes/classy/classy.libraries.yml index 67477a8bcd0caaeee70c412b563e53be0a878a4b..d39d2024518b629cb494cca96f7705b49ed6fc70 100644 --- a/core/themes/classy/classy.libraries.yml +++ b/core/themes/classy/classy.libraries.yml @@ -31,6 +31,30 @@ book-navigation: component: css/components/book-navigation.css: {} +dialog: + version: VERSION + css: + component: + css/components/dialog.css: { weight: -10 } + +dropbutton: + version: VERSION + css: + component: + css/components/dropbutton.css: { weight: -10 } + +file: + version: VERSION + css: + component: + css/components/file.css: { weight: -10 } + +forum: + version: VERSION + css: + component: + css/components/forum.css: { weight: -10 } + indented: version: VERSION css: @@ -60,3 +84,9 @@ search-results: css: component: css/components/search-results.css: {} + +user: + version: VERSION + css: + component: + css/components/user.css: { weight: -10 } diff --git a/core/themes/classy/classy.theme b/core/themes/classy/classy.theme new file mode 100644 index 0000000000000000000000000000000000000000..bc2cede4bd9b1bb375aefb87041e91944f14b19f --- /dev/null +++ b/core/themes/classy/classy.theme @@ -0,0 +1,26 @@ +getLibraryByName('classy', 'user'); + foreach ($library['css'] as $css) { + $libraries['drupal.user']['css']['component'][base_path() . $css['data']] = []; + } + } + if ($extension == 'core' && isset($libraries['drupal.dropbutton'])) { + $libraries['drupal.dropbutton']['dependencies'][] = 'classy/dropbutton'; + } + if ($extension == 'core' && isset($libraries['drupal.dialog'])) { + $libraries['drupal.dialog']['dependencies'][] = 'classy/dialog'; + } +} diff --git a/core/misc/dialog.theme.css b/core/themes/classy/css/components/dialog.css similarity index 99% rename from core/misc/dialog.theme.css rename to core/themes/classy/css/components/dialog.css index 837e49f63d8ce692e97c8cde8bf20aa7c1d87460..d45d34b1cb3d806b3041e37ee1d41b3090f5dacc 100644 --- a/core/misc/dialog.theme.css +++ b/core/themes/classy/css/components/dialog.css @@ -1,4 +1,5 @@ /** + * @file * Presentational styles for Drupal dialogs. */ diff --git a/core/misc/dropbutton/dropbutton.theme.css b/core/themes/classy/css/components/dropbutton.css similarity index 99% rename from core/misc/dropbutton/dropbutton.theme.css rename to core/themes/classy/css/components/dropbutton.css index 65f25685b9b86ffd1210f0a33b0bfb5111644caf..cf8c40a238a17c84e658b85e0fa62f5f2f8fc4b9 100644 --- a/core/misc/dropbutton/dropbutton.theme.css +++ b/core/themes/classy/css/components/dropbutton.css @@ -1,4 +1,3 @@ - /** * @file * General styles for dropbuttons. diff --git a/core/themes/classy/css/components/file.css b/core/themes/classy/css/components/file.css new file mode 100644 index 0000000000000000000000000000000000000000..5e16b4f768c13ecf6bf3b11f3e2fa537cdd33df8 --- /dev/null +++ b/core/themes/classy/css/components/file.css @@ -0,0 +1,62 @@ +/** + * @file + * Default style for file module. + */ + +/* File icons.*/ + +.file { + padding-left: 20px; /* LTR */ + display: inline-block; + min-height: 16px; + background-repeat: no-repeat; + background-position: left center; /* LTR */ +} +[dir="rtl"] .file { + padding-left: inherit; + padding-right: 20px; + background-position: right center; +} +.file--general, +.file--application-octet-stream { + background-image: url(../../images/icons/application-octet-stream.png); +} +.file--package-x-generic { + background-image: url(../../images/icons/package-x-generic.png); +} +.file--x-office-spreadsheet { + background-image: url(../../images/icons/x-office-spreadsheet.png); +} +.file--x-office-document { + background-image: url(../../images/icons/x-office-document.png); +} +.file--x-office-presentation { + background-image: url(../../images/icons/x-office-presentation.png); +} +.file--text-x-script { + background-image: url(../../images/icons/text-x-script.png); +} +.file--text-html { + background-image: url(../../images/icons/text-html.png); +} +.file--text-plain { + background-image: url(../../images/icons/text-plain.png); +} +.file--application-pdf { + background-image: url(../../images/icons/application-pdf.png); +} +.file--application-x-executable { + background-image: url(../../images/icons/application-x-executable.png); +} +.file--audio { + background-image: url(../../images/icons/audio-x-generic.png); +} +.file--video { + background-image: url(../../images/icons/video-x-generic.png); +} +.file--text { + background-image: url(../../images/icons/text-x-generic.png); +} +.file--image { + background-image: url(../../images/icons/image-x-generic.png); +} diff --git a/core/modules/forum/css/forum.theme.css b/core/themes/classy/css/components/forum.css similarity index 92% rename from core/modules/forum/css/forum.theme.css rename to core/themes/classy/css/components/forum.css index 1ce5c4daf32c4c2acb7ae1ec3ba1b97781fd24ae..2f715245205b5e7b98067e508d388f8afa45eb6d 100644 --- a/core/modules/forum/css/forum.theme.css +++ b/core/themes/classy/css/components/forum.css @@ -8,7 +8,7 @@ margin: 0.5em; } .forum__icon { - background-image: url(../icons/forum-icons.png); + background-image: url(../../images/icons/forum-icons.png); background-repeat: no-repeat; float: left; /* LTR */ height: 24px; diff --git a/core/modules/image/css/image.theme.css b/core/themes/classy/css/components/image-widget.css similarity index 100% rename from core/modules/image/css/image.theme.css rename to core/themes/classy/css/components/image-widget.css diff --git a/core/modules/user/css/user.theme.css b/core/themes/classy/css/components/user.css similarity index 100% rename from core/modules/user/css/user.theme.css rename to core/themes/classy/css/components/user.css diff --git a/core/modules/file/icons/application-octet-stream.png b/core/themes/classy/images/icons/application-octet-stream.png similarity index 100% rename from core/modules/file/icons/application-octet-stream.png rename to core/themes/classy/images/icons/application-octet-stream.png diff --git a/core/modules/file/icons/application-pdf.png b/core/themes/classy/images/icons/application-pdf.png similarity index 100% rename from core/modules/file/icons/application-pdf.png rename to core/themes/classy/images/icons/application-pdf.png diff --git a/core/modules/file/icons/application-x-executable.png b/core/themes/classy/images/icons/application-x-executable.png similarity index 100% rename from core/modules/file/icons/application-x-executable.png rename to core/themes/classy/images/icons/application-x-executable.png diff --git a/core/modules/file/icons/audio-x-generic.png b/core/themes/classy/images/icons/audio-x-generic.png similarity index 100% rename from core/modules/file/icons/audio-x-generic.png rename to core/themes/classy/images/icons/audio-x-generic.png diff --git a/core/modules/forum/icons/forum-icons.png b/core/themes/classy/images/icons/forum-icons.png similarity index 100% rename from core/modules/forum/icons/forum-icons.png rename to core/themes/classy/images/icons/forum-icons.png diff --git a/core/modules/file/icons/image-x-generic.png b/core/themes/classy/images/icons/image-x-generic.png similarity index 100% rename from core/modules/file/icons/image-x-generic.png rename to core/themes/classy/images/icons/image-x-generic.png diff --git a/core/modules/file/icons/package-x-generic.png b/core/themes/classy/images/icons/package-x-generic.png similarity index 100% rename from core/modules/file/icons/package-x-generic.png rename to core/themes/classy/images/icons/package-x-generic.png diff --git a/core/modules/file/icons/text-html.png b/core/themes/classy/images/icons/text-html.png similarity index 100% rename from core/modules/file/icons/text-html.png rename to core/themes/classy/images/icons/text-html.png diff --git a/core/modules/file/icons/text-plain.png b/core/themes/classy/images/icons/text-plain.png similarity index 100% rename from core/modules/file/icons/text-plain.png rename to core/themes/classy/images/icons/text-plain.png diff --git a/core/modules/file/icons/text-x-generic.png b/core/themes/classy/images/icons/text-x-generic.png similarity index 100% rename from core/modules/file/icons/text-x-generic.png rename to core/themes/classy/images/icons/text-x-generic.png diff --git a/core/modules/file/icons/text-x-script.png b/core/themes/classy/images/icons/text-x-script.png similarity index 100% rename from core/modules/file/icons/text-x-script.png rename to core/themes/classy/images/icons/text-x-script.png diff --git a/core/modules/file/icons/video-x-generic.png b/core/themes/classy/images/icons/video-x-generic.png similarity index 100% rename from core/modules/file/icons/video-x-generic.png rename to core/themes/classy/images/icons/video-x-generic.png diff --git a/core/modules/file/icons/x-office-document.png b/core/themes/classy/images/icons/x-office-document.png similarity index 100% rename from core/modules/file/icons/x-office-document.png rename to core/themes/classy/images/icons/x-office-document.png diff --git a/core/modules/file/icons/x-office-presentation.png b/core/themes/classy/images/icons/x-office-presentation.png similarity index 100% rename from core/modules/file/icons/x-office-presentation.png rename to core/themes/classy/images/icons/x-office-presentation.png diff --git a/core/modules/file/icons/x-office-spreadsheet.png b/core/themes/classy/images/icons/x-office-spreadsheet.png similarity index 100% rename from core/modules/file/icons/x-office-spreadsheet.png rename to core/themes/classy/images/icons/x-office-spreadsheet.png diff --git a/core/themes/classy/templates/content-edit/file-managed-file.html.twig b/core/themes/classy/templates/content-edit/file-managed-file.html.twig index f639237d2a0f4a3f851ba2fb4d82af5315304dbb..e7ae48d3fe2c04a54fed58a71620e587c7dfd2d1 100644 --- a/core/themes/classy/templates/content-edit/file-managed-file.html.twig +++ b/core/themes/classy/templates/content-edit/file-managed-file.html.twig @@ -10,6 +10,7 @@ * @see template_preprocess_file_managed_file() */ #} +{{ attach_library('classy/file') }} {% set classes = [ 'js-form-managed-file', diff --git a/core/themes/classy/templates/content-edit/file-widget.html.twig b/core/themes/classy/templates/content-edit/file-widget.html.twig index 55de590f57146a2bbc03d9a83245162350e02206..23d03a1ae18eeb5b45648ed7899a9bf8be6172ff 100644 --- a/core/themes/classy/templates/content-edit/file-widget.html.twig +++ b/core/themes/classy/templates/content-edit/file-widget.html.twig @@ -10,6 +10,7 @@ * @see template_preprocess_file_widget() */ #} +{{ attach_library('classy/file') }} {{ element }} diff --git a/core/themes/classy/templates/content-edit/image-widget.html.twig b/core/themes/classy/templates/content-edit/image-widget.html.twig index dac3a227b3d3a5eadd45b2538311a1c894fea040..5e8033ffaee2d4f38cc821b8b86769e5e4e7a7e4 100644 --- a/core/themes/classy/templates/content-edit/image-widget.html.twig +++ b/core/themes/classy/templates/content-edit/image-widget.html.twig @@ -10,6 +10,7 @@ * @see template_preprocess_image_widget() */ #} +{{ attach_library('classy/image-widget') }} {% if data.preview %}
diff --git a/core/themes/classy/templates/dataset/forums.html.twig b/core/themes/classy/templates/dataset/forums.html.twig index eada3a8af7547b489a45fab84d41535e3c138a05..e3f22129a9e83101ed42a9ab8ccfc1e335038cc5 100644 --- a/core/themes/classy/templates/dataset/forums.html.twig +++ b/core/themes/classy/templates/dataset/forums.html.twig @@ -14,6 +14,7 @@ * @see template_preprocess_forums() */ #} +{{ attach_library('classy/forum') }} {% if forums_defined %}
{{ forums }} diff --git a/core/themes/classy/templates/field/file-link.html.twig b/core/themes/classy/templates/field/file-link.html.twig index ad93361ebd73660716449a4f88cac5e56a7767b4..11170c0c0f65644d060bb6e20d5cdd7e5a47955a 100644 --- a/core/themes/classy/templates/field/file-link.html.twig +++ b/core/themes/classy/templates/field/file-link.html.twig @@ -11,4 +11,5 @@ * @see template_preprocess_file_link() */ #} +{{ attach_library('classy/file') }} {{ icon }} {{ link }} diff --git a/core/themes/seven/css/components/dialog.theme.css b/core/themes/seven/css/components/dialog.css similarity index 100% rename from core/themes/seven/css/components/dialog.theme.css rename to core/themes/seven/css/components/dialog.css diff --git a/core/themes/seven/seven.libraries.yml b/core/themes/seven/seven.libraries.yml index 764403b6400c4c94567ebe8b0a52c0ce49f772ab..cec9887e27a578b14ca32567fe365d2912906db4 100644 --- a/core/themes/seven/seven.libraries.yml +++ b/core/themes/seven/seven.libraries.yml @@ -92,4 +92,4 @@ seven.drupal.dialog: version: VERSION css: theme: - css/components/dialog.theme.css: {} + css/components/dialog.css: {} diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 9727e15d08b831b1273502a232a9610b4e8ed482..7bd56e04443fcc8f764db6f121faf30b5ad70f02 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -186,8 +186,8 @@ function seven_library_info_alter(&$libraries, $extension) { unset($libraries['jquery.ui']['css']['theme']['assets/vendor/jquery.ui/themes/base/theme.css']); $libraries['jquery.ui']['dependencies'][] = 'seven/seven.jquery.ui'; } - if ($extension == 'core' && isset($libraries['drupal.dialog'])) { - unset($libraries['drupal.dialog']['css']['theme']['misc/dialog.theme.css']); - $libraries['drupal.dialog']['dependencies'][] = 'seven/seven.drupal.dialog'; + if ($extension == 'classy' && isset($libraries['dialog'])) { + unset($libraries['dialog']['css']['component']['css/components/dialog.css']); + $libraries['dialog']['dependencies'][] = 'seven/seven.drupal.dialog'; } }