@thi.ng/hiccup-css 2.7.94 → 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 +2 -2
- 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 +9 -6
- package/quoted-functions.d.ts +1 -0
- package/quoted-functions.js +2 -0
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
10
|
|
|
11
|
-
> This is one of
|
|
11
|
+
> This is one of 216 standalone projects. LLM-free, human-made and
|
|
12
12
|
> cared for software, maintained as part of the
|
|
13
13
|
> [@thi.ng/umbrella](https://codeberg.org/thi.ng/umbrella/) ecosystem and
|
|
14
14
|
> anti-framework.
|
|
@@ -125,7 +125,7 @@ Browser ESM import:
|
|
|
125
125
|
|
|
126
126
|
[JSDelivr documentation](https://www.jsdelivr.com/)
|
|
127
127
|
|
|
128
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 2.
|
|
128
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 2.42 KB
|
|
129
129
|
|
|
130
130
|
## Dependencies
|
|
131
131
|
|
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",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@thi.ng/api": "^8.12.
|
|
44
|
-
"@thi.ng/checks": "^3.
|
|
45
|
-
"@thi.ng/errors": "^2.6.
|
|
46
|
-
"@thi.ng/transducers": "^9.6.
|
|
43
|
+
"@thi.ng/api": "^8.12.26",
|
|
44
|
+
"@thi.ng/checks": "^3.10.0",
|
|
45
|
+
"@thi.ng/errors": "^2.6.15",
|
|
46
|
+
"@thi.ng/transducers": "^9.6.40"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"esbuild": "^0.28.0",
|
|
@@ -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,
|