_print.scss 2.72 KB
Newer Older
XhmikosR's avatar
XhmikosR committed
1
// stylelint-disable declaration-no-important, selector-no-qualifying-type
Mark Otto's avatar
Mark Otto committed
2

3
// Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css
4
5
6

// ==========================================================================
// Print styles.
7
8
// Inlined to avoid the additional HTTP request:
// http://www.phpied.com/delay-loading-your-print-css/
9
// ==========================================================================
10

11
12
13
14
@if $enable-print-styles {
  @media print {
    *,
    *::before,
15
    *::after {
16
      // Bootstrap specific; comment out `color` and `background`
17
      //color: $black !important; // Black prints faster: http://www.sanbeiji.com/archives/953
18
19
20
21
      text-shadow: none !important;
      //background: transparent !important;
      box-shadow: none !important;
    }
22

Mark Otto's avatar
Mark Otto committed
23
24
25
26
    a {
      &:not(.btn) {
        text-decoration: underline;
      }
27
    }
28

29
30
31
32
    // Bootstrap specific; comment the following selector out
    //a[href]::after {
    //  content: " (" attr(href) ")";
    //}
33

34
35
36
    abbr[title]::after {
      content: " (" attr(title) ")";
    }
37

38
39
40
41
42
43
44
    // Bootstrap specific; comment the following selector out
    //
    // Don't show links that are fragment identifiers,
    // or use the `javascript:` pseudo protocol
    //

    //a[href^="#"]::after,
Patrick H. Lauke's avatar
Patrick H. Lauke committed
45
46
    //a[href^="javascript:"]::after {
    // content: "";
47
48
    //}

49
50
51
    pre {
      white-space: pre-wrap !important;
    }
52
53
    pre,
    blockquote {
54
      border: $border-width solid $gray-500;   // Bootstrap custom code; using `$border-width` instead of 1px
55
56
      page-break-inside: avoid;
    }
57

58
59
60
61
    //
    // Printing Tables:
    // http://css-discuss.incutio.com/wiki/Printing_Tables
    //
62

63
64
65
    thead {
      display: table-header-group;
    }
66

67
68
69
70
    tr,
    img {
      page-break-inside: avoid;
    }
71

72
73
74
75
76
77
    p,
    h2,
    h3 {
      orphans: 3;
      widows: 3;
    }
78

79
80
81
82
    h2,
    h3 {
      page-break-after: avoid;
    }
83

84
    // Bootstrap specific changes start
85

Mark Otto's avatar
Mark Otto committed
86
87
88
89
90
91
92
93
94
95
96
97
98
    // 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;
    }

99
100
101
102
    // Bootstrap components
    .navbar {
      display: none;
    }
103
    .badge {
104
      border: $border-width solid $black;
105
106
    }

107
108
    .table {
      border-collapse: collapse !important;
109

110
111
      td,
      th {
112
        background-color: $white !important;
113
      }
114
    }
115
116
117
    .table-bordered {
      th,
      td {
118
        border: 1px solid $gray-300 !important;
119
      }
120
121
    }

122
123
    // Bootstrap specific changes end
  }
124
}