@thi.ng/meta-css 0.3.0 → 0.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/meta-css",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Data-driven CSS framework codegen, transpiler & bundler",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -38,26 +38,26 @@
38
38
  "test": "bun test"
39
39
  },
40
40
  "dependencies": {
41
- "@thi.ng/api": "^8.9.14",
42
- "@thi.ng/args": "^2.3.1",
43
- "@thi.ng/arrays": "^2.7.11",
44
- "@thi.ng/checks": "^3.4.14",
45
- "@thi.ng/compose": "^2.1.53",
46
- "@thi.ng/errors": "^2.4.8",
47
- "@thi.ng/file-io": "^1.1.2",
48
- "@thi.ng/hiccup-css": "^2.3.4",
49
- "@thi.ng/logger": "^2.1.1",
50
- "@thi.ng/rstream": "^8.2.17",
51
- "@thi.ng/strings": "^3.7.5",
52
- "@thi.ng/text-format": "^2.0.1",
53
- "@thi.ng/transducers": "^8.8.18"
41
+ "@thi.ng/api": "^8.9.15",
42
+ "@thi.ng/args": "^2.3.3",
43
+ "@thi.ng/arrays": "^2.7.12",
44
+ "@thi.ng/checks": "^3.4.15",
45
+ "@thi.ng/compose": "^2.1.54",
46
+ "@thi.ng/errors": "^2.4.9",
47
+ "@thi.ng/file-io": "^1.1.3",
48
+ "@thi.ng/hiccup-css": "^2.3.5",
49
+ "@thi.ng/logger": "^2.1.2",
50
+ "@thi.ng/rstream": "^8.2.18",
51
+ "@thi.ng/strings": "^3.7.6",
52
+ "@thi.ng/text-format": "^2.0.2",
53
+ "@thi.ng/transducers": "^8.8.19"
54
54
  },
55
55
  "devDependencies": {
56
- "@microsoft/api-extractor": "^7.38.3",
57
- "esbuild": "^0.19.8",
56
+ "@microsoft/api-extractor": "^7.39.0",
57
+ "esbuild": "^0.19.10",
58
58
  "rimraf": "^5.0.5",
59
59
  "typedoc": "^0.25.4",
60
- "typescript": "^5.3.2"
60
+ "typescript": "^5.3.3"
61
61
  },
62
62
  "keywords": [
63
63
  "browser",
@@ -105,5 +105,5 @@
105
105
  "status": "alpha",
106
106
  "year": 2023
107
107
  },
108
- "gitHead": "a30bdb0136223fe2e413a1d27a71d3bcff1dfd53\n"
108
+ "gitHead": "775c664723cd87d6ac5909cedf91195317add287\n"
109
109
  }
@@ -0,0 +1,32 @@
1
+ {
2
+ "specs": [
3
+ {
4
+ "user": "accessibility",
5
+ "name": "screen-reader",
6
+ "props": {
7
+ "position": "absolute",
8
+ "padding": 0,
9
+ "width": "1px",
10
+ "height": "1px",
11
+ "margin": "-1px",
12
+ "border": 0,
13
+ "overflow": "hidden",
14
+ "clip": "rect(0 0 0 0)"
15
+ },
16
+ "values": [""]
17
+ },
18
+ {
19
+ "user": "accessibility",
20
+ "name": "screen-reader-focus",
21
+ "props": {
22
+ "position": "static",
23
+ "width": "auto",
24
+ "height": "auto",
25
+ "margin": 0,
26
+ "overflow": "visible",
27
+ "clip": "auto"
28
+ },
29
+ "values": [""]
30
+ }
31
+ ]
32
+ }
package/specs/anim.json CHANGED
@@ -1,12 +1,21 @@
1
1
  {
2
+ "decls": [["@keyframes", "fadein", { "opacity": 0 }, { "opacity": 1 }]],
2
3
  "specs": [
4
+ {
5
+ "user": "animations / transitions",
6
+ "name": "fadein<k>",
7
+ "key": "i1",
8
+ "props": { "animation": "fadein <v> ease-in-out forwards" },
9
+ "values": [0.25, 0.5, 1],
10
+ "unit": "second"
11
+ },
3
12
  {
4
13
  "user": "animations / transitions",
5
14
  "name": "bg-anim<k>",
6
15
  "key": "i1",
7
- "props": { "transition": "<v>s background-color ease-in-out" },
16
+ "props": { "transition": "<v> background-color ease-in-out" },
8
17
  "values": [0.15, 0.25, 0.5],
9
- "unit": null
18
+ "unit": "second"
10
19
  }
11
20
  ]
12
21
  }
