@jsonresume/core 0.3.7 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tokens.css CHANGED
@@ -98,13 +98,13 @@
98
98
  }
99
99
 
100
100
  @page {
101
- size: A4;
101
+ size: auto;
102
102
  margin: 0.5in;
103
103
  }
104
104
 
105
105
  /* Prevent awkward breaks */
106
106
  .resume-section {
107
- page-break-inside: avoid;
107
+ page-break-inside: auto;
108
108
  }
109
109
 
110
110
  .resume-item {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsonresume/core",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "Framework-agnostic resume component core - design tokens, primitives, and validators",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -18,7 +18,8 @@ const StyledSection = styled.section`
18
18
  props.theme?.spacing?.section || 'var(--resume-space-section, 2rem)'};
19
19
 
20
20
  @media print {
21
- page-break-inside: avoid;
21
+ /* Sections can span pages; their headings stay with the first entry. */
22
+ page-break-inside: auto;
22
23
  }
23
24
  `;
24
25
 
package/src/ssr/index.js CHANGED
@@ -25,6 +25,18 @@ const CSS_RESET =
25
25
  '<style>*,*::before,*::after{box-sizing:border-box}' +
26
26
  'html,body{margin:0;padding:0}body{-webkit-font-smoothing:antialiased}</style>';
27
27
 
28
+ // Page margins repeat on continuation pages; body padding does not. Themes
29
+ // can override these defaults with their own print rules later in the head.
30
+ const PRINT_DEFAULTS = `<style data-jsonresume-core-print>
31
+ @page{size:auto;margin:12mm}
32
+ @media print{
33
+ body,h1,h2,h3,h4,p,li,a{overflow-wrap:anywhere}
34
+ :where(main,aside,section,article,header,div){min-width:0}
35
+ h1,h2,h3,h4,h5,h6{break-inside:avoid;break-after:avoid}
36
+ p,li{orphans:2;widows:2}
37
+ }
38
+ </style>`;
39
+
28
40
  /** Stylesheet href for the @jsonresume/core design tokens (CSS custom props). */
29
41
  const TOKENS_CSS_HREF = 'https://unpkg.com/@jsonresume/core/dist/tokens.css';
30
42
 
@@ -147,6 +159,7 @@ export function renderResumeDocument(element, options = {}) {
147
159
  fontLinks +
148
160
  tokensLink +
149
161
  resetTag +
162
+ PRINT_DEFAULTS +
150
163
  head +
151
164
  styleTags +
152
165
  headAfterStyles +
@@ -98,13 +98,13 @@
98
98
  }
99
99
 
100
100
  @page {
101
- size: A4;
101
+ size: auto;
102
102
  margin: 0.5in;
103
103
  }
104
104
 
105
105
  /* Prevent awkward breaks */
106
106
  .resume-section {
107
- page-break-inside: avoid;
107
+ page-break-inside: auto;
108
108
  }
109
109
 
110
110
  .resume-item {