Fix Bartik Drupal core theme performance coverage for Node preview component CSS style loaded for anonymous users

Created on 20 April 2021, over 4 years ago
Updated 18 September 2025, 23 days ago

Problem/Motivation

Having a performance coverage issue of 100% not used CSS from the

Node preview component CSS style

node.preview.css
On anonymous users or when not previewing a node

Steps to reproduce

Switch off CSS and JavaScript aggregation and advanced aggregations
Find Unused JavaScript And CSS With The Coverage Tab

Proposed resolution

Load only on node preview for logged in users
The Drupal core node module has a drupal.node.preview but themes are not overriding or extending the library

drupal.node.preview:
  version: VERSION
  css:
    theme:
      css/node.preview.css: {}
  js:
    node.preview.js: {}
  dependencies:
    - core/jquery
    - core/jquery.once
    - core/drupal
    - core/drupal.dialog
    - core/drupal.form

The Stable Drupal core theme is doing

libraries-override:
  node/drupal.node.preview:
    css:
      theme:
        css/node.preview.css: css/node/node.preview.css

The Olivero Drupal core front-end theme is doing

libraries-extend:
  node/drupal.node.preview:
    - olivero/drupal.node.preview

Having the Olivero libraries extend way

Remaining tasks

  • Fix
  • Performance coverage test
  • Functional test
  • Review
  • Release

User interface changes

  • None

API changes

  • None

Data model changes

  • None
🐛 Bug report
Status

Needs work

Version

1.0

Component

Look and Feel

Created by

🇯🇴Jordan Rajab Natshah Jordan

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

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