@@ -0,0 +1,38 @@
1
+ {
2
+ "specs": [
3
+ {
4
+ "user": "aspect ratios",
5
+ "name": "aspect-ratio-<k>",
6
+ "props": {
7
+ "height": 0,
8
+ "position": "relative",
9
+ "padding-bottom": "<v>"
10
+ },
11
+ "values": {
12
+ "16x9": 56.25,
13
+ "9x16": 177.7777,
14
+ "4x3": 75,
15
+ "3x4": 133.3333,
16
+ "6x4": 66.6666,
17
+ "4x6": 150,
18
+ "1x1": 100
19
+ },
20
+ "unit": "%"
21
+ },
22
+ {
23
+ "user": "aspect ratios",
24
+ "name": "aspect-ratio-object",
25
+ "props": {
26
+ "position": "absolute",
27
+ "top": 0,
28
+ "bottom": 0,
29
+ "left": 0,
30
+ "right": 0,
31
+ "width": "100%",
32
+ "height": "100%",
33
+ "z-index": 100
34
+ },
35
+ "values": [""]
36
+ }
37
+ ]
38
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "specs": [
3
+ {
4
+ "user": "background",
5
+ "name": "bg-<v>",
6
+ "props": "background-size",
7
+ "values": ["cover", "contain"]
8
+ },
9
+ {
10
+ "user": "background",
11
+ "name": "bg-pos-<k>",
12
+ "props": "background-position",
13
+ "values": {
14
+ "n": "top",
15
+ "ne": "top right",
16
+ "e": "right",
17
+ "se": "bottom right",
18
+ "s": "bottom",
19
+ "sw": "bottom left",
20
+ "w": "left",
21
+ "nw": "top left",
22
+ "center": "center"
23
+ }
24
+ }
25
+ ]
26
+ }
@@ -33,6 +33,12 @@
33
33
  "unit": "rem",
34
34
  "var": ["t", "b"]
35
35
  },
36
+ {
37
+ "user": "border radius",
38
+ "name": "br-<k>",
39
+ "props": "border-radius",
40
+ "values": { "100": "100%", "pill": "9999px" }
41
+ },
36
42
  {
37
43
  "user": "border width",
38
44
  "name": "bw<vid><k>",
@@ -43,6 +49,17 @@
43
49
  "values": "borders-w",
44
50
  "unit": "rem",
45
51
  "var": ["", "t", "r", "b", "l"]
52
+ },
53
+ {
54
+ "user": "border width",
55
+ "name": "bw<vid>-<v>px",
56
+ "props": {
57
+ "border<var>-style": "solid",
58
+ "border<var>-width": "<v>"
59
+ },
60
+ "values": [1],
61
+ "unit": "px",
62
+ "var": ["", "t", "r", "b", "l"]
46
63
  }
47
64
  ]
48
65
  }
@@ -2,54 +2,72 @@
2
2
  "tables": {
3
3
  "sizes-abs": [1, 2, 4, 8, 16],
4
4
  "sizes-rel": [
5
- 10, 20, 25, 30, 33, 34, 40, 50, 60, 66, 70, 75, 80, 90, 100
5
+ 10, 16, 17, 20, 25, 30, 33, 34, 40, 50, 60, 66, 67, 70, 75, 80, 83,
6
+ 84, 90, 100
6
7
  ]
7
8
  },
