Olivero: Remove CSS/JS from global styling where possible

Created on 12 July 2021, over 3 years ago
Updated 27 March 2023, almost 2 years ago

We have a number of stylesheets being added into Olivero's global styling that might not be needed.

For each of these we need to move the CSS/JS to its own library and then load the library only when necessary (via preprocess, twig, or extending other libraries).

  • css/components/breadcrumb.css -> could be loaded via twig
  • css/components/embedded-media.css -> could be loaded via twig
  • css/components/footer.css -> could be loaded via twig
  • css/components/container-inline.module.css
  • css/components/fieldset.css -> could be loaded via twig
  • css/components/header-site-branding.css -> could be loaded via twig
  • css/components/hero.css -> could be loaded via twig
  • css/components/messages.css -> maybe could be loaded via twig?
  • css/components/navigation/nav-primary-button.css -> could be loaded via twig
  • css/components/navigation/nav-primary.css -> could be loaded via twig
  • css/components/navigation/nav-primary-wide.css -> could be loaded via twig
  • css/components/navigation/nav-secondary.css -> could be loaded via twig
  • css/components/node.css -> could be loaded via twig
  • css/components/node-teaser.css -> could be loaded via twig
  • css/components/pager.css -> could be loaded via twig
  • css/components/text-content.css -> could be loaded via preprocess (where we add the CSS class)
  • css/components/tabledrag.css -> could be loaded via extending library
  • css/components/wide-image.css -> could be loaded via twig
📌 Task
Status

Needs work

Version

10.1

Component
Olivero 

Last updated 12 days ago

Created by

🇺🇸United States mherchel Gainesville, FL, US

Live updates comments and jobs are added and updated live.
  • Needs frontend framework manager review

    Used to alert the fron-tend framework manager core committer(s) that a front-end focused issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

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.

  • Status changed to Needs review about 2 years ago
  • 🇮🇳India _utsavsharma

    Patch for 10.1.x.

  • 🇮🇳India ranjith_kumar_k_u Kerala

    Re-rolled #18

  • 🇺🇸United States bnjmnm Ann Arbor, MI

    Even though these largely appear to be safe changes, this still means that many styles that used to load on every page will now only load in specific scenarios, so regressions may occur. This should get some kind of regression testing with a tool like BackstopJS or Wraith. I used Wraith to test some of the D8-D9 changes such as removing Classy and updating Normalize.css, and it caught many regressions that manual testing didn't. I think this should get something similar.

    There's another risk outside of core, and that is contrib modules expecting styles to be present that might no longer be there after these changes as they took advantage of the stylesheets happening to be there and not explicitly including them. There may be higher risk of this with some stylesheets than with others. These risks (or lack thereof) should probably be documented here so there's reasonable evidence regarding how safe it is to introduce these changes.

  • 🇺🇸United States smustgrave

    So question.

    I agree with the concept of the ticket but is it worth the possible disruption?

  • Status changed to Needs work almost 2 years ago
  • The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

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

Production build 0.71.5 2024