Skip to content

Instantly share code, notes, and snippets.

@Fclem
Last active March 11, 2022 09:55
Show Gist options
  • Save Fclem/c0835df6ce362a8b72811fa23ecaca89 to your computer and use it in GitHub Desktop.
Save Fclem/c0835df6ce362a8b72811fa23ecaca89 to your computer and use it in GitHub Desktop.
CSS enabling easy printout of Azure Devops markdown page preview from repositories browser
/*
* When you open a markdown file from a code repository in Azure Devops, inject this CSS into the code inspector of your browser.
* See https://stackoverflow.com/a/54613970 for instruction on how to do that.
*/
@media print {
pre, blockquote {
page-break-inside: avoid;
}
@page {
size: A4;
/* DIN A4 standard, Europe */
margin: 0.1in;
}
.bolt-tabbar.sticky, .project-header, .vss-Splitter--pane-fixed, .repos-files-header-path-row,
.vss-Splitter--divider, .navigation-container, .page-content, .repos-files-header-commandbar {
display: none !important;
padding: 0 !important;
margin: 0 !important;
}
.toc-container, .markdown-content>*:first-child, .toc-container + p {
/* hides the page table of content. Comment out if you want to keep it */
display: none !important;
padding: 0 !important;
margin: 0 !important;
}
.flex-grow, .full-size {
display: revert !important;
overflow: revert !important;
}
.bolt-header.repos-files-header {
padding-left: 0;
margin-left: 0;
}
.bolt-page-grey {
background-color: transparent !important;
}
.depth-8 {
box-shadow: none;
}
.hljs {
overflow: hidden !important;
word-break: break-all !important;
overflow-wrap: break-word !important;
}
}
@Fclem
Copy link
Author

Fclem commented Mar 11, 2022

Here is an example :
Original page :
initial
Without custom CSS :
without
With custom CSS :
with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment