Skip to content

fix(css): resolve blank main content area when printing pages#5996

Closed
herley-shaori wants to merge 1 commit intoColorlibHQ:masterfrom
herley-shaori:fix/print-layout-blank-content
Closed

fix(css): resolve blank main content area when printing pages#5996
herley-shaori wants to merge 1 commit intoColorlibHQ:masterfrom
herley-shaori:fix/print-layout-blank-content

Conversation

@herley-shaori
Copy link

@herley-shaori herley-shaori commented Mar 10, 2026

Summary

Fixes #5982

When using browser print preview on any AdminLTE v4 page, only the sidebar navigation was rendered while the main content area (cards, tables, widgets, charts, text) appeared completely blank.

The root cause was that the CSS Grid layout combined with position: sticky/fixed on the sidebar and overflow: auto on the main content caused browsers to clip or hide the main content during print rendering.

Changes

Added @media print rules to src/scss/_accessibility.scss that:

  • Preserve the grid layout with explicit column definitions (auto 1fr) so sidebar and main content appear side by side
  • Reset the sidebar to position: static with a compact 200px width, removing sticky/fixed positioning that breaks print rendering
  • Set overflow: visible on .sidebar-wrapper, .app-main, and .app-content to prevent content clipping during print
  • Remove max-height constraints on the sidebar so all navigation items are printed without scrollable overflow
  • Reset .app-header and .app-footer to position: static for proper document flow in print output
  • Hide .sidebar-overlay which is not needed in print

Before (sidebar only, main content blank)

The original issue — only sidebar navigation is visible in print preview:

image

After (sidebar + main content both visible)

Both sidebar and main content (dashboard cards, charts, widgets, etc.) are fully rendered:

image

Test plan

  • Open any AdminLTE v4 page (e.g. Dashboard)
  • Open browser print preview (Ctrl/Cmd + P)
  • Verify that both sidebar navigation and main content area are visible
  • Test across Chrome, Firefox, and Safari
  • Verify normal (non-print) layout is unaffected

…ibHQ#5982)

When using browser print preview on any AdminLTE v4 page, only the
sidebar navigation was rendered while the main content area (cards,
tables, widgets, charts, text) appeared completely blank.

The root cause was that the CSS Grid layout combined with
position: sticky/fixed on the sidebar and overflow: auto on the
main content caused browsers to clip or hide the main content
during print rendering.

This fix adds @media print rules to the existing accessibility
stylesheet that:

- Preserve the grid layout with explicit column definitions
  (auto 1fr) so sidebar and main content appear side by side
- Reset the sidebar to position: static with a compact 200px width,
  removing sticky/fixed positioning that breaks print rendering
- Set overflow: visible on sidebar-wrapper, app-main, and
  app-content to prevent content clipping during print
- Remove max-height constraints on the sidebar so all navigation
  items are printed without scrollable overflow
- Reset app-header and app-footer to position: static for proper
  document flow in print output
- Hide the sidebar-overlay which is not needed in print

The result is both the sidebar navigation and all main content
(dashboard cards, charts, chat widgets, tables, etc.) are fully
visible in print preview and printed output.
@netlify
Copy link

netlify bot commented Mar 10, 2026

Deploy Preview for adminlte-v4 ready!

Name Link
🔨 Latest commit a6fb853
🔍 Latest deploy log https://app.netlify.com/projects/adminlte-v4/deploys/69af75967f525100087a7470
😎 Deploy Preview https://deploy-preview-5996--adminlte-v4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

puikinsh added a commit that referenced this pull request Mar 10, 2026
Add @media print rules to reset sticky/fixed positioning and overflow
constraints that caused browsers to clip main content during printing.

Based on PR #5996 by @herley-shaori, rebuilt dist from current master.

Co-Authored-By: Herley <herleys@xlsmart.co.id>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@puikinsh
Copy link
Member

Hi @herley-shaori, thank you so much for this contribution! 🙏 Great catch on the print layout issue — the root cause analysis was spot on.

We've merged your SCSS changes into master (commit b0bbe0a) with a clean dist rebuild from the current codebase. The original PR's compiled dist/ files included some unrelated vendor prefix removals (from a different Autoprefixer version), so we cherry-picked just the source change and rebuilt locally to keep the diff focused.

Your print layout fix is now live on master. Thanks again for taking the time to diagnose and fix this!

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.

[BUG] Print layout broken: main content is not visible

2 participants