9
+ "vars": {
10
+ "w": ["width"],
11
+ "h": ["height"]
12
+ },
8
13
  "specs": [
9
14
  {
10
- "user": "width",
11
- "name": "w<k>",
15
+ "user": "<var>",
16
+ "name": "<vid><k>",
12
17
  "key": "i1",
13
- "props": "width",
18
+ "props": "<var>",
14
19
  "values": "sizes-abs",
15
- "unit": "rem"
20
+ "unit": "rem",
21
+ "var": ["w", "h"]
16
22
  },
17
23
  {
18
- "user": "width",
19
- "name": "w-<v>",
20
- "props": "width",
24
+ "user": "<var>",
25
+ "name": "<vid>-<v>",
26
+ "props": "<var>",
21
27
  "values": "sizes-rel",
22
- "unit": "%"
28
+ "unit": "%",
29
+ "var": ["w", "h"]
23
30
  },
24
31
  {
25
- "user": "max. width",
26
- "name": "mw<k>",
32
+ "user": "min. <var>",
33
+ "name": "min<vid><k>",
27
34
  "key": "i1",
28
- "props": "max-width",
35
+ "props": "min-<var>",
29
36
  "values": "sizes-abs",
30
- "unit": "rem"
37
+ "unit": "rem",
38
+ "var": ["w", "h"]
31
39
  },
32
40
  {
33
- "user": "max. width",
34
- "name": "mw-<v>",
35
- "props": "max-width",
41
+ "user": "min. <var>",
42
+ "name": "min<vid>-<v>",
43
+ "props": "min-<var>",
36
44
  "values": "sizes-rel",
37
- "unit": "%"
45
+ "unit": "%",
46
+ "var": ["w", "h"]
38
47
  },
39
48
  {
40
- "user": "height",
41
- "name": "h<k>",
49
+ "user": "max. <var>",
50
+ "name": "max<vid><k>",
42
51
  "key": "i1",
43
- "props": "height",
52
+ "props": "max-<var>",
44
53
  "values": "sizes-abs",
45
- "unit": "rem"
54
+ "unit": "rem",
55
+ "var": ["w", "h"]
46
56
  },
47
57
  {
48
- "user": "height",
49
- "name": "h-<v>",
50
- "props": "height",
58
+ "user": "max. <var>",
59
+ "name": "max<vid>-<v>",
60
+ "props": "max-<var>",
51
61
  "values": "sizes-rel",
52
- "unit": "%"
62
+ "unit": "%",
63
+ "var": ["w", "h"]
64
+ },
65
+ {
66
+ "name": "v<vid>-<v>",
67
+ "props": "<var>",
68
+ "values": [25, 50, 75, 100],
69
+ "unit": "v<vid>",
70
+ "var": ["w", "h"]
53
71
  }
54
72
  ]
55
73
  }
@@ -17,6 +17,12 @@
17
17
  "tc": "table-cell",
18
18
  "tr": "table-row"
19
19
  }
20
+ },
21
+ {
22
+ "user": "visibility",
23
+ "name": "<v>",
24
+ "props": { "visibility": "<v> !important" },
25
+ "values": ["hidden", "visible"]
20
26
  }
21
27
  ]
22
28
  }
