_print.scss 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. // stylelint-disable declaration-no-important, selector-no-qualifying-type
  2. // Source: https://github.com/h5bp/main.css/blob/master/src/_print.css
  3. // ==========================================================================
  4. // Print styles.
  5. // Inlined to avoid the additional HTTP request:
  6. // https://www.phpied.com/delay-loading-your-print-css/
  7. // ==========================================================================
  8. @if $enable-print-styles {
  9. @media print {
  10. *,
  11. *::before,
  12. *::after {
  13. // Bootstrap specific; comment out `color` and `background`
  14. //color: $black !important; // Black prints faster
  15. text-shadow: none !important;
  16. //background: transparent !important;
  17. box-shadow: none !important;
  18. }
  19. a {
  20. &:not(.btn) {
  21. text-decoration: underline;
  22. }
  23. }
  24. // Bootstrap specific; comment the following selector out
  25. //a[href]::after {
  26. // content: " (" attr(href) ")";
  27. //}
  28. abbr[title]::after {
  29. content: " (" attr(title) ")";
  30. }
  31. // Bootstrap specific; comment the following selector out
  32. //
  33. // Don't show links that are fragment identifiers,
  34. // or use the `javascript:` pseudo protocol
  35. //
  36. //a[href^="#"]::after,
  37. //a[href^="javascript:"]::after {
  38. // content: "";
  39. //}
  40. pre {
  41. white-space: pre-wrap !important;
  42. }
  43. pre,
  44. blockquote {
  45. border: $border-width solid $gray-500; // Bootstrap custom code; using `$border-width` instead of 1px
  46. page-break-inside: avoid;
  47. }
  48. tr,
  49. img {
  50. page-break-inside: avoid;
  51. }
  52. p,
  53. h2,
  54. h3 {
  55. orphans: 3;
  56. widows: 3;
  57. }
  58. h2,
  59. h3 {
  60. page-break-after: avoid;
  61. }
  62. // Bootstrap specific changes start
  63. // Specify a size and min-width to make printing closer across browsers.
  64. // We don't set margin here because it breaks `size` in Chrome. We also
  65. // don't use `!important` on `size` as it breaks in Chrome.
  66. @page {
  67. size: $print-page-size;
  68. }
  69. body {
  70. min-width: $print-body-min-width !important;
  71. }
  72. .container {
  73. min-width: $print-body-min-width !important;
  74. }
  75. // Bootstrap components
  76. .navbar {
  77. display: none;
  78. }
  79. .badge {
  80. border: $border-width solid $black;
  81. }
  82. .table {
  83. border-collapse: collapse !important;
  84. td,
  85. th {
  86. background-color: $white !important;
  87. }
  88. }
  89. .table-bordered {
  90. th,
  91. td {
  92. border: 1px solid $gray-300 !important;
  93. }
  94. }
  95. .table-dark {
  96. color: inherit;
  97. th,
  98. td,
  99. thead th,
  100. tbody + tbody {
  101. border-color: $table-border-color;
  102. }
  103. }
  104. .table .thead-dark th {
  105. color: inherit;
  106. border-color: $table-border-color;
  107. }
  108. // Bootstrap specific changes end
  109. }
  110. }