Add library override/extend file definitions

Created on 1 January 2018, almost 7 years ago
Updated 30 January 2023, almost 2 years ago

Problem/Motivation

Many library override/extend definitions can create a very large theme.info file, making it slightly difficult to maintain.

Proposed resolution

Themes should check for an existing theme.libraries.override.yml or theme.libraries.extend.yml file. If either file exists, the definitions in the file are used instead of the definitions in theme.info.

Remaining tasks

Reviews need, tests need to be written and run, documentation needs to be added. Waiting on initial feedback before proceeding.

User interface changes

None.

API changes

Theme developers will be allowed to specify a theme.library.override.yml or theme.library.extend.yml file, eg:

Override

# bartik.libraries.override.yml
core/drupal.dropbutton:
    css:
      component:
        /core/themes/stable/css/core/dropbutton/dropbutton.css: css/components/core/dropbutton.css

Extend

# bartik.libraries.extend.yml
system/base:
    - bartik/system.base
Feature request
Status

Needs work

Version

10.1

Component
Theme 

Last updated 1 day ago

Created by

Live updates comments and jobs are added and updated live.
  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

Sign in to follow issues

Comments & Activities

Not all content is available!

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

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Production build 0.71.5 2024