mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-14 17:44:15 +02:00
Print tweaks (#25164)
* Add min-width to body when printing This should address some inconsistencies between browsers when printing. It applies a min-width to the body so that the content better resembles what your might see on your screen. I've made it a variable for easy customizing, too. * Don't underline buttons when printing * Add basic print styles for page and body size to create a semi-consistent print experience across browsers
This commit is contained in:
@@ -20,10 +20,11 @@
|
|||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
a,
|
a {
|
||||||
a:visited {
|
&:not(.btn) {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Bootstrap specific; comment the following selector out
|
// Bootstrap specific; comment the following selector out
|
||||||
//a[href]::after {
|
//a[href]::after {
|
||||||
@@ -82,6 +83,19 @@
|
|||||||
|
|
||||||
// Bootstrap specific changes start
|
// Bootstrap specific changes start
|
||||||
|
|
||||||
|
// Specify a size and min-width to make printing closer across browsers.
|
||||||
|
// We don't set margin here because it breaks `size` in Chrome. We also
|
||||||
|
// don't use `!important` on `size` as it breaks in Chrome.
|
||||||
|
@page {
|
||||||
|
size: $print-page-size;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
min-width: $print-body-min-width !important;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
min-width: $print-body-min-width !important;
|
||||||
|
}
|
||||||
|
|
||||||
// Bootstrap components
|
// Bootstrap components
|
||||||
.navbar {
|
.navbar {
|
||||||
display: none;
|
display: none;
|
||||||
|
@@ -882,3 +882,8 @@ $kbd-bg: $gray-900 !default;
|
|||||||
|
|
||||||
$pre-color: $gray-900 !default;
|
$pre-color: $gray-900 !default;
|
||||||
$pre-scrollable-max-height: 340px !default;
|
$pre-scrollable-max-height: 340px !default;
|
||||||
|
|
||||||
|
|
||||||
|
// Printing
|
||||||
|
$print-page-size: a3 !default;
|
||||||
|
$print-body-min-width: map-get($grid-breakpoints, "lg") !default;
|
||||||
|
Reference in New Issue
Block a user