-
-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Describe the Issue
Good evening, folks, I'm trying to print an article from the FCC News site to pdf and the navbar being position: fixed cuts off the first sentence of every paragraph on each page. (See screenshots and screencast)
Affected Page
https://www.freecodecamp.org/news/
Steps to Reproduce
- Open any article on https://www.freecodecamp.org/news/
- Right-click to open context menu and select "print"
- Scroll through content and notice that there is content being cut off by the navbar on every page.
Expected behavior
When printing an article all content should be visible and readable. Currently there is content being covered by the navbar. I also expect the page to not have a footer or navbar in general when printing.
Screenshots
Screencast of bug report (onedrive link)
System
- Device: [e.g. iPhone 6, Laptop]
- OS: [e.g. iOS 14, Windows 10, Ubuntu 20.04]
- Browser: [e.g. Chrome, Safari]
- Version: [e.g. 22]
Additional context
Possible Fix:
By using the @media print media query we could enable accurate printing for paper and pdf for news articles. Something that is very useful for the full-length books currently published on the site.
/* NEW FILE: assets/print.css */
/* https://github.com/freeCodeCamp/news/tree/main/src/_includes/assets/css */
/*
THESE STYLES ARE ONLY ACTIVATED ON PRINT MEDIA TYPE
*/
.site-nav {
display: none;
/* Can also be display:static if it's decided it should stay in print */
}
.banner {
display: none;
/* Can also be display:static if it's decided it should stay in print */
}
footer {
display: none;
/* Can be disregarded if it's decided footer should stay in print */
}
Enhancements
It would also be nice to implement the suggestions from this amazing article on making the web nice to print. Article
Thanks to the core team for their amazing work. FCC is truly a gem 😁