@thi.ng/hiccup-css 2.7.95 → 2.8.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/README.md +1 -1
- package/font-face.d.ts +21 -0
- package/font-face.js +32 -0
- package/impl.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +5 -2
- package/quoted-functions.d.ts +1 -0
- package/quoted-functions.js +2 -0
package/README.md
CHANGED
package/font-face.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CSSOpts } from "./api.js";
|
|
2
|
+
export interface FontFaceSpec {
|
|
3
|
+
family: string;
|
|
4
|
+
src: {
|
|
5
|
+
format: string;
|
|
6
|
+
url: string;
|
|
7
|
+
}[];
|
|
8
|
+
style: string;
|
|
9
|
+
weight: string;
|
|
10
|
+
stretch?: string;
|
|
11
|
+
display?: string;
|
|
12
|
+
unicode?: string[];
|
|
13
|
+
ascent?: string;
|
|
14
|
+
descent?: string;
|
|
15
|
+
feature?: string;
|
|
16
|
+
variation?: string;
|
|
17
|
+
lineGap?: string;
|
|
18
|
+
size?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const at_fontface: (spec: FontFaceSpec) => (acc: string[], opts: CSSOpts) => string[];
|
|
21
|
+
//# sourceMappingURL=font-face.d.ts.map
|
package/font-face.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { formatDecls, indent } from "./impl.js";
|
|
2
|
+
const at_fontface = (spec) => {
|
|
3
|
+
return (acc, opts) => {
|
|
4
|
+
const outer = indent(opts);
|
|
5
|
+
acc.push(
|
|
6
|
+
`${outer}@font-face${opts.format.declStart}${formatDecls(
|
|
7
|
+
{
|
|
8
|
+
"font-family": spec.family,
|
|
9
|
+
"font-style": spec.style,
|
|
10
|
+
"font-weight": spec.weight,
|
|
11
|
+
"font-stretch": spec.stretch,
|
|
12
|
+
"font-display": spec.display,
|
|
13
|
+
src: spec.src.map(
|
|
14
|
+
({ format, url }) => `url(${url}) format(${format})`
|
|
15
|
+
),
|
|
16
|
+
"unicode-range": spec.unicode,
|
|
17
|
+
"ascent-override": spec.ascent,
|
|
18
|
+
"descent-override": spec.ascent,
|
|
19
|
+
"font-feature-settings": spec.feature,
|
|
20
|
+
"font-variation-settings": spec.variation,
|
|
21
|
+
"line-gap-override": spec.lineGap,
|
|
22
|
+
"size-adjust": spec.size
|
|
23
|
+
},
|
|
24
|
+
opts
|
|
25
|
+
)}${outer}${opts.format.declEnd}`
|
|
26
|
+
);
|
|
27
|
+
return acc;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
at_fontface
|
|
32
|
+
};
|
package/impl.js
CHANGED
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/hiccup-css",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "CSS from nested JS data structures",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -96,6 +96,9 @@
|
|
|
96
96
|
"./css": {
|
|
97
97
|
"default": "./css.js"
|
|
98
98
|
},
|
|
99
|
+
"./font-face": {
|
|
100
|
+
"default": "./font-face.js"
|
|
101
|
+
},
|
|
99
102
|
"./import": {
|
|
100
103
|
"default": "./import.js"
|
|
101
104
|
},
|
|
@@ -130,5 +133,5 @@
|
|
|
130
133
|
],
|
|
131
134
|
"year": 2016
|
|
132
135
|
},
|
|
133
|
-
"gitHead": "
|
|
136
|
+
"gitHead": "c87ef48d7000abc4e38ecf04ab8685f3901b2952"
|
|
134
137
|
}
|
package/quoted-functions.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { at_namespace } from "./namespace.js";
|
|
|
3
3
|
/** @internal */
|
|
4
4
|
export declare const QUOTED_FNS: {
|
|
5
5
|
"@comment": (body: string, force?: boolean) => import("./api.js").RuleFn;
|
|
6
|
+
"@font-face": (spec: import("./font-face.js").FontFaceSpec) => (acc: string[], opts: import("./api.js").CSSOpts) => string[];
|
|
6
7
|
"@import": (url: string, ...queries: string[]) => import("./api.js").RuleFn;
|
|
7
8
|
"@keyframes": typeof at_keyframes;
|
|
8
9
|
"@media": (cond: import("./api.js").Conditional, rules: any[]) => import("./api.js").RuleFn;
|
package/quoted-functions.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { comment } from "./comment.js";
|
|
2
|
+
import { at_fontface } from "./font-face.js";
|
|
2
3
|
import { at_import } from "./import.js";
|
|
3
4
|
import { at_keyframes } from "./keyframes.js";
|
|
4
5
|
import { at_media } from "./media.js";
|
|
@@ -6,6 +7,7 @@ import { at_namespace } from "./namespace.js";
|
|
|
6
7
|
import { at_supports } from "./supports.js";
|
|
7
8
|
const QUOTED_FNS = {
|
|
8
9
|
"@comment": comment,
|
|
10
|
+
"@font-face": at_fontface,
|
|
9
11
|
"@import": at_import,
|
|
10
12
|
"@keyframes": at_keyframes,
|
|
11
13
|
"@media": at_media,
|