0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-21 18:54:30 +01:00

Add $enable-print-styles variable for _print.scss; fixes #19101

[skip sauce]
This commit is contained in:
Chris Rebert 2016-02-06 21:35:18 -08:00
parent 3bd8dee1c7
commit ecdfc71d1f
2 changed files with 102 additions and 99 deletions

View File

@ -8,107 +8,109 @@
// http://www.phpied.com/delay-loading-your-print-css/ // http://www.phpied.com/delay-loading-your-print-css/
// ========================================================================== // ==========================================================================
@media print { @if $enable-print-styles {
*, @media print {
*::before, *,
*::after, *::before,
*::first-letter, *::after,
*::first-line { *::first-letter,
// Bootstrap specific; comment out `color` and `background` *::first-line {
//color: #000 !important; // Black prints faster: // Bootstrap specific; comment out `color` and `background`
// http://www.sanbeiji.com/archives/953 //color: #000 !important; // Black prints faster:
text-shadow: none !important; // http://www.sanbeiji.com/archives/953
//background: transparent !important; text-shadow: none !important;
box-shadow: none !important; //background: transparent !important;
} box-shadow: none !important;
a,
a:visited {
text-decoration: underline;
}
// Bootstrap specific; comment the following selector out
//a[href]::after {
// content: " (" attr(href) ")";
//}
abbr[title]::after {
content: " (" attr(title) ")";
}
// Bootstrap specific; comment the following selector out
//
// Don't show links that are fragment identifiers,
// or use the `javascript:` pseudo protocol
//
//a[href^="#"]::after,
//a[href^="javascript:"]::after {
// content: "";
//}
pre,
blockquote {
border: $border-width solid #999; // Bootstrap custom code; using `$border-width` instead of 1px
page-break-inside: avoid;
}
//
// Printing Tables:
// http://css-discuss.incutio.com/wiki/Printing_Tables
//
thead {
display: table-header-group;
}
tr,
img {
page-break-inside: avoid;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
// Bootstrap specific changes start
// Bootstrap components
.navbar {
display: none;
}
.btn,
.dropup > .btn {
> .caret {
border-top-color: #000 !important;
} }
}
.label {
border: $border-width solid #000;
}
.table { a,
border-collapse: collapse !important; a:visited {
text-decoration: underline;
td,
th {
background-color: #fff !important;
} }
}
.table-bordered {
th,
td {
border: 1px solid #ddd !important;
}
}
// Bootstrap specific changes end // Bootstrap specific; comment the following selector out
//a[href]::after {
// content: " (" attr(href) ")";
//}
abbr[title]::after {
content: " (" attr(title) ")";
}
// Bootstrap specific; comment the following selector out
//
// Don't show links that are fragment identifiers,
// or use the `javascript:` pseudo protocol
//
//a[href^="#"]::after,
//a[href^="javascript:"]::after {
// content: "";
//}
pre,
blockquote {
border: $border-width solid #999; // Bootstrap custom code; using `$border-width` instead of 1px
page-break-inside: avoid;
}
//
// Printing Tables:
// http://css-discuss.incutio.com/wiki/Printing_Tables
//
thead {
display: table-header-group;
}
tr,
img {
page-break-inside: avoid;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
// Bootstrap specific changes start
// Bootstrap components
.navbar {
display: none;
}
.btn,
.dropup > .btn {
> .caret {
border-top-color: #000 !important;
}
}
.label {
border: $border-width solid #000;
}
.table {
border-collapse: collapse !important;
td,
th {
background-color: #fff !important;
}
}
.table-bordered {
th,
td {
border: 1px solid #ddd !important;
}
}
// Bootstrap specific changes end
}
} }

View File

@ -50,6 +50,7 @@ $enable-gradients: false !default;
$enable-transitions: false !default; $enable-transitions: false !default;
$enable-hover-media-query: false !default; $enable-hover-media-query: false !default;
$enable-grid-classes: true !default; $enable-grid-classes: true !default;
$enable-print-styles: true !default;
// Spacing // Spacing