@resumekit/react 0.1.0 → 0.3.0
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/document.css +1 -0
- package/dist/export-bundle/bundle.css +1 -1
- package/dist/export-bundle/bundle.js +9 -9
- package/dist/fonts/README.md +29 -0
- package/dist/fonts/dmsans-400.woff2 +0 -0
- package/dist/fonts/dmsans-400i.woff2 +0 -0
- package/dist/fonts/dmsans-700.woff2 +0 -0
- package/dist/fonts/dmsans-700i.woff2 +0 -0
- package/dist/fonts/firasans-400.woff2 +0 -0
- package/dist/fonts/firasans-400i.woff2 +0 -0
- package/dist/fonts/firasans-700.woff2 +0 -0
- package/dist/fonts/firasans-700i.woff2 +0 -0
- package/dist/fonts/fonts.css +481 -0
- package/dist/fonts/inter-400.woff2 +0 -0
- package/dist/fonts/inter-400i.woff2 +0 -0
- package/dist/fonts/inter-700.woff2 +0 -0
- package/dist/fonts/inter-700i.woff2 +0 -0
- package/dist/fonts/librefranklin-400.woff2 +0 -0
- package/dist/fonts/librefranklin-400i.woff2 +0 -0
- package/dist/fonts/librefranklin-700.woff2 +0 -0
- package/dist/fonts/librefranklin-700i.woff2 +0 -0
- package/dist/fonts/licenses/dmsans-OFL.txt +93 -0
- package/dist/fonts/licenses/firasans-OFL.txt +93 -0
- package/dist/fonts/licenses/inter-OFL.txt +93 -0
- package/dist/fonts/licenses/librefranklin-OFL.txt +93 -0
- package/dist/fonts/licenses/lora-OFL.txt +93 -0
- package/dist/fonts/licenses/montserrat-OFL.txt +93 -0
- package/dist/fonts/licenses/notosans-OFL.txt +93 -0
- package/dist/fonts/licenses/nunitosans-OFL.txt +93 -0
- package/dist/fonts/licenses/opensans-OFL.txt +93 -0
- package/dist/fonts/licenses/playfair-OFL.txt +93 -0
- package/dist/fonts/licenses/plexsans-OFL.txt +93 -0
- package/dist/fonts/licenses/plexserif-OFL.txt +93 -0
- package/dist/fonts/licenses/sourceserif4-OFL.txt +93 -0
- package/dist/fonts/licenses/spectral-OFL.txt +93 -0
- package/dist/fonts/licenses/worksans-OFL.txt +93 -0
- package/dist/fonts/lora-400.woff2 +0 -0
- package/dist/fonts/lora-400i.woff2 +0 -0
- package/dist/fonts/lora-700.woff2 +0 -0
- package/dist/fonts/lora-700i.woff2 +0 -0
- package/dist/fonts/montserrat-400.woff2 +0 -0
- package/dist/fonts/montserrat-400i.woff2 +0 -0
- package/dist/fonts/montserrat-700.woff2 +0 -0
- package/dist/fonts/montserrat-700i.woff2 +0 -0
- package/dist/fonts/notosans-400.woff2 +0 -0
- package/dist/fonts/notosans-400i.woff2 +0 -0
- package/dist/fonts/notosans-700.woff2 +0 -0
- package/dist/fonts/notosans-700i.woff2 +0 -0
- package/dist/fonts/nunitosans-400.woff2 +0 -0
- package/dist/fonts/nunitosans-400i.woff2 +0 -0
- package/dist/fonts/nunitosans-700.woff2 +0 -0
- package/dist/fonts/nunitosans-700i.woff2 +0 -0
- package/dist/fonts/opensans-400.woff2 +0 -0
- package/dist/fonts/opensans-400i.woff2 +0 -0
- package/dist/fonts/opensans-700.woff2 +0 -0
- package/dist/fonts/opensans-700i.woff2 +0 -0
- package/dist/fonts/playfair-400.woff2 +0 -0
- package/dist/fonts/playfair-400i.woff2 +0 -0
- package/dist/fonts/playfair-700.woff2 +0 -0
- package/dist/fonts/playfair-700i.woff2 +0 -0
- package/dist/fonts/plexsans-400.woff2 +0 -0
- package/dist/fonts/plexsans-400i.woff2 +0 -0
- package/dist/fonts/plexsans-700.woff2 +0 -0
- package/dist/fonts/plexsans-700i.woff2 +0 -0
- package/dist/fonts/plexserif-400.woff2 +0 -0
- package/dist/fonts/plexserif-400i.woff2 +0 -0
- package/dist/fonts/plexserif-700.woff2 +0 -0
- package/dist/fonts/plexserif-700i.woff2 +0 -0
- package/dist/fonts/raleway-700i.woff2 +0 -0
- package/dist/fonts/roboto-700i.woff2 +0 -0
- package/dist/fonts/sourcesans3-700i.woff2 +0 -0
- package/dist/fonts/sourceserif4-400.woff2 +0 -0
- package/dist/fonts/sourceserif4-400i.woff2 +0 -0
- package/dist/fonts/sourceserif4-700.woff2 +0 -0
- package/dist/fonts/sourceserif4-700i.woff2 +0 -0
- package/dist/fonts/spectral-400.woff2 +0 -0
- package/dist/fonts/spectral-400i.woff2 +0 -0
- package/dist/fonts/spectral-700.woff2 +0 -0
- package/dist/fonts/spectral-700i.woff2 +0 -0
- package/dist/fonts/worksans-400.woff2 +0 -0
- package/dist/fonts/worksans-400i.woff2 +0 -0
- package/dist/fonts/worksans-700.woff2 +0 -0
- package/dist/fonts/worksans-700i.woff2 +0 -0
- package/dist/kit/documentStyle.d.ts +8 -0
- package/dist/kit/documentStyle.d.ts.map +1 -1
- package/dist/kit/documentStyle.js +49 -1
- package/dist/kit/typography.css +118 -0
- package/dist/nodes/formatting.d.ts +5 -1
- package/dist/nodes/formatting.d.ts.map +1 -1
- package/dist/nodes/formatting.js +4 -1
- package/dist/nodes/locked.d.ts.map +1 -1
- package/dist/nodes/locked.js +3 -0
- package/dist/static/static.mjs +294 -4
- package/dist/templates/academic/AcademicDocument.d.ts.map +1 -1
- package/dist/templates/academic/AcademicDocument.js +2 -2
- package/dist/templates/alta/AltaDocument.d.ts.map +1 -1
- package/dist/templates/alta/AltaDocument.js +2 -2
- package/dist/templates/classic/ClassicDocument.d.ts.map +1 -1
- package/dist/templates/classic/ClassicDocument.js +2 -2
- package/dist/templates/cobalt/CobaltDocument.d.ts.map +1 -1
- package/dist/templates/cobalt/CobaltDocument.js +2 -2
- package/dist/templates/compact/CompactDocument.d.ts.map +1 -1
- package/dist/templates/compact/CompactDocument.js +2 -2
- package/dist/templates/contemporary/ContemporaryDocument.d.ts.map +1 -1
- package/dist/templates/contemporary/ContemporaryDocument.js +2 -2
- package/dist/templates/creative/CreativeDocument.d.ts.map +1 -1
- package/dist/templates/creative/CreativeDocument.js +2 -2
- package/dist/templates/crimson/CrimsonDocument.d.ts.map +1 -1
- package/dist/templates/crimson/CrimsonDocument.js +2 -2
- package/dist/templates/curve/CurveDocument.d.ts.map +1 -1
- package/dist/templates/curve/CurveDocument.js +2 -2
- package/dist/templates/double-column/DoubleColumnDocument.d.ts.map +1 -1
- package/dist/templates/double-column/DoubleColumnDocument.js +2 -2
- package/dist/templates/double-column-logos/DoubleColumnLogosDocument.d.ts.map +1 -1
- package/dist/templates/double-column-logos/DoubleColumnLogosDocument.js +2 -2
- package/dist/templates/elegant/ElegantDocument.d.ts.map +1 -1
- package/dist/templates/elegant/ElegantDocument.js +2 -2
- package/dist/templates/elegant-logos/ElegantLogosDocument.d.ts.map +1 -1
- package/dist/templates/elegant-logos/ElegantLogosDocument.js +2 -2
- package/dist/templates/engineer/EngineerDocument.d.ts.map +1 -1
- package/dist/templates/engineer/EngineerDocument.js +2 -2
- package/dist/templates/executive/ExecutiveDocument.d.ts.map +1 -1
- package/dist/templates/executive/ExecutiveDocument.js +2 -2
- package/dist/templates/harvard/HarvardDocument.d.ts.map +1 -1
- package/dist/templates/harvard/HarvardDocument.js +2 -2
- package/dist/templates/hipster/HipsterDocument.d.ts.map +1 -1
- package/dist/templates/hipster/HipsterDocument.js +2 -2
- package/dist/templates/ivy/IvyDocument.d.ts.map +1 -1
- package/dist/templates/ivy/IvyDocument.js +2 -2
- package/dist/templates/meridian/MeridianDocument.d.ts.map +1 -1
- package/dist/templates/meridian/MeridianDocument.js +2 -2
- package/dist/templates/modern/ModernDocument.d.ts.map +1 -1
- package/dist/templates/modern/ModernDocument.js +2 -2
- package/dist/templates/polished/PolishedDocument.d.ts.map +1 -1
- package/dist/templates/polished/PolishedDocument.js +2 -2
- package/dist/templates/portrait/PortraitDocument.d.ts.map +1 -1
- package/dist/templates/portrait/PortraitDocument.js +2 -2
- package/dist/templates/prism/PrismDocument.d.ts.map +1 -1
- package/dist/templates/prism/PrismDocument.js +2 -2
- package/dist/templates/scholar/ScholarDocument.d.ts.map +1 -1
- package/dist/templates/scholar/ScholarDocument.js +2 -2
- package/dist/templates/split/SplitDocument.d.ts.map +1 -1
- package/dist/templates/split/SplitDocument.js +2 -2
- package/dist/templates/stylish/StylishDocument.d.ts.map +1 -1
- package/dist/templates/stylish/StylishDocument.js +2 -2
- package/dist/templates/timeline/TimelineDocument.d.ts.map +1 -1
- package/dist/templates/timeline/TimelineDocument.js +2 -2
- package/package.json +2 -2
- package/src/compiler/emit.ts +2 -2
- package/src/kit/documentStyle.ts +55 -0
- package/src/nodes/formatting.ts +13 -1
- package/src/nodes/locked.ts +3 -0
- package/src/templates/academic/AcademicDocument.tsx +5 -1
- package/src/templates/alta/AltaDocument.tsx +5 -1
- package/src/templates/classic/ClassicDocument.tsx +5 -1
- package/src/templates/cobalt/CobaltDocument.tsx +5 -1
- package/src/templates/compact/CompactDocument.tsx +5 -1
- package/src/templates/contemporary/ContemporaryDocument.tsx +5 -1
- package/src/templates/creative/CreativeDocument.tsx +5 -1
- package/src/templates/crimson/CrimsonDocument.tsx +5 -1
- package/src/templates/curve/CurveDocument.tsx +5 -1
- package/src/templates/double-column/DoubleColumnDocument.tsx +5 -1
- package/src/templates/double-column-logos/DoubleColumnLogosDocument.tsx +5 -1
- package/src/templates/elegant/ElegantDocument.tsx +5 -1
- package/src/templates/elegant-logos/ElegantLogosDocument.tsx +5 -1
- package/src/templates/engineer/EngineerDocument.tsx +5 -1
- package/src/templates/executive/ExecutiveDocument.tsx +5 -1
- package/src/templates/harvard/HarvardDocument.tsx +5 -1
- package/src/templates/hipster/HipsterDocument.tsx +5 -1
- package/src/templates/ivy/IvyDocument.tsx +5 -1
- package/src/templates/meridian/MeridianDocument.tsx +5 -1
- package/src/templates/modern/ModernDocument.tsx +5 -1
- package/src/templates/polished/PolishedDocument.tsx +5 -1
- package/src/templates/portrait/PortraitDocument.tsx +5 -1
- package/src/templates/prism/PrismDocument.tsx +5 -1
- package/src/templates/scholar/ScholarDocument.tsx +5 -1
- package/src/templates/split/SplitDocument.tsx +5 -1
- package/src/templates/stylish/StylishDocument.tsx +5 -1
- package/src/templates/timeline/TimelineDocument.tsx +5 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -9,4 +9,12 @@ import { type DocumentStyle } from '@resumekit/schema';
|
|
|
9
9
|
* requires a document that sets neither to render as the template defines it.
|
|
10
10
|
*/
|
|
11
11
|
export declare function documentStyle(prefix: string, style: DocumentStyle | undefined): CSSProperties;
|
|
12
|
+
/**
|
|
13
|
+
* Which typographic presets the document chose, as attributes on the template's
|
|
14
|
+
* root. Only a chosen preset is written: `typography.css` keys every rule on
|
|
15
|
+
* the attribute's presence, so a document that chose none is drawn by the
|
|
16
|
+
* template's stylesheet alone — the same guarantee `documentStyle` keeps for
|
|
17
|
+
* accent and density.
|
|
18
|
+
*/
|
|
19
|
+
export declare function documentStyleAttributes(style: DocumentStyle | undefined): Record<`data-rk-${string}`, string>;
|
|
12
20
|
//# sourceMappingURL=documentStyle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentStyle.d.ts","sourceRoot":"","sources":["../../src/kit/documentStyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"documentStyle.d.ts","sourceRoot":"","sources":["../../src/kit/documentStyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,aAAa,GAAG,SAAS,GAC/B,aAAa,CAwCf;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,aAAa,GAAG,SAAS,GAC/B,MAAM,CAAC,WAAW,MAAM,EAAE,EAAE,MAAM,CAAC,CAcrC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DENSITIES, DOCUMENT_FONTS, INK_COLORS, } from '@resumekit/schema';
|
|
1
|
+
import { DENSITIES, DOCUMENT_FONTS, HEADING_WEIGHTS, INK_COLORS, LETTER_SPACINGS, LINE_HEIGHTS, } from '@resumekit/schema';
|
|
2
2
|
/**
|
|
3
3
|
* The candidate's document style as custom properties on a template's root,
|
|
4
4
|
* named with the template's own prefix (`--h-font`, `--c-ink`, …) so its
|
|
@@ -20,5 +20,53 @@ export function documentStyle(prefix, style) {
|
|
|
20
20
|
...(style.density
|
|
21
21
|
? { [`--${prefix}-density`]: String(DENSITIES[style.density].factor) }
|
|
22
22
|
: {}),
|
|
23
|
+
/*
|
|
24
|
+
* The typographic presets, under one shared prefix rather than the
|
|
25
|
+
* template's: `typography.css` applies them the same way in every
|
|
26
|
+
* template, keyed on the `data-rk-*` attributes below, so a template's
|
|
27
|
+
* stylesheet never has to know they exist.
|
|
28
|
+
*/
|
|
29
|
+
...(style.tracking
|
|
30
|
+
? { '--rk-tracking': `${LETTER_SPACINGS[style.tracking].em}em` }
|
|
31
|
+
: {}),
|
|
32
|
+
...(style.leading
|
|
33
|
+
? { '--rk-leading': String(LINE_HEIGHTS[style.leading].value) }
|
|
34
|
+
: {}),
|
|
35
|
+
...(style.headingFont
|
|
36
|
+
? { '--rk-heading-font': DOCUMENT_FONTS[style.headingFont].stack }
|
|
37
|
+
: {}),
|
|
38
|
+
...(style.headingWeight
|
|
39
|
+
? {
|
|
40
|
+
'--rk-heading-weight': String(HEADING_WEIGHTS[style.headingWeight].weight),
|
|
41
|
+
}
|
|
42
|
+
: {}),
|
|
43
|
+
...(style.nameSize ? { '--rk-name-size': String(style.nameSize) } : {}),
|
|
44
|
+
...(style.headingSize
|
|
45
|
+
? { '--rk-heading-size': String(style.headingSize) }
|
|
46
|
+
: {}),
|
|
47
|
+
...(style.bodySize ? { '--rk-body-size': String(style.bodySize) } : {}),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Which typographic presets the document chose, as attributes on the template's
|
|
52
|
+
* root. Only a chosen preset is written: `typography.css` keys every rule on
|
|
53
|
+
* the attribute's presence, so a document that chose none is drawn by the
|
|
54
|
+
* template's stylesheet alone — the same guarantee `documentStyle` keeps for
|
|
55
|
+
* accent and density.
|
|
56
|
+
*/
|
|
57
|
+
export function documentStyleAttributes(style) {
|
|
58
|
+
if (!style)
|
|
59
|
+
return {};
|
|
60
|
+
return {
|
|
61
|
+
...(style.tracking && { 'data-rk-tracking': style.tracking }),
|
|
62
|
+
...(style.leading && { 'data-rk-leading': style.leading }),
|
|
63
|
+
...(style.headingFont && { 'data-rk-heading-font': style.headingFont }),
|
|
64
|
+
...(style.headingCase && { 'data-rk-heading-case': style.headingCase }),
|
|
65
|
+
...(style.headingWeight && {
|
|
66
|
+
'data-rk-heading-weight': style.headingWeight,
|
|
67
|
+
}),
|
|
68
|
+
...(style.nameSize && { 'data-rk-name-size': '' }),
|
|
69
|
+
...(style.headingSize && { 'data-rk-heading-size': '' }),
|
|
70
|
+
...(style.bodySize && { 'data-rk-body-size': '' }),
|
|
23
71
|
};
|
|
24
72
|
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The document's typographic presets (`DocumentStyle.tracking`, `leading`,
|
|
3
|
+
* `headingFont`, `headingCase`, `headingWeight`) and the per-line formats
|
|
4
|
+
* (`italic`, `underline`, `step`), applied the same way in every template.
|
|
5
|
+
*
|
|
6
|
+
* The role sizes (`nameSize`, `headingSize`, `bodySize`) are here too.
|
|
7
|
+
*
|
|
8
|
+
* Every document-level rule is keyed on a `data-rk-*` attribute that
|
|
9
|
+
* `documentStyleAttributes` writes on the template's root ONLY when the
|
|
10
|
+
* candidate chose that preset, so a document that chose none is drawn by its
|
|
11
|
+
* template's stylesheet alone. The attribute is doubled in each selector to
|
|
12
|
+
* outrank a template's own two-class rules: when the candidate has chosen,
|
|
13
|
+
* their choice is what the page shows.
|
|
14
|
+
*
|
|
15
|
+
* Headings are `h1`–`h2` in the editor and `[data-h]` in a picture (static and
|
|
16
|
+
* PDF), so both are named. The name is level 1; section headings are level 2.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/* ── Letter spacing: the text, not the headings ───────────────────────────── */
|
|
20
|
+
|
|
21
|
+
[data-rk-tracking][data-rk-tracking] .tpl-text {
|
|
22
|
+
letter-spacing: var(--rk-tracking);
|
|
23
|
+
}
|
|
24
|
+
[data-rk-tracking][data-rk-tracking] :is(h1, h2, [data-h]) .tpl-text {
|
|
25
|
+
letter-spacing: inherit;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* ── Line height: every block that holds text, and the text in it ─────────── */
|
|
29
|
+
|
|
30
|
+
[data-rk-leading][data-rk-leading]
|
|
31
|
+
:where(:has(> .tpl-text)):not(h1, h2, [data-h]),
|
|
32
|
+
[data-rk-leading][data-rk-leading] .tpl-text {
|
|
33
|
+
line-height: var(--rk-leading);
|
|
34
|
+
}
|
|
35
|
+
[data-rk-leading][data-rk-leading] :is(h1, h2, [data-h]) .tpl-text {
|
|
36
|
+
line-height: inherit;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* ── Headings: typeface for the name and sections; case and weight for sections */
|
|
40
|
+
|
|
41
|
+
[data-rk-heading-font][data-rk-heading-font]
|
|
42
|
+
:is(h1, h2, [data-h='1'], [data-h='2']) {
|
|
43
|
+
font-family: var(--rk-heading-font);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
[data-rk-heading-weight][data-rk-heading-weight] :is(h2, [data-h='2']) {
|
|
47
|
+
font-weight: var(--rk-heading-weight);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[data-rk-heading-case='normal'][data-rk-heading-case] :is(h2, [data-h='2']) {
|
|
51
|
+
text-transform: none;
|
|
52
|
+
font-variant-caps: normal;
|
|
53
|
+
letter-spacing: normal;
|
|
54
|
+
}
|
|
55
|
+
[data-rk-heading-case='upper'][data-rk-heading-case] :is(h2, [data-h='2']) {
|
|
56
|
+
text-transform: uppercase;
|
|
57
|
+
font-variant-caps: normal;
|
|
58
|
+
letter-spacing: 0.06em;
|
|
59
|
+
}
|
|
60
|
+
[data-rk-heading-case='smallcaps'][data-rk-heading-case] :is(h2, [data-h='2']) {
|
|
61
|
+
text-transform: none;
|
|
62
|
+
font-variant-caps: all-small-caps;
|
|
63
|
+
letter-spacing: 0.04em;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* ── One line: emphasis and a size step ─────────────────────────────────────── */
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
* Bold at zero specificity: most templates draw `.is-bold` themselves, and
|
|
70
|
+
* theirs wins. This is the floor for the ones that never did, where pressing
|
|
71
|
+
* Bold used to do nothing.
|
|
72
|
+
*/
|
|
73
|
+
:where(.tpl-text.is-bold) {
|
|
74
|
+
font-weight: bold;
|
|
75
|
+
}
|
|
76
|
+
.tpl-text.is-italic {
|
|
77
|
+
font-style: italic;
|
|
78
|
+
}
|
|
79
|
+
.tpl-text.is-underline {
|
|
80
|
+
text-decoration: underline;
|
|
81
|
+
text-underline-offset: 0.15em;
|
|
82
|
+
}
|
|
83
|
+
/*
|
|
84
|
+
* The step is a factor, so it composes with a role size below instead of being
|
|
85
|
+
* overwritten by it.
|
|
86
|
+
*/
|
|
87
|
+
.tpl-text.is-step-smaller {
|
|
88
|
+
--rk-step: 0.9;
|
|
89
|
+
font-size: 0.9em;
|
|
90
|
+
}
|
|
91
|
+
.tpl-text.is-step-larger {
|
|
92
|
+
--rk-step: 1.12;
|
|
93
|
+
font-size: 1.12em;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* ── Sizes by role: the name, the section headings, the body ──────────────────
|
|
97
|
+
*
|
|
98
|
+
* Each is a factor on the size the template already gives that role, applied
|
|
99
|
+
* to its fields in `em`, so the template's proportions inside a role hold and
|
|
100
|
+
* nothing outside the role moves. Later rules carry one more attribute, so a
|
|
101
|
+
* heading's size outranks the body's when both are chosen.
|
|
102
|
+
*/
|
|
103
|
+
[data-rk-body-size][data-rk-body-size] .tpl-text {
|
|
104
|
+
font-size: calc(var(--rk-body-size) * var(--rk-step, 1) * 1em);
|
|
105
|
+
}
|
|
106
|
+
[data-rk-body-size][data-rk-body-size] :is(h1, h2, [data-h]) .tpl-text {
|
|
107
|
+
font-size: calc(var(--rk-step, 1) * 1em);
|
|
108
|
+
}
|
|
109
|
+
[data-rk-heading-size][data-rk-heading-size][data-rk-heading-size]
|
|
110
|
+
:is(h2, [data-h='2'])
|
|
111
|
+
.tpl-text {
|
|
112
|
+
font-size: calc(var(--rk-heading-size) * var(--rk-step, 1) * 1em);
|
|
113
|
+
}
|
|
114
|
+
[data-rk-name-size][data-rk-name-size][data-rk-name-size]
|
|
115
|
+
:is(h1, [data-h='1'])
|
|
116
|
+
.tpl-text {
|
|
117
|
+
font-size: calc(var(--rk-name-size) * var(--rk-step, 1) * 1em);
|
|
118
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
|
-
import { type FieldAlign, type InkId } from '@resumekit/schema';
|
|
2
|
+
import { type FieldAlign, type FieldStepId, type InkId } from '@resumekit/schema';
|
|
3
3
|
/**
|
|
4
4
|
* The formatting a node may carry.
|
|
5
5
|
*
|
|
@@ -10,6 +10,10 @@ import { type FieldAlign, type InkId } from '@resumekit/schema';
|
|
|
10
10
|
*/
|
|
11
11
|
export interface FieldFormatting {
|
|
12
12
|
bold?: boolean;
|
|
13
|
+
italic?: boolean;
|
|
14
|
+
underline?: boolean;
|
|
15
|
+
/** One step smaller or larger than the template sets the line. */
|
|
16
|
+
step?: FieldStepId;
|
|
13
17
|
align?: FieldAlign;
|
|
14
18
|
ink?: InkId;
|
|
15
19
|
href?: LinkTarget;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src/nodes/formatting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src/nodes/formatting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,KAAK,EACX,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kEAAkE;IAClE,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,GAAG,CAAC,EAAE,KAAK,CAAC;IAQZ,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,4DAA4D;AAC5D,wBAAgB,WAAW,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAWzE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,aAAa,GAAG,SAAS,CAG5E;AAED,gFAAgF;AAChF,wBAAgB,OAAO,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAEnE"}
|
package/dist/nodes/formatting.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { INK_COLORS } from '@resumekit/schema';
|
|
1
|
+
import { INK_COLORS, } from '@resumekit/schema';
|
|
2
2
|
/** Class names the template stylesheet gives meaning to. */
|
|
3
3
|
export function formatClass(format, base) {
|
|
4
4
|
return [
|
|
5
5
|
base,
|
|
6
6
|
format.bold ? 'is-bold' : '',
|
|
7
|
+
format.italic ? 'is-italic' : '',
|
|
8
|
+
format.underline ? 'is-underline' : '',
|
|
9
|
+
format.step ? `is-step-${format.step}` : '',
|
|
7
10
|
format.align ? `is-${format.align}` : '',
|
|
8
11
|
]
|
|
9
12
|
.filter(Boolean)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locked.d.ts","sourceRoot":"","sources":["../../src/nodes/locked.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAejD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"locked.d.ts","sourceRoot":"","sources":["../../src/nodes/locked.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAejD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgB/D,CAAC"}
|