_print.less 2.6 KB

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