Refactor system/base library

Created on 22 May 2017, almost 8 years ago
Updated 21 January 2023, over 2 years ago

Currently, system_page_attachments() ads the system/baselibrary to all pages and this includes all kind of styles that might not be required for the page. I think that the library should be split into several smaller libraries.

Styles that are specific to certain pages, should be attached only on those pages.

For example the css/components/system-status-counter.css file is only required for the status-report-counter.html.twig template, and it makes sense to move this CSS file to a separate library one for the template or one for the system status page, toghether with other files like css/components/system-status-report-counters.css and css/components/system-status-report-general-info.css

And maybe css/components/ajax-progress.module.css should be moved to the system/drupal.ajax library.

Here is the definition of the library, and you can see that there are many other files that probably should be moved to a more specific library, like "tabledrag.module.css", "tablesort.module.css" or "autocomplete-loading.module.css"

base:
  version: VERSION
  css:
    # Adjust the weights to load these early.
    component:
      css/components/ajax-progress.module.css: { weight: -10 }
      css/components/align.module.css: { weight: -10 }
      css/components/autocomplete-loading.module.css: { weight: -10 }
      css/components/fieldgroup.module.css: { weight: -10 }
      css/components/container-inline.module.css: { weight: -10 }
      css/components/clearfix.module.css: { weight: -10 }
      css/components/details.module.css: { weight: -10 }
      css/components/hidden.module.css: { weight: -10 }
      css/components/item-list.module.css: { weight: -10 }
      css/components/js.module.css: { weight: -10 }
      css/components/nowrap.module.css: { weight: -10 }
      css/components/position-container.module.css: { weight: -10 }
      css/components/progress.module.css: { weight: -10 }
      css/components/reset-appearance.module.css: { weight: -10 }
      css/components/resize.module.css: { weight: -10 }
      css/components/sticky-header.module.css: { weight: -10 }
      css/components/system-status-counter.css: { weight: -10 }
      css/components/system-status-report-counters.css: { weight: -10 }
      css/components/system-status-report-general-info.css: { weight: -10 }
      css/components/tabledrag.module.css: { weight: -10 }
      css/components/tablesort.module.css: { weight: -10 }
      css/components/tree-child.module.css: { weight: -10 }
โœจ Feature request
Status

Needs work

Version

10.1 โœจ

Component
CSSย  โ†’

Last updated 4 days ago

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024