@@ -0,0 +1,60 @@
1
+ {
2
+ "tables": {
3
+ "align": ["start", "end", "center", "stretch"]
4
+ },
5
+ "vars": {
6
+ "align": ["align"],
7
+ "justify": ["justify"],
8
+ "cols": ["columns"],
9
+ "rows": ["rows"]
10
+ },
11
+ "specs": [
12
+ {
13
+ "user": "grid layout",
14
+ "name": "grid-<vid>-<k>",
15
+ "key": "i1",
16
+ "props": "grid-template-<var>",
17
+ "values": [
18
+ "1fr",
19
+ "1fr 1fr",
20
+ "1fr 1fr 1fr",
21
+ "repeat(4,1fr)",
22
+ "repeat(5,1fr)",
23
+ "repeat(6,1fr)",
24
+ "repeat(7,1fr)",
25
+ "repeat(8,1fr)",
26
+ "repeat(9,1fr)",
27
+ "repeat(10,1fr)"
28
+ ],
29
+ "var": ["cols", "rows"]
30
+ },
31
+ {
32
+ "user": "grid layout",
33
+ "name": "gap<k>",
34
+ "props": "gap",
35
+ "values": [0, 0.125, 0.25, 0.5, 1, 2],
36
+ "unit": "rem"
37
+ },
38
+ {
39
+ "user": "grid layout",
40
+ "name": "gap-<v>px",
41
+ "props": "gap",
42
+ "values": [1, 2, 4, 8],
43
+ "unit": "px"
44
+ },
45
+ {
46
+ "user": "grid layout",
47
+ "name": "<var>-self-<v>",
48
+ "props": "<var>-self",
49
+ "values": "align",
50
+ "var": ["align", "justify"]
51
+ },
52
+ {
53
+ "user": "grid layout",
54
+ "name": "<var>-items-<v>",
55
+ "props": "<var>-items",
56
+ "values": "align",
57
+ "var": ["align", "justify"]
58
+ }
59
+ ]
60
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "specs": [
3
+ {
4
+ "user": "icons",
5
+ "name": "icon-<k>",
6
+ "key": "i1",
7
+ "props": {
8
+ "display": "inline-block",
9
+ "width": "<v>",
10
+ "height": "<v>"
11
+ },
12
+ "values": [3, 2.25, 1.5, 1.25, 1, 0.875, 0.75],
13
+ "unit": "rem"
14
+ },
15
+ {
16
+ "user": "icons",
17
+ "name": "icon-<k>",
18
+ "props": {
19
+ "display": "inline-block",
20
+ "width": "<v>",
21
+ "height": "<v>"
22
+ },
23
+ "values": {
24
+ "title": 6,
25
+ "subtitle": 5
26
+ },
27
+ "unit": "rem"
28
+ }
29
+ ]
30
+ }
@@ -0,0 +1,158 @@
1
+ {
2
+ "decls": [
3
+ ["@comment", "----- start: CSS normalization -----"],
4
+ [":root", { "font-size": "16px" }],
5
+ ["html", { "line-height": 1.15, "-webkit-text-size-adjust": "100%" }],
6
+ ["body", { "margin": 0 }],
7
+ ["h1", { "font-size": "2em", "margin": "0.67em 0" }],
8
+ [
9
+ "hr",
10
+ {
11
+ "-webkit-box-sizing": "content-box",
12
+ "box-sizing": "content-box",
13
+ "height": 0,
14
+ "overflow": "visible"
15
+ }
16
+ ],
17
+ ["a", { "background-color": "transparent" }],
18
+ [
19
+ "abbr[title]",
20
+ {
21
+ "border-bottom": "none",
22
+ "text-decoration": "underline dotted"
23
+ }
24
+ ],
25
+ ["b", "strong", { "font-weight": "bolder" }],
26
+ [
27
+ "code",
28
+ "kbd",
29
+ "samp",
30
+ { "font-family": "monospace", "font-size": "1em" }
31
+ ],
32
+ ["small", { "font-size": "80%" }],
33
+ [
34
+ "sub",
35
+ "sup",
36
+ {
37
+ "font-size": "75%",
38
+ "line-height": 0,
39
+ "position": "relative",
40
+ "vertical-align": "baseline"
41
+ }
42
+ ],
43
+ ["sub", { "bottom": "-0.25em" }],
44
+ ["sup", { "top": "-0.5em" }],
45
+ ["img", { "border-style": "none" }],
46
+ [
47
+ "button",
48
+ "input",
49
+ "optgroup",
50
+ "select",
51
+ "textarea",
52
+ {
53
+ "font-family": "inherit",
54
+ "font-size": "100%",
55
+ "line-height": 1.15,
56
+ "margin": 0
57
+ }
58
+ ],
59
+ ["button", "input", { "overflow": "visible" }],
60
+ ["button", "select", { "text-transform": "none" }],
61
+ [
62
+ "button",
63
+ "[type=\"button\"]",
64
+ "[type=\"reset\"]",
65
+ "[type=\"submit\"]",
66
+ { "-webkit-appearance": "button" },
67
+ ["::-moz-focus-inner", { "border-style": "none", "padding": 0 }],
68
+ [":-moz-focusring", { "outline": "1px dotted ButtonText" }]
69
+ ],
70
+ ["fieldset", { "padding": "0.35em 0.75em 0.625em" }],
71
+ [
72
+ "legend",
73
+ {
74
+ "display": "table",
75
+ "max-width": "100%",
76
+ "padding": 0,
77
+ "white-space": "normal"
78
+ }
79
+ ],
80
+ ["progress", { "vertical-align": "baseline" }],
81
+ ["textarea", { "overflow": "auto" }],
82
+ ["[type=\"checkbox\"]", "[type=\"radio\"]", { "padding": 0 }],
83
+ [
84
+ "[type=\"number\"]",
85
+ [
86
+ "::-webkit-inner-spin-button",
87
+ "::-webkit-outer-spin-button",
88
+ { "height": "auto" }
89
+ ]
90
+ ],
91
+ [
92
+ "[type=\"search\"]",
93
+ {
94
+ "-webkit-appearance": "textfield",
95
+ "outline-offset": "-2px"
96
+ },
97
+ ["::-webkit-search-decoration", { "-webkit-appearance": "none" }]
98
+ ],
99
+ [
100
+ "::-webkit-file-upload-button",
101
+ {
102
+ "-webkit-appearance": "button",
103
+ "font": "inherit"
104
+ }
105
+ ],
106
+ ["details", { "display": "block" }],
107
+ ["summary", { "display": "list-item" }],
108
+ ["[hidden]", "template", { "display": "none" }],
109
+ [
110
+ "html",
111
+ "legend",
112
+ "input",
113
+ "textarea",
114
+ "[type=\"checkbox\"]",
115
+ "[type=\"date\"]",
116
+ "[type=\"datetime-local\"]",
117
+ "[type=\"file\"]",
118
+ "[type=\"radio\"]",
119
+ "[type=\"search\"]",
120
+ { "box-sizing": "border-box", "-webkit-box-sizing": "border-box" }
121
+ ],
122
+ ["*", ":before", ":after", { "box-sizing": "inherit" }],
123
+ ["html", "body", { "min-height": "100%" }],
124
+ ["img", { "max-width": "100%", "height": "auto" }],
125
+ [
126
+ "blockquote",
127
+ "caption",
128
+ "cite",
129
+ "dd",
130
+ "dl",
131
+ "dt",
132
+ "fieldset",
133
+ "figcaption",
134
+ "h1",
135
+ "h2",
136
+ "h3",
137
+ "h4",
138
+ "h5",
139
+ "h6",
140
+ "hr",
141
+ "input",
142
+ "label",
143
+ "legend",
144
+ "ol",
145
+ "ol li",
146
+ "p",
147
+ "progress",
148
+ "table",
149
+ "textarea",
150
+ "ul",
151
+ "ul li",
152
+ [":first-child", { "margin-top": 0 }],
153
+ [":last-child", { "margin-bottom": 0 }]
154
+ ],
155
+ ["@comment", "----- end: CSS normalization -----"]
156
+ ],
157
+ "specs": []
158
+ }
@@ -7,7 +7,7 @@
7
7
  "user": "positions",
