-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcapsize.cjs
More file actions
34 lines (28 loc) · 703 Bytes
/
Copy pathcapsize.cjs
File metadata and controls
34 lines (28 loc) · 703 Bytes
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
const capsizeCssCore = require("@capsizecss/core");
const fontMetrics = require("@capsizecss/metrics/sourceCodePro");
const capsizeOptions = {
capHeight: 16,
leading: 16 * 1.25,
fontMetrics,
};
console.log(JSON.stringify(capsizeCssCore.precomputeValues(capsizeOptions)));
console.log(
capsizeCssCore.createStyleString("capsizedText", capsizeOptions),
);
/*
{"fontSize":"24.2424px","lineHeight":"20px","capHeightTrim":"-0.108em","baselineTrim":"-0.057em"}
.capsizedText {
font-size: 24.2424px;
line-height: 20px;
}
.capsizedText::before {
content: "";
margin-bottom: -0.108em;
display: table;
}
.capsizedText::after {
content: "";
margin-top: -0.057em;
display: table;
}
*/