Skip to content

404: move assett injector css - #28

Merged
protitude merged 1 commit into
2.0.xfrom
fix-1329
Aug 26, 2026
Merged

404: move assett injector css#28
protitude merged 1 commit into
2.0.xfrom
fix-1329

Conversation

@protitude

Copy link
Copy Markdown
Collaborator

Pulling in 404 css

@protitude
protitude requested a lite review from Copilot August 26, 2026 19:26
@protitude
protitude merged commit ba85149 into 2.0.x Aug 26, 2026
2 checks passed
@protitude
protitude deleted the fix-1329 branch August 26, 2026 19:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the custom Drupal 404 page so its assets (CSS/JS) are properly attached via the oit/oit_404 library and the controller returns a render array (instead of pre-rendered markup), which helps preserve attachments and render metadata.

Changes:

  • Return the 404 page as a render array from OitController::oit404() instead of flattening it into #markup.
  • Add core/jquery as an explicit dependency of the oit_404 library (used by js/404.js).
  • Scope most 404 CSS rules under #containAll404 to reduce accidental styling bleed.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Controller/OitController.php Returns the 404 inline template as a render array to preserve attachments/metadata.
oit.libraries.yml Adds explicit core/jquery dependency to the oit_404 library.
css/404.css Adds file header docs and scopes selectors under #containAll404 for 404-only styling.
Suppressed comments (1)

css/404.css:168

  • The file header notes scoping to avoid style leakage, but the global .breadcrumb rule will still hide breadcrumbs anywhere this library is attached. If the intent is for this to be 404-only, scope the selector to the 404 path/body class so the rule can’t affect other pages.
/* PAGE HIDES */
.breadcrumb {
  display: none;
}

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +258 to +261
// Return the render array directly rather than flattening it into
// '#markup': that keeps the attached library and the cacheability
// metadata on the element that owns them.
return $custom;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants