Skip to content

Commit

Permalink
Add overrides to fix print styles
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed Jan 4, 2023
1 parent a230f0c commit 95213de
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/_sass/base/_print_overrides.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Overrides for printing so only page content is printed
@media print {
// Ignore navigation elements and other non-necessary interactive ones
.site-header, .subnav, .site-footer, .site-sidebar, .navbar,
#site-toc--side, #page-github-links, #cookie-notice, .site-banner,
.code-excerpt__copy-btn, .breadcrumb {
display: none !important;
}

// Make sure content fills up 100% of width
.site-content {
max-width: 100% !important;
margin-left: 0;
padding-left: 0;
border: none;
flex: 1;
}

// Remove DartPad iframes since they are not functional
.code-excerpt iframe {
display: none;
}

// Display underlines under links
a {
text-decoration: underline;
}

// Remove external link icon and link path
a:after {
content: none !important;
}

// Show borders around notes and code blocks
.alert, pre {
border: 1px solid black;
}
}
1 change: 1 addition & 0 deletions src/_sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@

// -- Overrides
@import 'base/site_overrides';
@import 'base/print_overrides';

0 comments on commit 95213de

Please sign in to comment.