8
8
  "name": "<v>",
9
9
  "props": "position",
10
- "values": ["absolute", "relative", "fixed", "sticky"]
10
+ "values": ["absolute", "relative", "fixed", "static", "sticky"]
11
11
  },
12
12
  {
13
13
  "user": "positions",
@@ -0,0 +1,15 @@
1
+ {
2
+ "specs": [
3
+ {
4
+ "user": "selection",
5
+ "name": "noselect",
6
+ "props": {
7
+ "-webkit-user-select": "<v>",
8
+ "-moz-user-selec": "<v>",
9
+ "-ms-user-select": "<v>",
10
+ "user-select": "<v>"
11
+ },
12
+ "values": ["none"]
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "tables": {
3
+ "shadows": [
4
+ "0 0 2px 0px #0003",
5
+ "0 0 4px #0003",
6
+ "0 0 4px 1px #0003",
7
+ "0 0 8px 2px #0003"
8
+ ]
9
+ },
10
+ "specs": [
11
+ {
12
+ "user": "shadow",
13
+ "name": "box-shadow-<k>",
14
+ "key": "i1",
15
+ "props": "box-shadow",
16
+ "values": "shadows"
17
+ },
18
+ {
19
+ "user": "shadow",
20
+ "name": "box-shadow-i-<k>",
21
+ "key": "i1",
22
+ "props": { "box-shadow": "<v> inset" },
23
+ "values": "shadows"
24
+ },
25
+ {
26
+ "user": "shadow",
27
+ "name": "text-shadow-<k>",
28
+ "key": "i1",
29
+ "props": "text-shadow",
30
+ "values": [
31
+ "1px 1px 2px #0003",
32
+ "1px 1px 4px #0003",
33
+ "1px 1px 8px #0003",
34
+ "2px 2px 2px #0003",
35
+ "2px 2px 4px #0003",
36
+ "2px 2px 8px #0003",
37
+ "3px 3px 2px #0003",
38
+ "3px 3px 4px #0003",
39
+ "3px 3px 8px #0003"
40
+ ]
41
+ }
42
+ ]
43
+ }