File size: 2,705 Bytes
3878dd8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/* ============================================================================ */
/* Print styles */
/* ========================================================================= */
@media print {

  html,
  body {
    background: #fff;
  }

  /* Margins handled by Playwright; avoid extra global margins */
  body {
    margin: 0;
  }

  /* Keep the banner (hero), hide non-essential UI elements */
  #theme-toggle {
    display: none !important;
  }

  /* Links: remove underline and background */
  .content-grid main a {
    text-decoration: none;
    background: none;
    border-bottom: 1px solid rgba(0, 0, 0, .2);
  }

  /* Avoid breaks inside complex blocks */
  .content-grid main pre,
  .content-grid main blockquote,
  .content-grid main table,
  .content-grid main figure {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Soft page breaks around main headings */
  .content-grid main h2 {
    page-break-before: auto;
    page-break-after: avoid;
    break-after: avoid-page;
  }

  /* Small icon labels not needed when printing */
  .code-lang-chip {
    display: none !important;
  }

  /* Adjust more contrasty colors for print */
  :root {
    --surface-bg: #fff;
    --border-color: rgba(0, 0, 0, .2);
    --link-underline: rgba(0, 0, 0, .3);
    --link-underline-hover: rgba(0, 0, 0, .4);
  }

  /* Force single column to reduce widows/orphans and awkward breaks */
  .content-grid {
    grid-template-columns: 1fr !important;
  }

  .table-of-contents,
  .right-aside,
  .toc-mobile-toggle,
  .toc-mobile-backdrop,
  .toc-mobile-sidebar {
    display: none !important;
  }

  main>nav:first-of-type {
    display: none !important;
  }

  /* Avoid page breaks inside complex visual blocks */
  .hero,
  .hero-banner,
  .html-embed__card,
  .js-plotly-plot,
  figure,
  pre,
  table,
  blockquote,
  .wide,
  .full-width,
  .stack > *,
  .card,
  .palettes,
  .palette-card,
  .color-picker,
  .note {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Prefer keeping header+lead together */
  .hero {
    page-break-after: avoid;
  }

  /* Center the hero banner and constrain all its children generically */
  .hero-banner {
    width: 100% !important;
    max-width: 980px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow: hidden;
  }

  .hero-banner > *,
  .hero-banner svg,
  .hero-banner canvas,
  .hero-banner img,
  .hero-banner video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block;
  }
}


@media print {
  .meta-container-cell--pdf {
    display: none !important;
  }
}