@thi.ng/meta-css 0.3.0 → 0.4.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/CHANGELOG.md +9 -1
- package/README.md +110 -48
- package/index.js +6 -6
- package/package.json +3 -3
- package/specs/a11y.json +32 -0
- package/specs/aspect.json +38 -0
- package/specs/background.json +26 -0
- package/specs/borders.json +17 -0
- package/specs/dimensions.json +43 -25
- package/specs/display.json +6 -0
- package/specs/grids.json +60 -0
- package/specs/icons.json +30 -0
- package/specs/normalize.json +156 -0
- package/specs/positions.json +1 -1
- package/specs/selection.json +15 -0
- package/specs/shadows.json +43 -0
- package/specs/typography.json +15 -5
- package/specs/grid.json +0 -39
- package/specs/shadow.json +0 -26
- /package/specs/{overflow.json → overflows.json} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2023-12-
|
|
3
|
+
- **Last updated**: 2023-12-26T14:10:51Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,14 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
## [0.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.4.0) (2023-12-26)
|
|
13
|
+
|
|
14
|
+
#### 🚀 Features
|
|
15
|
+
|
|
16
|
+
- add support for file-local variation defs ([3a8e1a3](https://github.com/thi-ng/umbrella/commit/3a8e1a3))
|
|
17
|
+
- support parametric units in generator specs ([004a23d](https://github.com/thi-ng/umbrella/commit/004a23d))
|
|
18
|
+
- add support for hiccup-css declarations ([cd2ceca](https://github.com/thi-ng/umbrella/commit/cd2ceca))
|
|
19
|
+
|
|
12
20
|
## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.3.0) (2023-12-22)
|
|
13
21
|
|
|
14
22
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -45,14 +45,20 @@ This project is part of the
|
|
|
45
45
|
Data-driven CSS framework codegen, transpiler & bundler.
|
|
46
46
|
|
|
47
47
|
This toolchain and the overall workflow proposed by it is heavily building atop
|
|
48
|
-
the concept of _CSS utility classes_
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
the concept of _CSS utility classes_ (as known from Tachyons, Turret or the
|
|
49
|
+
newer Tailwind projects). How and where those CSS classes are applied is however
|
|
50
|
+
a defining point of difference to other existing approaches. Furthermore, using
|
|
51
|
+
JSON as data format for expressing generative rules and as intermediate format
|
|
52
|
+
for generated frameworks, removes the need for any complex CSS-related
|
|
53
|
+
dependencies and makes it trivial to build secondary tooling around (e.g. part
|
|
54
|
+
of this readme is an auto-generated report of the included base framework
|
|
55
|
+
specs).
|
|
56
|
+
|
|
57
|
+
This readme aims to provide a thorough overview of this toolchain and some
|
|
52
58
|
concrete usage examples...
|
|
53
59
|
|
|
54
60
|
Note: In all cases, final CSS generation itself is handled by
|
|
55
|
-
[thi.ng/hiccup-css](https://github.com/thi-ng/umbrella/blob/develop/packages/hiccup-css/)
|
|
61
|
+
[thi.ng/hiccup-css](https://github.com/thi-ng/umbrella/blob/develop/packages/hiccup-css/).
|
|
56
62
|
|
|
57
63
|
**👷🏻 This is all WIP!** Also see included & linked examples for basic usage...
|
|
58
64
|
|
|
@@ -108,15 +114,25 @@ split over multiple files within a directory and will all be merged by the
|
|
|
108
114
|
"name": "Framework name",
|
|
109
115
|
"version": "0.0.0",
|
|
110
116
|
},
|
|
111
|
-
// optional media queries and their criteria
|
|
117
|
+
// optional media queries and their criteria, will be merged from multiple spec files
|
|
112
118
|
"media": {
|
|
113
119
|
"large": { "min-width": "60rem" },
|
|
114
120
|
"dark": { "prefers-color-scheme": "dark" }
|
|
115
121
|
},
|
|
116
122
|
// optional shared values/LUTs (arrays or objects)
|
|
123
|
+
// tables are always local to the current spec file only...
|
|
117
124
|
"tables": {
|
|
118
125
|
"margins": [0, 0.25, 0.5, 1, 2, 4]
|
|
119
126
|
},
|
|
127
|
+
// optional shared variations
|
|
128
|
+
"vars": {
|
|
129
|
+
"size": ["width", "height"]
|
|
130
|
+
},
|
|
131
|
+
// optional thi.ng/hiccup-css declarations which will be part of the framework
|
|
132
|
+
// (e.g. for CSS reset purposes), will be merged from multiple spec files
|
|
133
|
+
"decls": [
|
|
134
|
+
["html", { "box-sizing": "border-box" }]
|
|
135
|
+
],
|
|
120
136
|
// array of actual generation specs
|
|
121
137
|
"specs": [
|
|
122
138
|
//...
|
|
@@ -427,6 +443,7 @@ Usage: metacss convert [opts] input [...]
|
|
|
427
443
|
|
|
428
444
|
Flags:
|
|
429
445
|
|
|
446
|
+
-d, --no-decls Don't emit framework decls
|
|
430
447
|
--no-header Don't emit generated header comment
|
|
431
448
|
-p, --pretty Pretty print output
|
|
432
449
|
-v, --verbose Display extra process information
|
|
@@ -434,8 +451,8 @@ Flags:
|
|
|
434
451
|
|
|
435
452
|
Main:
|
|
436
453
|
|
|
437
|
-
-e STR, --eval STR eval meta stylesheet in given string (ignores other
|
|
438
|
-
|
|
454
|
+
-e STR, --eval STR eval meta stylesheet in given string (ignores other
|
|
455
|
+
inputs & includes)
|
|
439
456
|
-f STR, --force STR [multiple] CSS classes to force include (wildcards are
|
|
440
457
|
supported, @-prefix will read from file)
|
|
441
458
|
-I STR, --include STR [multiple] Include CSS files (prepend)
|
|
@@ -699,6 +716,7 @@ Usage: metacss export [opts] input
|
|
|
699
716
|
|
|
700
717
|
Flags:
|
|
701
718
|
|
|
719
|
+
-d, --no-decls Don't emit framework decls
|
|
702
720
|
--no-header Don't emit generated header comment
|
|
703
721
|
-p, --pretty Pretty print output
|
|
704
722
|
-v, --verbose Display extra process information
|
|
@@ -706,7 +724,7 @@ Flags:
|
|
|
706
724
|
Main:
|
|
707
725
|
|
|
708
726
|
-I STR, --include STR [multiple] Include CSS files (prepend)
|
|
709
|
-
-m
|
|
727
|
+
-m ID, --media ID [multiple] Media query IDs (use 'ALL' for all)
|
|
710
728
|
-o STR, --out STR Output file (or stdout)
|
|
711
729
|
```
|
|
712
730
|
|
|
@@ -718,17 +736,29 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
718
736
|
|
|
719
737
|
### Classes by category
|
|
720
738
|
|
|
739
|
+
#### Accessibility <!-- notoc -->
|
|
740
|
+
|
|
741
|
+
`screen-reader` / `screen-reader-focus`
|
|
742
|
+
|
|
721
743
|
#### Animations / transitions <!-- notoc -->
|
|
722
744
|
|
|
723
745
|
`bg-anim1` / `bg-anim2` / `bg-anim3`
|
|
724
746
|
|
|
747
|
+
#### Aspect ratios <!-- notoc -->
|
|
748
|
+
|
|
749
|
+
`aspect-ratio-16x9` / `aspect-ratio-1x1` / `aspect-ratio-3x4` / `aspect-ratio-4x3` / `aspect-ratio-4x6` / `aspect-ratio-6x4` / `aspect-ratio-9x16` / `aspect-ratio-object`
|
|
750
|
+
|
|
751
|
+
#### Background <!-- notoc -->
|
|
752
|
+
|
|
753
|
+
`bg-contain` / `bg-cover` / `bg-pos-center` / `bg-pos-e` / `bg-pos-n` / `bg-pos-ne` / `bg-pos-nw` / `bg-pos-s` / `bg-pos-se` / `bg-pos-sw` / `bg-pos-w`
|
|
754
|
+
|
|
725
755
|
#### Border radius <!-- notoc -->
|
|
726
756
|
|
|
727
|
-
`br0` / `br1` / `br2` / `br3` / `br4` / `brb0` / `brb1` / `brb2` / `brb3` / `brb4` / `brl0` / `brl1` / `brl2` / `brl3` / `brl4` / `brr0` / `brr1` / `brr2` / `brr3` / `brr4` / `brt0` / `brt1` / `brt2` / `brt3` / `brt4`
|
|
757
|
+
`br-100` / `br-pill` / `br0` / `br1` / `br2` / `br3` / `br4` / `brb0` / `brb1` / `brb2` / `brb3` / `brb4` / `brl0` / `brl1` / `brl2` / `brl3` / `brl4` / `brr0` / `brr1` / `brr2` / `brr3` / `brr4` / `brt0` / `brt1` / `brt2` / `brt3` / `brt4`
|
|
728
758
|
|
|
729
759
|
#### Border width <!-- notoc -->
|
|
730
760
|
|
|
731
|
-
`bw0` / `bw1` / `bw2` / `bw3` / `bw4` / `bw5` / `bwb0` / `bwb1` / `bwb2` / `bwb3` / `bwb4` / `bwb5` / `bwl0` / `bwl1` / `bwl2` / `bwl3` / `bwl4` / `bwl5` / `bwr0` / `bwr1` / `bwr2` / `bwr3` / `bwr4` / `bwr5` / `bwt0` / `bwt1` / `bwt2` / `bwt3` / `bwt4` / `bwt5`
|
|
761
|
+
`bw-1px` / `bw0` / `bw1` / `bw2` / `bw3` / `bw4` / `bw5` / `bwb-1px` / `bwb0` / `bwb1` / `bwb2` / `bwb3` / `bwb4` / `bwb5` / `bwl-1px` / `bwl0` / `bwl1` / `bwl2` / `bwl3` / `bwl4` / `bwl5` / `bwr-1px` / `bwr0` / `bwr1` / `bwr2` / `bwr3` / `bwr4` / `bwr5` / `bwt-1px` / `bwt0` / `bwt1` / `bwt2` / `bwt3` / `bwt4` / `bwt5`
|
|
732
762
|
|
|
733
763
|
#### Colors <!-- notoc -->
|
|
734
764
|
|
|
@@ -738,69 +768,97 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
738
768
|
|
|
739
769
|
`cursor-alias` / `cursor-auto` / `cursor-cell` / `cursor-col` / `cursor-context` / `cursor-copy` / `cursor-cross` / `cursor-default` / `cursor-e` / `cursor-ew` / `cursor-forbidden` / `cursor-grab` / `cursor-grabbing` / `cursor-help` / `cursor-in` / `cursor-move` / `cursor-n` / `cursor-ne` / `cursor-news` / `cursor-no-drop` / `cursor-none` / `cursor-ns` / `cursor-nw` / `cursor-nwse` / `cursor-out` / `cursor-pointer` / `cursor-progress` / `cursor-row` / `cursor-s` / `cursor-scroll` / `cursor-se` / `cursor-sw` / `cursor-text` / `cursor-vtext` / `cursor-w` / `cursor-wait`
|
|
740
770
|
|
|
741
|
-
####
|
|
771
|
+
#### Display mode <!-- notoc -->
|
|
772
|
+
|
|
773
|
+
`db` / `df` / `dg` / `di` / `dib` / `dif` / `dig` / `dn` / `dt` / `dtc` / `dtr`
|
|
742
774
|
|
|
743
|
-
|
|
775
|
+
#### Font families <!-- notoc -->
|
|
744
776
|
|
|
745
|
-
|
|
777
|
+
`monospace` / `sans-serif` / `serif` / `system` / `system-sans-serif` / `system-serif`
|
|
746
778
|
|
|
747
|
-
|
|
779
|
+
#### Font sizes <!-- notoc -->
|
|
748
780
|
|
|
749
|
-
|
|
781
|
+
`f-subtitle` / `f-title` / `f1` / `f2` / `f3` / `f4` / `f5` / `f6` / `f7`
|
|
750
782
|
|
|
751
|
-
|
|
783
|
+
#### Font style <!-- notoc -->
|
|
752
784
|
|
|
753
|
-
|
|
785
|
+
`italic`
|
|
754
786
|
|
|
755
|
-
|
|
787
|
+
#### Font variants <!-- notoc -->
|
|
788
|
+
|
|
789
|
+
`small-caps`
|
|
790
|
+
|
|
791
|
+
#### Font weights <!-- notoc -->
|
|
792
|
+
|
|
793
|
+
`b` / `fw100` / `fw200` / `fw300` / `fw400` / `fw500` / `fw600` / `fw700` / `fw800` / `fw900` / `normal`
|
|
756
794
|
|
|
757
795
|
#### Grid layout <!-- notoc -->
|
|
758
796
|
|
|
759
|
-
`gap0` / `gap1` / `gap2` / `gap3` / `gap4` / `gap5` / `
|
|
797
|
+
`align-items-center` / `align-items-end` / `align-items-start` / `align-items-stretch` / `align-self-center` / `align-self-end` / `align-self-start` / `align-self-stretch` / `gap-1px` / `gap-2px` / `gap-4px` / `gap-8px` / `gap0` / `gap1` / `gap2` / `gap3` / `gap4` / `gap5` / `grid-cols-1` / `grid-cols-10` / `grid-cols-2` / `grid-cols-3` / `grid-cols-4` / `grid-cols-5` / `grid-cols-6` / `grid-cols-7` / `grid-cols-8` / `grid-cols-9` / `grid-rows-1` / `grid-rows-10` / `grid-rows-2` / `grid-rows-3` / `grid-rows-4` / `grid-rows-5` / `grid-rows-6` / `grid-rows-7` / `grid-rows-8` / `grid-rows-9` / `justify-items-center` / `justify-items-end` / `justify-items-start` / `justify-items-stretch` / `justify-self-center` / `justify-self-end` / `justify-self-start` / `justify-self-stretch`
|
|
760
798
|
|
|
761
|
-
####
|
|
799
|
+
#### Height <!-- notoc -->
|
|
762
800
|
|
|
763
|
-
`
|
|
801
|
+
`h-10` / `h-100` / `h-16` / `h-17` / `h-20` / `h-25` / `h-30` / `h-33` / `h-34` / `h-40` / `h-50` / `h-60` / `h-66` / `h-67` / `h-70` / `h-75` / `h-80` / `h-83` / `h-84` / `h-90` / `h1` / `h2` / `h3` / `h4` / `h5`
|
|
764
802
|
|
|
765
|
-
####
|
|
803
|
+
#### Icons <!-- notoc -->
|
|
766
804
|
|
|
767
|
-
`
|
|
805
|
+
`icon-1` / `icon-2` / `icon-3` / `icon-4` / `icon-5` / `icon-6` / `icon-7` / `icon-subtitle` / `icon-title`
|
|
806
|
+
|
|
807
|
+
#### Letter spacing <!-- notoc -->
|
|
808
|
+
|
|
809
|
+
`ls--1` / `ls--2` / `ls-0` / `ls-1` / `ls-2` / `ls-3`
|
|
810
|
+
|
|
811
|
+
#### Line heights <!-- notoc -->
|
|
812
|
+
|
|
813
|
+
`lh-0` / `lh-copy` / `lh-double` / `lh-solid` / `lh-title`
|
|
814
|
+
|
|
815
|
+
#### Lists <!-- notoc -->
|
|
816
|
+
|
|
817
|
+
`list`
|
|
768
818
|
|
|
769
819
|
#### Margin <!-- notoc -->
|
|
770
820
|
|
|
771
821
|
`center` / `ma0` / `ma1` / `ma2` / `ma3` / `ma4` / `mb0` / `mb1` / `mb2` / `mb3` / `mb4` / `mh0` / `mh1` / `mh2` / `mh3` / `mh4` / `ml0` / `ml1` / `ml2` / `ml3` / `ml4` / `mr0` / `mr1` / `mr2` / `mr3` / `mr4` / `mt0` / `mt1` / `mt2` / `mt3` / `mt4` / `mv0` / `mv1` / `mv2` / `mv3` / `mv4`
|
|
772
822
|
|
|
773
|
-
####
|
|
823
|
+
#### Max. height <!-- notoc -->
|
|
774
824
|
|
|
775
|
-
`
|
|
825
|
+
`maxh-10` / `maxh-100` / `maxh-16` / `maxh-17` / `maxh-20` / `maxh-25` / `maxh-30` / `maxh-33` / `maxh-34` / `maxh-40` / `maxh-50` / `maxh-60` / `maxh-66` / `maxh-67` / `maxh-70` / `maxh-75` / `maxh-80` / `maxh-83` / `maxh-84` / `maxh-90` / `maxh1` / `maxh2` / `maxh3` / `maxh4` / `maxh5`
|
|
776
826
|
|
|
777
|
-
####
|
|
827
|
+
#### Max. width <!-- notoc -->
|
|
778
828
|
|
|
779
|
-
`
|
|
829
|
+
`maxw-10` / `maxw-100` / `maxw-16` / `maxw-17` / `maxw-20` / `maxw-25` / `maxw-30` / `maxw-33` / `maxw-34` / `maxw-40` / `maxw-50` / `maxw-60` / `maxw-66` / `maxw-67` / `maxw-70` / `maxw-75` / `maxw-80` / `maxw-83` / `maxw-84` / `maxw-90` / `maxw1` / `maxw2` / `maxw3` / `maxw4` / `maxw5`
|
|
780
830
|
|
|
781
|
-
####
|
|
831
|
+
#### Min. height <!-- notoc -->
|
|
782
832
|
|
|
783
|
-
`
|
|
833
|
+
`minh-10` / `minh-100` / `minh-16` / `minh-17` / `minh-20` / `minh-25` / `minh-30` / `minh-33` / `minh-34` / `minh-40` / `minh-50` / `minh-60` / `minh-66` / `minh-67` / `minh-70` / `minh-75` / `minh-80` / `minh-83` / `minh-84` / `minh-90` / `minh1` / `minh2` / `minh3` / `minh4` / `minh5`
|
|
784
834
|
|
|
785
|
-
####
|
|
835
|
+
#### Min. width <!-- notoc -->
|
|
786
836
|
|
|
787
|
-
`
|
|
837
|
+
`minw-10` / `minw-100` / `minw-16` / `minw-17` / `minw-20` / `minw-25` / `minw-30` / `minw-33` / `minw-34` / `minw-40` / `minw-50` / `minw-60` / `minw-66` / `minw-67` / `minw-70` / `minw-75` / `minw-80` / `minw-83` / `minw-84` / `minw-90` / `minw1` / `minw2` / `minw3` / `minw4` / `minw5`
|
|
788
838
|
|
|
789
|
-
####
|
|
839
|
+
#### Overflow <!-- notoc -->
|
|
790
840
|
|
|
791
|
-
`
|
|
841
|
+
`overflow-auto` / `overflow-hidden` / `overflow-scroll` / `overflow-visible` / `overflow-x-auto` / `overflow-x-hidden` / `overflow-x-scroll` / `overflow-x-visible` / `overflow-y-auto` / `overflow-y-hidden` / `overflow-y-scroll` / `overflow-y-visible`
|
|
792
842
|
|
|
793
|
-
####
|
|
843
|
+
#### Padding <!-- notoc -->
|
|
794
844
|
|
|
795
|
-
`
|
|
845
|
+
`pa0` / `pa1` / `pa2` / `pa3` / `pa4` / `pb0` / `pb1` / `pb2` / `pb3` / `pb4` / `ph0` / `ph1` / `ph2` / `ph3` / `ph4` / `pl0` / `pl1` / `pl2` / `pl3` / `pl4` / `pr0` / `pr1` / `pr2` / `pr3` / `pr4` / `pt0` / `pt1` / `pt2` / `pt3` / `pt4` / `pv0` / `pv1` / `pv2` / `pv3` / `pv4`
|
|
796
846
|
|
|
797
|
-
####
|
|
847
|
+
#### Positions <!-- notoc -->
|
|
798
848
|
|
|
799
|
-
`
|
|
849
|
+
`absolute` / `bottom--1` / `bottom--2` / `bottom-0` / `bottom-1` / `bottom-2` / `fixed` / `left--1` / `left--2` / `left-0` / `left-1` / `left-2` / `relative` / `right--1` / `right--2` / `right-0` / `right-1` / `right-2` / `static` / `sticky` / `top--1` / `top--2` / `top-0` / `top-1` / `top-2`
|
|
800
850
|
|
|
801
|
-
####
|
|
851
|
+
#### Selection <!-- notoc -->
|
|
802
852
|
|
|
803
|
-
`
|
|
853
|
+
`noselect`
|
|
854
|
+
|
|
855
|
+
#### Shadow <!-- notoc -->
|
|
856
|
+
|
|
857
|
+
`box-shadow-1` / `box-shadow-2` / `box-shadow-3` / `box-shadow-4` / `box-shadow-i-1` / `box-shadow-i-2` / `box-shadow-i-3` / `box-shadow-i-4` / `text-shadow-1` / `text-shadow-2` / `text-shadow-3` / `text-shadow-4` / `text-shadow-5` / `text-shadow-6` / `text-shadow-7` / `text-shadow-8` / `text-shadow-9`
|
|
858
|
+
|
|
859
|
+
#### Text align <!-- notoc -->
|
|
860
|
+
|
|
861
|
+
`tc` / `tj` / `tl` / `tr`
|
|
804
862
|
|
|
805
863
|
#### Text decorations <!-- notoc -->
|
|
806
864
|
|
|
@@ -810,25 +868,29 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
810
868
|
|
|
811
869
|
`ttc` / `ttfsk` / `ttfw` / `tti` / `ttl` / `ttn` / `ttu`
|
|
812
870
|
|
|
813
|
-
####
|
|
871
|
+
#### Undefined <!-- notoc -->
|
|
814
872
|
|
|
815
|
-
`
|
|
873
|
+
`vh-100` / `vh-25` / `vh-50` / `vh-75` / `vw-100` / `vw-25` / `vw-50` / `vw-75`
|
|
816
874
|
|
|
817
875
|
#### Vertical align <!-- notoc -->
|
|
818
876
|
|
|
819
|
-
`v-btm` / `v-mid` / `v-top`
|
|
877
|
+
`v-base` / `v-btm` / `v-mid` / `v-top`
|
|
820
878
|
|
|
821
|
-
####
|
|
879
|
+
#### Visibility <!-- notoc -->
|
|
822
880
|
|
|
823
|
-
`
|
|
881
|
+
`hidden` / `visible`
|
|
824
882
|
|
|
825
883
|
#### Whitespace <!-- notoc -->
|
|
826
884
|
|
|
827
885
|
`ws-0` / `ws-1` / `ws-2`
|
|
828
886
|
|
|
829
|
-
####
|
|
887
|
+
#### Width <!-- notoc -->
|
|
830
888
|
|
|
831
|
-
`
|
|
889
|
+
`w-10` / `w-100` / `w-16` / `w-17` / `w-20` / `w-25` / `w-30` / `w-33` / `w-34` / `w-40` / `w-50` / `w-60` / `w-66` / `w-67` / `w-70` / `w-75` / `w-80` / `w-83` / `w-84` / `w-90` / `w1` / `w2` / `w3` / `w4` / `w5`
|
|
890
|
+
|
|
891
|
+
#### Z-indices <!-- notoc -->
|
|
892
|
+
|
|
893
|
+
`z-0` / `z-1` / `z-2` / `z-3` / `z-4` / `z-5` / `z-999` / `z-9999`
|
|
832
894
|
|
|
833
895
|
### Media queries
|
|
834
896
|
|
|
@@ -861,7 +923,7 @@ distributed as CLI bundle with **no runtime dependencies**. The following
|
|
|
861
923
|
dependencies are only shown for informational purposes and are (partially)
|
|
862
924
|
included in the bundle.
|
|
863
925
|
|
|
864
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 11.
|
|
926
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 11.38 KB
|
|
865
927
|
|
|
866
928
|
## Dependencies
|
|
867
929
|
|
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
`)}}var
|
|
4
|
-
`]:[],...Y(Q),""].join("\n")),...
|
|
5
|
-
`),v1(X,W);const Q=await X.ctx({logger:new m0(process.stderr,X.name,"INFO"),format:J?H0:N1,opts:B.result,inputs:B.rest},U);if(await U.fn(Q),X.post)await X.post(Q,U)}catch(Y){process.stderr.write(Y.message+"\n\n"),process.exit(1)}},v1=(X,Z)=>{process.stderr.write(J0(X.opts,Z)),process.exit(1)},XX=(X)=>["\nAvailable commands:\n",...Object.keys(X).map((Z)=>`${K0(16)(Z)}: ${X[Z].desc}`),"\n"].join("\n");import{existsSync as ZX,mkdirSync as JX,statSync as WX} from"fs";import{sep as YX} from"path";var b1=(X)=>{const Z=X.substring(0,X.lastIndexOf(YX));return Z.length>0&&!ZX(Z)?(JX(Z,{recursive:!0}),!0):!1},L1=(X)=>WX(X).isDirectory();var k=(X)=>typeof X==="function";var F=(X)=>typeof X==="string";import{readdirSync as UX,statSync as k5} from"fs";import{sep as VX} from"path";function*y1(X,Z="",J,W=Infinity,Y=0){if(Y>=W)return;const U=QX(Z);for(let V of UX(X).sort()){const B=X+VX+V;try{if(L1(B))yield*y1(B,Z,J,W,Y+1);else if(U(B))yield B}catch(Q){J&&J.warn(`ignoring file: ${V} (${Q.message})`)}}}var S1=(X,Z="",J=Infinity,W)=>y1(X,Z,W,J,0);var BX=(X)=>F(X)?new RegExp(`${X.replace(/\./g,"\\.")}\$`):X,QX=(X)=>k(X)?X:(X=BX(X),(Z)=>X.test(Z));import{readFileSync as qX} from"fs";import{writeFileSync as zX} from"fs";var h1=(X,Z,J,W,Y=!1)=>{if(W&&W.info(`${Y?"[dryrun] ":""}writing file: ${X}`),Y)return;b1(X),zX(X,Z,!J&&F(Z)?"utf-8":J)};var A=(X,Z,J="utf-8")=>{return Z&&Z.debug("reading file:",X),qX(X,J)},n0=(X,Z,J,W=!1)=>h1(X,P(Z)?Z.join("\n"):Z,"utf-8",J,W);var b=(X,Z)=>JSON.parse(A(X,Z));var M0=Object.freeze({level:C.NONE,enabled:()=>!1,fine(){},debug(){},info(){},warn(){},severe(){}});import{join as nX} from"path";var KX=I(()=>"Assertion failed"),F0=(typeof process!=="undefined"&&process.env!==void 0?!0:import.meta.env?import.meta.env.MODE!=="production"||!!import.meta.env.UMBRELLA_ASSERTS||!!import.meta.env.VITE_UMBRELLA_ASSERTS:!0)?(X,Z)=>{if(typeof X==="function"&&!X()||!X)throw new KX(typeof Z==="function"?Z():Z)}:()=>{};var P0=(X)=>X!=null&&typeof X!=="function"&&X.length!==void 0;var f1=(X)=>{return(X==null||!X[Symbol.iterator])&&H(`value is not iterable: ${X}`),X};var m1=(X)=>P0(X)?X:[...f1(X)];var Y0=(X)=>X[X.length-1];var $X=I(()=>"illegal arity"),i=(X)=>{throw new $X(X)};var HX=I(()=>"illegal state"),a=(X)=>{throw new HX(X)};var l0=function(...X){let[Z,J,W,Y,U,V,B,Q,q,z]=X;switch(X.length){case 0:i(0);case 1:return Z;case 2:return(...$)=>Z(J(...$));case 3:return(...$)=>Z(J(W(...$)));case 4:return(...$)=>Z(J(W(Y(...$))));case 5:return(...$)=>Z(J(W(Y(U(...$)))));case 6:return(...$)=>Z(J(W(Y(U(V(...$))))));case 7:return(...$)=>Z(J(W(Y(U(V(B(...$)))))));case 8:return(...$)=>Z(J(W(Y(U(V(B(Q(...$))))))));case 9:return(...$)=>Z(J(W(Y(U(V(B(Q(q(...$)))))))));case 10:default:const K=(...$)=>Z(J(W(Y(U(V(B(Q(q(z(...$))))))))));return X.length===10?K:l0(K,...X.slice(10))}};var u1=(X,Z)=>new Promise((J)=>setTimeout(()=>J(X),Z));var g1=(X)=>X;var x1=["-moz-","-ms-","-o-","-webkit-"],t={rules:"",ruleSep:",",valSep:"",decls:"",declStart:"{",declEnd:"}",indent:"",comments:!1},w0={rules:"\n",ruleSep:", ",valSep:" ",decls:"\n",declStart:" {\n",declEnd:"}\n",indent:" ",comments:!0};var G=(X)=>X!=null&&typeof X[Symbol.iterator]==="function";var N0=(X,Z)=>X!=null&&typeof X[Z]==="function";var u=(X)=>N0(X,"xform")?X.xform():X;var L=function(...X){return X=X.map(u),l0.apply(null,X)};var O0=(X)=>X!=null&&typeof X!=="string"&&typeof X[Symbol.iterator]==="function";var c=(X,Z)=>[X[0],X[1],Z];var S=Symbol(),p0=()=>{};class o0{value;constructor(X){this.value=X}deref(){return this.value}}var j=(X)=>X instanceof o0;var y=(X)=>X instanceof o0?X.deref():X;var D0=function(...X){const Z=X[0],J=Z[0],W=Z[1],Y=Z[2];X=CX(X);const U=X[0]==null?J():X[0],V=X[1];return y(W(N0(V,"$reduce")?V.$reduce(Y,U):P0(V)?MX(Y,U,V):FX(Y,U,V)))};var CX=(X)=>X.length===2?[void 0,X[1]]:X.length===3?[X[1],X[2]]:i(X.length),MX=(X,Z,J)=>{for(let W=0,Y=J.length;W<Y;W++)if(Z=X(Z,J[W]),j(Z)){Z=Z.deref();break}return Z},FX=(X,Z,J)=>{for(let W of J)if(Z=X(Z,W),j(Z)){Z=Z.deref();break}return Z},r=(X,Z)=>[X,(J)=>J,Z];var G0=function(X){return X?[...X]:r(()=>[],(Z,J)=>(Z.push(J),Z))};function*j0(X,Z){const J=u(X)(G0()),W=J[1],Y=J[2];for(let U of Z){const V=Y([],U);if(j(V)){yield*y(W(V.deref()));return}if(V.length)yield*V}yield*y(W([]))}function*g(X,Z){const J=u(X)([p0,p0,(W,Y)=>Y])[2];for(let W of Z){let Y=J(S,W);if(j(Y)){if(Y=y(Y.deref()),Y!==S)yield Y;return}if(Y!==S)yield Y}}var k0=(X,Z,J=g)=>{const W=Z.length-1;return G(Z[W])?Z.length>1?J(X.apply(null,Z.slice(0,W)),Z[W]):J(X(),Z[0]):void 0};var i0=function(X,Z){return G(Z)?j0(i0(X),F(Z)?[Z]:Z):(J)=>{const W=J[2],Y=(U,V)=>{const B=X(V);if(B){for(let Q of B)if(U=Y(U,Q),j(U))break;return U}return W(U,V)};return c(J,Y)}};var d1=function(X){return i0((Z)=>O0(Z)?Z:void 0,X)};var w=function(X,Z){return G(Z)?g(w(X),Z):(J)=>{const W=J[2];return c(J,(Y,U)=>W(Y,X(U)))}};function*T0(...X){const Z=X.length-1;if(Z<0)return;const J=new Array(Z+1).fill(0),W=X.map(m1),Y=W.reduce((U,V)=>U*V.length,1);for(let U=0;U<Y;U++){const V=[];for(let B=Z;B>=0;B--){const Q=W[B];let q=J[B];if(q===Q.length)J[B]=q=0,B>0&&J[B-1]++;V[B]=Q[q]}J[Z]++,yield V}}function*n1(X,Z=Infinity){while(Z-- >0)yield X}var a0=function(X,Z){X=X||"";let J=!0;return Z?[...Z].join(X):r(()=>"",(W,Y)=>(W=J?W+Y:W+X+Y,J=!1,W))};var I0=function(...X){return PX(I0,D0,X)};var PX=(X,Z,J)=>{let W,Y;switch(J.length){case 4:Y=J[3],W=J[2];break;case 3:Y=J[2];break;case 2:return w((U)=>X(J[0],J[1],U));default:i(J.length)}return Z(u(J[0])(J[1]),W,Y)};var wX=new Set,NX=":[",l1=L(d1(),w((X)=>NX.indexOf(X.charAt(0))>=0?X:" "+X)),OX=(X,Z)=>L(X,w((J)=>F(J)&&J.indexOf(" .")==0?J+Z:J)),s=(X,Z,J,W)=>{const Y=J.length,U=[];let V,B;const Q=(q,z)=>{let K=null;if(P(z))s(X,t0(Z,U),z,W);else if(G(z)&&!F(z))s(X,t0(Z,U),[...z],W);else if((B=k(z))||(K=W.fns[z]))if(!Z.length){if(K)return K.apply(null,J.slice(q+1))(X,W),!0;z(X,W)}else if(B)Q(q,z());else H(`quoted fn ('${z}') only allowed at head position`);else if(R(z))V=Object.assign(V||{},z);else if(z!=null)U.push(z)};for(let q=0;q<Y;q++)if(Q(q,J[q]))return X;return V&&X.push(DX(Z,U,V,W)),X},t0=(X,Z)=>X.length?[...T0(X,Z)]:Z,DX=(X,Z,J,W)=>{const Y=W.format,U=R0(W),V=W.scope?OX(l1,W.scope):l1;return[U,I0(w((B)=>I0(V,a0(),P(B)?B:[B]).trim()),a0(Y.ruleSep),t0(X,Z)),Y.declStart,c0(J,W),U,Y.declEnd].join("")},c0=(X,Z)=>{const J=Z.format,W=Z.autoprefix||wX,Y=R0(Z,Z.depth+1),U=[];for(let V in X)if(X.hasOwnProperty(V)){let B=X[V];if(k(B))B=B(X);if(P(B))B=B.map((Q)=>P(Q)?Q.join(" "):Q).join(J.ruleSep);if(W.has(V))for(let Q of Z.vendors)U.push(`${Y}${Q}${V}:${J.valSep}${B};`);U.push(`${Y}${V}:${J.valSep}${B};`)}return U.join(J.decls)+J.decls},R0=(X,Z=X.depth)=>Z>1?[...n1(X.format.indent,Z)].join(""):Z>0?X.format.indent:"";var o1=(X,Z,J)=>(W,Y)=>{const U=R0(Y);return W.push(`${U}${X} ${GX(Z)}${Y.format.declStart}`),Y.depth++,s(W,[],J,Y),Y.depth--,W.push(U+Y.format.declEnd),W},GX=(X)=>{if(F(X))return X;const Z=[];for(let J in X)if(X.hasOwnProperty(J)){let W=X[J];if(W===!0)W=p1.has(J)?J:`(${J})`;else if(W===!1)W=`(not ${p1.has(J)?J:`(${J})`})`;else if(W==="only")W+=" "+J;else W=`(${J}:${W})`;Z.push(W)}return Z.join(" and ")},p1=new Set(["all","print","screen"]);var U0=(X,Z)=>{return Z={format:t,vendors:x1,fns:{},depth:0,...Z},P(Z.autoprefix)&&(Z.autoprefix=new Set(Z.autoprefix)),R(X)?c0(X,Z):k(X)?X([],Z).join(Z.format.rules):s([],[],P(X)?X:O0(X)?[...X]:H("invalid rules"),Z).join(Z.format.rules)};var A0=(X,Z)=>o1("@media",X,Z);var i1=4,a1=(X)=>i1=X,D=(X)=>X===(X|0)?String(X):X.toFixed(i1).replace(/^0./,".").replace(/^-0./,"-.").replace(/0+$/,""),t1=(X)=>`${D(X)}em`,c1=(X)=>`${D(X)}ex`,r1=(X)=>`${D(X)}rem`,r0=(X)=>`${D(X)}%`,s1=(X)=>`${D(X)}px`,e1=(X)=>`${D(X)}vh`,X8=(X)=>`${D(X)}vw`,Z8=(X)=>`${D(X)}vmin`,J8=(X)=>`${D(X)}vmax`,W8=(X)=>`${X|0}ms`,Y8=(X)=>`${D(X)}s`;var U8=(X)=>`${D(X)}deg`,V8=(X)=>`${D(X)}rad`,B8=(X)=>`${D(X)}turn`,Q8=(X)=>`url(${X})`;var N=((X)=>{return X[X.IDLE=0]="IDLE",X[X.ACTIVE=1]="ACTIVE",X[X.DONE=2]="DONE",X[X.UNSUBSCRIBED=3]="UNSUBSCRIBED",X[X.ERROR=4]="ERROR",X})(N||{}),T=((X)=>{return X[X.NEVER=0]="NEVER",X[X.FIRST=1]="FIRST",X[X.LAST=2]="LAST",X})(T||{});var jX=0,kX=()=>jX++,x=(X,Z)=>!Z||!Z.id?{...Z,id:X+"-"+kX()}:Z;var O=M0;class h{constructor(X,Z){this.wrapped=X,Z=x("sub",{closeIn:T.LAST,closeOut:T.LAST,cache:!0,...Z}),this.parent=Z.parent,this.id=Z.id,this.closeIn=Z.closeIn,this.closeOut=Z.closeOut,this.cacheLast=Z.cache,Z.xform&&(this.xform=Z.xform(G0()))}id;closeIn;closeOut;parent;__owner;xform;cacheLast;last=S;state=N.IDLE;subs=[];deref(){return this.last!==S?this.last:void 0}getState(){return this.state}setState(X){this.state=X}subscribe(X,Z={}){this.ensureState();let J;if(X instanceof h&&!Z.xform)X.ensureState(),F0(!X.parent,`sub '${X.id}' already has a parent`),X.parent=this,J=X;else J=new h(X,{...Z,parent:this});return this.subs.push(J),this.setState(N.ACTIVE),J.setState(N.ACTIVE),this.last!=S&&J.next(this.last),J}transform(...X){let Z,J;if(R(Y0(X)))J=X.pop(),Z={error:J.error};return this.subscribe(Z,x("xform",X.length>0?{...J,xform:L(...X)}:J))}map(X,Z){return this.transform(w(X),Z||{})}unsubscribe(X){return X?this.unsubscribeChild(X):this.unsubscribeSelf()}unsubscribeSelf(){return O.debug(this.id,"unsub self"),this.parent&&this.parent.unsubscribe(this),this.state<N.UNSUBSCRIBED&&(this.state=N.UNSUBSCRIBED),this.release(),!0}unsubscribeChild(X){O.debug(this.id,"unsub child",X.id);const Z=this.subs.indexOf(X);if(Z>=0){if(this.subs.splice(Z,1),this.closeOut===T.FIRST||!this.subs.length&&this.closeOut!==T.NEVER)this.unsubscribe();return!0}return!1}next(X){if(this.state>=N.DONE)return;this.xform?this.dispatchXform(X):this.dispatch(X)}done(){if(O.debug(this.id,"entering done()"),this.state>=N.DONE)return;if(this.xform){if(!this.dispatchXformDone())return}if(this.state=N.DONE,this.dispatchTo("done"))this.state<N.UNSUBSCRIBED&&this.unsubscribe();O.debug(this.id,"exiting done()")}error(X){const Z=this.wrapped,J=Z&&Z.error;return J&&O.debug(this.id,"attempting wrapped error handler"),J&&Z.error(X)||this.unhandledError(X)}unhandledError(X){return(O!==M0?O:console).warn(this.id,"unhandled error:",X),this.unsubscribe(),this.state=N.ERROR,!1}dispatchTo(X,Z){let J=this.wrapped;if(J)try{J[X]&&J[X](Z)}catch(Y){if(!this.error(Y))return!1}const W=X==="next"?this.subs:[...this.subs];for(let Y=W.length;Y-- >0;){J=W[Y];try{J[X]&&J[X](Z)}catch(U){if(X==="error"||!J.error||!J.error(U))return this.unhandledError(U)}}return!0}dispatch(X){O.debug(this.id,"dispatch",X),this.cacheLast&&(this.last=X),this.dispatchTo("next",X)}dispatchXform(X){let Z;try{Z=this.xform[2]([],X)}catch(J){this.error(J);return}if(this.dispatchXformVals(Z))j(Z)&&this.done()}dispatchXformDone(){let X;try{X=this.xform[1]([])}catch(Z){return this.error(Z)}return this.dispatchXformVals(X)}dispatchXformVals(X){const Z=y(X);for(let J=0,W=Z.length;J<W&&this.state<N.DONE;J++)this.dispatch(Z[J]);return this.state<N.ERROR}ensureState(){if(this.state>=N.DONE)a(`operation not allowed in state ${this.state}`)}release(){this.subs.length=0,delete this.parent,delete this.xform,delete this.last}}var z8=(X,Z)=>{const J=new q8(Z);return J.next(X),J};class q8 extends h{src;_cancel;_inited;constructor(X,Z){const[J,W]=k(X)?[X,Z||{}]:[void 0,X||{}];super(W.error?{error:W.error}:void 0,x("stream",W));this.src=J,this._inited=!1}subscribe(X,Z={}){const J=super.subscribe(X,Z);if(!this._inited){if(this.src)try{this._cancel=this.src(this)||(()=>{return})}catch(W){let Y=this.wrapped;if(!Y||!Y.error||!Y.error(W))this.unhandledError(W)}this._inited=!0}return J}unsubscribe(X){const Z=super.unsubscribe(X);if(Z&&(!X||(!this.subs||!this.subs.length)&&this.closeOut!==T.NEVER))this.cancel();return Z}done(){this.cancel(),super.done(),delete this.src,delete this._cancel}error(X){if(super.error(X))return!0;return this.cancel(),!1}cancel(){if(this._cancel){O.debug(this.id,"cancel");const X=this._cancel;delete this._cancel,X()}}}var K8=(X,Z)=>X===T.FIRST||X===T.LAST&&!Z;var s0=function(X){return X?D0(s0(),X):r(()=>({}),(Z,[J,W])=>(Z[J]=W,Z))};var e0=function(X,Z){return G(Z)?g(e0(X),Z):w(k(X)?(J)=>[X(J),J]:(J)=>[X,J])};var X1=function(...X){const Z=k0(X1,X);if(Z)return Z;const J=X[0],W=X[1]!==!1;return w((Y)=>{const U=W?{}:Y;for(let V in Y)U[V]=J(Y[V]);return U})};var Z1=function(...X){const Z=k0(Z1,X,j0);if(Z)return Z;const{key:J,mergeOnly:W,reset:Y,all:U,backPressure:V}={key:g1,mergeOnly:!1,reset:!0,all:!0,backPressure:0,...X[1]},B=P(X[0])?new Set(X[0]):X[0],Q=new Set,q=new Map;let z={};const K=([$,v,_])=>{let f=!0;if(W||V<1)return[$,(M)=>{if(Y&&U&&Q.size>0||!Y&&f)M=_(M,z),z={},Q.clear(),f=!1;return v(M)},(M,Z0)=>{const E=J(Z0);if(B.has(E)){if(z[E]=Z0,Q.add(E),W||$8(B,Q))if(M=_(M,z),f=!1,Y)z={},Q.clear();else z={...z}}return M}];else return[$,(M)=>{if(U&&Q.size>0)M=_(M,H8(q,Q)),q.clear(),Q.clear();return v(M)},(M,Z0)=>{const E=J(Z0);if(B.has(E)){let Q0=q.get(E);!Q0&&q.set(E,Q0=[]),Q0.length>=V&&a(`max back pressure (${V}) exceeded for input: ${String(E)}`),Q0.push(Z0),Q.add(E);while($8(B,Q))if(M=_(M,H8(q,Q)),f=!1,j(M))break}return M}]};return K.keys=()=>B,K.clear=()=>{q.clear(),B.clear(),Q.clear(),z={}},K.add=($)=>{B.add($)},K.delete=($,v=!0)=>{if(q.delete($),B.delete($),v)Q.delete($),delete z[$]},K},$8=(X,Z)=>{if(Z.size<X.size)return!1;for(let J of X)if(!Z.has(J))return!1;return!0},H8=(X,Z)=>{const J={};for(let W of Z){const Y=X.get(W);J[W]=Y.shift(),!Y.length&&Z.delete(W)}return J};var C8=(X,Z)=>{let J=!0;for(let W of Z)J=X.removeID(W)&&J;return J};var M8=(X)=>new F8(X);class F8 extends h{sources;idSources;realSourceIDs;invRealSourceIDs;psync;clean;constructor(X){const Z=Z1(new Set,{key:(W)=>W[0],mergeOnly:X.mergeOnly===!0,reset:X.reset===!0,all:X.all!==!1,backPressure:X.backPressure||0}),J=X1((W)=>W[1]);super(void 0,x("streamsync",{...X,xform:X.xform?L(Z,J,X.xform):L(Z,J)}));this.sources=new Map,this.realSourceIDs=new Map,this.invRealSourceIDs=new Map,this.idSources=new Map,this.psync=Z,this.clean=!!X.clean,X.src&&this.addAll(X.src)}add(X,Z){Z||(Z=X.id),this.ensureState(),this.psync.add(Z),this.realSourceIDs.set(Z,X.id),this.invRealSourceIDs.set(X.id,Z),this.idSources.set(X.id,X),this.sources.set(X,X.subscribe({next:(J)=>J[1]instanceof h?this.add(J[1]):this.next(J),done:()=>this.markDone(X),__owner:this},{xform:e0(Z),id:`in-${Z}`}))}addAll(X){for(let Z in X)this.psync.add(Z);for(let Z in X)this.add(X[Z],Z)}remove(X){const Z=this.sources.get(X);if(Z){const J=this.invRealSourceIDs.get(X.id);return O.info(`removing src: ${X.id} (${J})`),this.psync.delete(J,this.clean),this.realSourceIDs.delete(J),this.invRealSourceIDs.delete(X.id),this.idSources.delete(X.id),this.sources.delete(X),Z.unsubscribe(),!0}return!1}removeID(X){const Z=this.getSourceForID(X);return Z?this.remove(Z):!1}removeAll(X){for(let J of X)this.psync.delete(this.invRealSourceIDs.get(J.id));let Z=!0;for(let J of X)Z=this.remove(J)&&Z;return Z}removeAllIDs(X){return C8(this,X)}getSourceForID(X){return this.idSources.get(this.realSourceIDs.get(X))}getSources(){const X={};for(let[Z,J]of this.idSources)X[this.invRealSourceIDs.get(Z)]=J;return X}unsubscribe(X){if(!X){O.debug(this.id,"unsub sources");for(let Z of this.sources.values())Z.unsubscribe();this.sources.clear(),this.psync.clear(),this.realSourceIDs.clear(),this.invRealSourceIDs.clear(),this.idSources.clear()}return super.unsubscribe(X)}markDone(X){this.remove(X),K8(this.closeIn,this.sources.size)&&this.done()}}var J1=d((X,Z=" ")=>{const J=n(String(Z),X);return(W,Y)=>{if(W==null)return J;return W=W.toString(),Y=Y!==void 0?Y:W.length,Y<X?J.substring(Y)+W:W}}),R2=J1(2,"0"),P8=J1(3,"0"),A2=J1(4,"0");var W1=function(X,Z){return G(Z)?g(W1(X),Z):(J)=>{const W=J[2];return c(J,(Y,U)=>X(U)?W(Y,U):Y)}};import{watch as IX} from"fs";import{resolve as B0} from"path";var w8={specs:p({alias:"s",optional:!1,desc:"Path to generated JSON defs"})},E0={include:o({alias:"I",desc:"Include CSS files (prepend)"})},e={pretty:l({alias:"p",desc:"Pretty print output"})},v0={noHeader:l({desc:"Don't emit generated header comment"})},N8={watch:l({alias:"w",desc:"Watch input files for changes"})};import{resolve as TX} from"path";var X0=(X,Z,J)=>{Z=F(Z)?Z:Z.join("\n"),X?n0(TX(X),Z,J):console.log(Z)},_0=({info:{name:X,version:Z}})=>`/*! ${X} v${Z} - generated by thi.ng/meta-css @ ${(new Date()).toISOString()} */`;var D8={desc:"Transpile & bundle meta stylesheets to CSS",opts:{...w8,...E0,...e,...v0,...N8,eval:p({alias:"e",desc:"eval meta stylesheet in given string (ignores other inputs & includes)"}),force:o({alias:"f",hint:"STR",desc:"CSS classes to force include (wildcards are supported, @-prefix will read from file)",delim:","})},fn:async(X)=>{const Z=b(B0(X.opts.specs),X.logger),J=vX(Z,X.opts.force||[],X.logger);if(X.opts.watch)await RX(X,Z,J);else if(X.opts.eval)Y1(X,Z,J,[X.opts.eval]);else Y1(X,Z,J,X.inputs.map((W)=>A(B0(W),X.logger)))}},RX=async(X,Z,J)=>{let W=!0;const Y=()=>{X.logger.info("closing watchers..."),U.forEach((V)=>V.watcher.close()),W=!1},U=X.inputs.map((V,B)=>{V=B0(V);const Q=z8(A(V,X.logger),{id:`in${P8(B)}`});return{input:Q,watcher:IX(V,{},(q)=>{if(q==="change")try{Q.next(A(V,X.logger))}catch(z){X.logger.warn(z.message),Y()}else X.logger.warn("input removed:",V),Y()})}});M8({src:s0(w(({input:V})=>[V.id,V],U))}).subscribe({next(V){try{Y1(X,Z,J,Object.keys(V).sort().map((B)=>V[B]))}catch(B){X.logger.warn(B.message)}}}),process.on("SIGINT",Y);while(W)await u1(null,250)},Y1=({logger:X,opts:{include:Z,noHeader:J,out:W,pretty:Y}},U,V,B)=>{const Q={logger:X,specs:U,format:Y?w0:t,mediaQueryIDs:new Set(Object.keys(U.media)),mediaQueryRules:{...V.mediaQueryRules},plainRules:{...V.plainRules}},q=Z?Z.map((z)=>A(B0(z),X).trim()):[];if(!J)q.push(_0(U));B.forEach((z)=>_X(z,Q)),EX(q,Q),AX(q,Q),X0(W,q,X)},AX=(X,{logger:Z,specs:J,format:W,mediaQueryRules:Y})=>{for(let U in Y){const V=j8(Y[U],J);Z.debug("mediaquery rules",U,V),X.push(U0(A0(SX(J.media,U),V),{format:W}))}},EX=(X,{logger:Z,specs:J,format:W,plainRules:Y})=>{const U=j8(Y,J);Z.debug("plain rules",U),X.push(U0(U,{format:W}))},vX=(X,Z,J)=>{const W=new Set(Object.keys(X.media)),Y=new Set(Object.keys(X.classes)),U={},V={};if(Z.length&&Z[0][0]==="@")Z=[...m(A(B0(Z[0].substring(1)),J))];for(let B of Z){if(!B||B.startsWith("//"))continue;const{token:Q,query:q}=k8(B,W);let z;if(Q.includes("*")){const K=new RegExp(`^${Q.replace("*",".*")}\$`);z=[...W1(($)=>K.test($),Y)]}else if(Y.has(Q))z=[Q];else{J.warn(`unknown include rule ID: ${B}, skipping...`);continue}for(let K of z)J.debug("including class:",K),q?T8(U,q,`.${K}`,K):I8(V,`.${K}`,K)}return{mediaQueryRules:U,plainRules:V}},_X=(X,{specs:Z,mediaQueryIDs:J,mediaQueryRules:W,plainRules:Y})=>{const U=V0(),V=V0(U),B={root:U,curr:V,scopes:[V]};for(let Q of m(X)){if(!Q||/^\s*\/\//.test(Q))continue;for(let q of m(Q,/\s+/g)){if(!q)continue;let z=B.curr;switch(z.state){case"sel":case"nest":if(q==="{"){if(z.state==="sel")z.sel=z.sel.map((K)=>K.replace(",","")),z.path=bX(B.scopes);z.state="class"}else if(q==="}")O8(B);else{const K=Y0(z.sel);if(!K||K.endsWith(","))z.sel.push(q);else z.sel[z.sel.length-1]+=" "+q}break;case"class":if(q==="{")z.state="nest",B.scopes.push(B.curr=V0(z));else if(q==="}")O8(B);else{let{token:K,query:$}=k8(q,J);if(!Z.classes[K])H(`unknown class ID: ${K}`);if($)T8(W,$,z.path,K);else I8(Y,z.path,K)}break;default:a(z.state)}}}},U1=":",G8="///",V0=(X)=>({state:"sel",sel:X?[]:["<root>"],path:"",parent:X}),O8=(X)=>{const Z=!X.curr.sel.length;if(F0(!!X.curr.parent,"stack underflow"),X.scopes.pop(),X.scopes.length>0){if(X.curr=Y0(X.scopes),!Z&&X.curr.state==="nest")X.scopes.push(X.curr=V0(X.curr))}else X.scopes.push(X.curr=V0(X.root))},bX=(X)=>X.map((Z)=>Z.sel.join(",")).join(G8),j8=(X,Z)=>Object.entries(X).map(([J,W])=>LX(J,W,Z)),LX=(X,Z,J)=>{const W=[];let Y=W;const U=X.split(G8);for(let V=0;V<U.length;V++){const B=U[V].split(",");if(V==U.length-1){const Q=Object.assign({},...w((q)=>J.classes[q],Z));if("__user"in Q)delete Q.__user;B.push(Q)}Y.push(B),Y=B}return W[0]},k8=(X,Z)=>{if(/^::?/.test(X))return{token:X};const J=X.lastIndexOf(U1);if(J<0)return{token:X};const W=X.substring(0,J);if(!W.split(U1).every((U)=>Z.has(U)))H(`invalid media query in token: ${X}`);return{token:X.substring(J+1),query:W}},SX=(X,Z)=>Z.split(U1).reduce((J,W)=>Object.assign(J,X[W]),{}),T8=(X,Z,J,W)=>{if(!X[Z])X[Z]={};(X[Z][J]||(X[Z][J]=new Set)).add(W)},I8=(X,Z,J)=>(X[Z]||(X[Z]=new Set)).add(J);import{resolve as R8} from"path";var E8={desc:"Export entire generated framework as CSS",opts:{...E0,...e,...v0,media:o({alias:"m",desc:"Media query IDs (use 'ALL' for all)",delim:","})},inputs:1,fn:async(X)=>{const{logger:Z,opts:{include:J,media:W,noHeader:Y,pretty:U,out:V},inputs:B}=X,Q=b(R8(B[0]),Z),q=J?J.map((z)=>A(R8(z),Z).trim()):[];if(!Y)q.push(_0(Q));q.push(yX(Q,W,U,Z)),X0(V,q,Z)}},yX=(X,Z,J,W)=>{const Y=A8("",X);if(Z){const U=Z[0]==="ALL"?Object.keys(X.media):Z;for(let V of U)if(X.media[V])Y.push(A0(X.media[V],A8("-"+V,X)));else W.warn(`invalid media query ID: ${V}, skipping...`)}return U0(Y,{format:J?w0:t})},A8=(X,Z)=>Object.entries(Z.classes).map(([J,W])=>[`.${J}${X}`,hX(W)]),hX=(X)=>{if("__user"in X)X={...X},delete X.__user;return X};import{statSync as fX} from"fs";import{resolve as mX} from"path";var v8={deg:U8,em:t1,ex:c1,ms:W8,percent:r0,px:s1,rad:V8,rem:r1,second:Y8,turn:B8,url:Q8,vh:e1,vmax:J8,vmin:Z8,vw:X8,"%":r0},uX={"":[""],a:[""],h:["-left","-right"],v:["-top","-bottom"],t:["-top"],top:["top"],b:["-bottom"],bottom:["bottom"],r:["-right"],right:["right"],l:["-left"],left:["left"],x:["-x"],y:["-y"]},_8={desc:"Generate framework rules from specs",opts:{...e,prec:C1({default:3,desc:"Number of fractional digits"})},inputs:1,fn:async(X)=>{const{logger:Z,opts:{prec:J,out:W,pretty:Y},inputs:U}=X,V=mX(U[0]);if(!fX(V).isDirectory())H(`${V} is not a directory`);const B={info:{name:"TODO",version:"0.0.0"},media:{},classes:{}};a1(J);for(let Q of S1(V,".json")){const q=b(Q,Z);Object.assign(B.info,q.info),Object.assign(B.media,q.media);for(let z of q.specs)gX(q,z,B.classes,Z)}X0(W,JSON.stringify(B,null,Y?4:0),Z)}},gX=(X,Z,J,W)=>{const Y=P(Z.var)?Z.var:[""],U=F(Z.props)?{[Z.props]:"<v>"}:Z.props,V=xX(Z,X),B=new Set;for(let Q of Y)for(let[q,z]of T0(uX[Q],Object.keys(V))){const K=V1(Z.name,Q,q,z,V[z]),$=dX(V[z],Z.unit);if(!J[K])J[K]=Z.user!=null?{__user:Z.user}:{};else if(!B.has(K))H(`duplicate class ID: ${K}`);B.add(K);for(let[v,_]of Object.entries(U)){const f=V1(v,Q,q,z,V[z]),M=V1(!Z.unit||F(_)?_:v8[Z.unit](_),Q,q,z,$);J[K][f]=M,W.debug(K,f,M)}}return J},xX=(X,Z)=>{const J=F(X.values)?Z.tables?.[X.values]||H(`invalid table ID: ${X.values}`):X.values;if(R(J))return J;const W=X.key==="v"?(Y)=>String(Y):X.key==="i1"?(Y,U)=>String(U+1):X.key===void 0?(Y,U)=>String(U):H(`invalid key type: ${X.key}`);return J.reduce((Y,U,V)=>{return Y[W(U,V)]=U,Y},{})},dX=(X,Z)=>{if(!Z||F(X))return X;const J=v8[Z];if(!J)H(`invalid unit: ${Z}`);return J(X)},V1=(X,Z,J,W,Y)=>X.replace("<vid>",Z).replace("<var>",J).replace("<k>",W).replace("<v>",String(Y));var B1=b(nX(import.meta.dir,"package.json"));_1({name:"metacss",opts:{out:p({alias:"o",desc:"Output file (or stdout)"}),verbose:l({alias:"v",desc:"Display extra process information"})},commands:{convert:D8,export:E8,generate:_8},ctx:async(X)=>{if(X.opts.verbose)X.logger.level=C.DEBUG;return{...X,format:H0}},usage:{prefix:`
|
|
2
|
+
var S0={default:95,hint:90,multi:90,param:96,required:33};var y0=(Z)=>Z;var o=function(Z,X){return!X&&(X={}),(...J)=>{const W=JSON.stringify(J);if(W!==void 0)return W in X?X[W]:X[W]=Z.apply(null,J);return Z.apply(null,J)}};var i=o((Z,X)=>Z.repeat(X));var z1=(Z)=>/^[a-f0-9]+$/i.test(Z);var q1=(Z)=>/^[-+]?\d+$/.test(Z),$1=(Z)=>/^[-+]?\d*\.?\d+(e[-+]?\d+)?$/i.test(Z);var I=(Z,X=(J)=>J!==void 0?": "+J:"")=>class extends Error{constructor(J){super(Z(J)+X(J))}};var L8=I(()=>"illegal argument(s)"),H=(Z)=>{throw new L8(Z)};var h0=(Z)=>$1(Z)?parseFloat(Z):H(`not a numeric value: ${Z}`),K1=(Z)=>Z.map(h0),f0=(Z)=>z1(Z)?parseInt(Z,16):H(`not a hex value: ${Z}`),H1=(Z)=>Z.map(f0),m0=(Z)=>q1(Z)?parseInt(Z):H(`not an integer: ${Z}`),C1=(Z)=>Z.map(m0);var $0=(Z,X)=>(J)=>({coerce:Z,hint:X,group:"main",...J}),K0=(Z,X)=>(J)=>({hint:S8(X,J.delim),multi:!0,coerce:Z,group:"main",...J}),S8=(Z,X)=>Z+(X?`[${X}..]`:""),m=(Z)=>({flag:!0,default:!1,group:"flags",...Z}),a=$0(y0,"STR"),t=K0(y0,"STR"),K5=$0(h0,"NUM"),H5=$0(f0,"HEX"),M1=$0(m0,"INT"),C5=K0(K1,"NUM"),M5=K0(H1,"HEX"),F5=K0(C1,"INT");var C=((Z)=>{return Z[Z.FINE=0]="FINE",Z[Z.DEBUG=1]="DEBUG",Z[Z.INFO=2]="INFO",Z[Z.WARN=3]="WARN",Z[Z.SEVERE=4]="SEVERE",Z[Z.NONE=5]="NONE",Z})(C||{});class u0{id;level;constructor(Z,X=C.FINE){this.id=Z,this.level=typeof X==="string"?C[X]:X}enabled(Z){return this.level<=Z}fine(...Z){this.level<=C.FINE&&this.log(C.FINE,Z)}debug(...Z){this.level<=C.DEBUG&&this.log(C.DEBUG,Z)}info(...Z){this.level<=C.INFO&&this.log(C.INFO,Z)}warn(...Z){this.level<=C.WARN&&this.log(C.WARN,Z)}severe(...Z){this.level<=C.SEVERE&&this.log(C.SEVERE,Z)}}var F1=(Z)=>Z.map((X)=>{if(typeof X==="function")X=X();if(!(typeof X==="string"||typeof X==="number"))X=JSON.stringify(X);return X}).join(" ");class g0 extends u0{constructor(Z,X,J=C.FINE){super(X,J);this.target=Z}log(Z,X){this.target.write(`[${C[Z]}] ${this.id}: ${F1(X)}
|
|
3
|
+
`)}}var H0=o((Z,X=" ")=>{const J=i(String(X),Z);return(W,Y)=>{if(W==null)return J;return W=W.toString(),Y=Y!==void 0?Y:W.length,Y<Z?W+J.substring(Y):W}});var P1=(Z,X)=>{return!X&&(X=new Map),(J)=>{let W;return X.has(J)?X.get(J):(X.set(J,W=Z(J)),W)}};var x0={black:1,blue:5,cyan:7,gray:17,green:3,magenta:6,red:2,white:24,yellow:4,lightBlue:21,lightCyan:23,lightGray:8,lightGreen:19,lightMagenta:22,lightRed:18,lightYellow:20,bgBlack:32,bgBlue:160,bgCyan:224,bgGray:544,bgGreen:96,bgMagenta:192,bgRed:64,bgWhite:768,bgYellow:128,bgLightBlue:672,bgLightCyan:736,bgLightGray:256,bgLightGreen:608,bgLightMagenta:704,bgLightRed:576,bgLightYellow:640};var y8=(Z,X)=>(J)=>Z.format(X,J),d0=(Z)=>Object.keys(x0).reduce((X,J)=>(X[J]=y8(Z,x0[J]),X),{format:Z});var N1="\x1B[0m",h8=["","1","2","1;2","4","1;4","2;4","1;2;4"],C0={format:(Z,X)=>C0.start(Z)+X+C0.end,start:P1((Z)=>{let X=[],J=Z&15;return J&&X.push(29+(Z>>4&1)*60+J),J=Z>>5&15,J&&X.push(39+(Z>>9&1)*60+J),J=Z>>10,J&&X.push(h8[J]),"\x1B["+X.join(";")+"m"}),end:N1,prefix:N1,suffix:"\n"};var w1={format:(Z,X)=>String(X),prefix:"",suffix:"\n",start:()=>"",end:""};var M0=d0(C0),O1=d0(w1);var P=Array.isArray;var f8=(Z)=>Z.toUpperCase(),D1=(Z)=>Z.toLowerCase(),G1=(Z)=>Z.length?Z[0].toUpperCase()+Z.substring(1):Z,j1=(Z,X="-")=>D1(Z.replace(/([a-z0-9\u00e0-\u00fd])([A-Z\u00c0-\u00dd])/g,(J,W,Y)=>W+X+Y));var k1=(Z,X="-")=>D1(Z).replace(new RegExp(`\\${X}+(\\w)`,"g"),(J,W)=>f8(W));var T1=Object.getPrototypeOf,R=(Z)=>{let X;return Z!=null&&typeof Z==="object"&&((X=T1(Z))===null||T1(X)===null)};var m8=/\x1b\[[0-9;]+m/g,u8=(Z)=>Z.replace(m8,"");var F0=(Z)=>u8(Z).length;var I1=(Z=!1,X)=>(J)=>Z||typeof J!=="string"&&typeof J!=="number"?JSON.stringify(J,null,X):String(J);function*u(Z,X=/\r?\n/g,J=!1){let W=0;const Y=Z.length,B=~~J;let U;if(typeof X==="string")U=new RegExp(X,"g");else if(!X.flags.includes("g"))U=new RegExp(X,X.flags+"g");else U=X;for(;W<Y;){const V=U.exec(Z);if(!V){yield Z.substring(W);return}const Q=V[0].length;yield Z.substring(W,V.index+B*Q),W=V.index+Q}}class n0{n=0;w=[];constructor(Z,X){Z!=null&&this.add(Z,X)}add(Z,X=Z.length){return this.w.push(Z),this.n+=X+~~(this.n>0),this}toString(){return this.w.join(" ")}}var g8={length:(Z)=>Z.length,split:(Z,X)=>X},A1={length:F0,split:(Z,X)=>{const J=/\x1b\[[0-9;]+m/g;let W=X,Y;while(Y=J.exec(Z)){if(Y.index>=X)break;const B=Y[0].length;W+=B,X+=B}return W}},R1=(Z,X,J,W)=>{const Y=Z[Z.length-1];Y&&W-Y.n>J?Y.add(X,J):Z.push(new n0(X,J))},x8=(Z,{width:X,min:J,hard:W,splitter:Y},B=0,U=[])=>{let V=Y.length(Z),Q=X-B;if(Q<J&&Q<V)Q=X;while(W&&V>Q){const q=Y.split(Z,Q),z=Z.substring(0,q);R1(U,z,Q,X),Z=Z.substring(q),Q=X,V=Y.length(Z)}return R1(U,Z,V,X),U},d8=(Z,X,J=[])=>{if(!Z.length)return J.push(new n0),J;const W={width:80,min:4,hard:!1,splitter:g8,...X};for(let Y of u(Z,X.delimWord||/\s/g)){const B=J[J.length-1];x8(Y,W,B&&B.n>0?B.n+1:0,J)}return J},E1=(Z,X)=>{let J=[];for(let W of u(Z,X.delimLine))J=J.concat(d8(W,X));return J};var W0=(Z,X={})=>{X={lineWidth:80,paramWidth:32,showDefaults:!0,prefix:"",suffix:"",groups:["flags","main"],...X};const J=R(X.color)?{...S0,...X.color}:X.color?S0:{},W=i(" ",X.paramWidth),Y=(V)=>V.map((Q)=>n8(Q,Z[Q],X,J,W)),B=Object.keys(Z).sort(),U=X.groups?X.groups.map((V)=>[V,B.filter((Q)=>Z[Q].group===V)]).filter((V)=>!!V[1].length):[["options",B]];return[...l0(X.prefix,X.lineWidth),...U.map(([V,Q])=>[...X.showGroupNames?[`${G1(V)}:
|
|
4
|
+
`]:[],...Y(Q),""].join("\n")),...l0(X.suffix,X.lineWidth)].join("\n")},n8=(Z,X,J,W,Y)=>{const B=l8(X,W),U=p8(X,W,B),V=Y0(`--${j1(Z)}`,W.param),Q=`${U}${V}${B}`,q=X.optional===!1&&X.default===void 0,z=[];q&&z.push("required"),X.multi&&z.push("multiple");const $=o8(z,W,q)+(X.desc||"")+i8(X,J,W);return H0(J.paramWidth)(Q,F0(Q))+l0($,J.lineWidth-J.paramWidth).map((K,v)=>v>0?Y+K:K).join("\n")},l8=(Z,X)=>Z.hint?Y0(" "+Z.hint,X.hint):"",p8=(Z,X,J)=>Z.alias?`${Y0("-"+Z.alias,X.param)}${J}, `:"",o8=(Z,X,J)=>Z.length?Y0(`[${Z.join(", ")}] `,J?X.required:X.multi):"",i8=(Z,X,J)=>X.showDefaults&&Z.default!=null&&Z.default!==!1?Y0(` (default: ${I1(!0)(Z.defaultHint!=null?Z.defaultHint:Z.default)})`,J.default):"",Y0=(Z,X)=>X!=null?`\x1B[${X}m${Z}\x1B[0m`:Z,l0=(Z,X)=>Z?E1(Z,{width:X,splitter:A1,hard:!1}):[];var a8=I(()=>"parse error"),v1=(Z,X,J)=>{J={start:2,showUsage:!0,help:["--help","-h"],...J};try{return t8(Z,X,J)}catch(W){if(J.showUsage)console.log(W.message+"\n\n"+W0(Z,J.usageOpts));throw new a8(W.message)}},t8=(Z,X,J)=>{const W=c8(Z),Y={};let B,U,V=J.start;for(;V<X.length;){const Q=X[V];if(!B){if(J.help.includes(Q)){console.log(W0(Z,J.usageOpts));return}const q=r8(Z,W,Y,Q);if(B=q.id,U=q.spec,V=V+~~(q.state<2),q.state)break}else{if(s8(U,Y,B,Q))break;B=null,V++}}return B&&H(`missing value for: --${B}`),{result:e8(Z,Y),index:V,rest:X.slice(V),done:V>=X.length}},c8=(Z)=>Object.entries(Z).reduce((X,[J,W])=>W.alias?(X[W.alias]=J,X):X,{}),r8=(Z,X,J,W)=>{if(W[0]==="-"){let Y;if(W[1]==="-"){if(W==="--")return{state:1};Y=k1(W.substring(2))}else Y=X[W.substring(1)],!Y&&H(`unknown option: ${W}`);const B=Z[Y];if(!B&&H(Y),B.flag){if(J[Y]=!0,Y=void 0,B.fn&&!B.fn("true"))return{state:1,spec:B}}return{state:0,id:Y,spec:B}}return{state:2}},s8=(Z,X,J,W)=>{if(/^-[a-z]/i.test(W)&&H(`missing value for: --${J}`),Z.multi)P(X[J])?X[J].push(W):X[J]=[W];else X[J]=W;return Z.fn&&!Z.fn(W)},e8=(Z,X)=>{let J;for(let W in Z)if(J=Z[W],X[W]===void 0){if(J.default!==void 0)X[W]=J.default;else if(J.optional===!1)H(`missing arg: --${W}`)}else if(J.coerce)Z4(J,X,W);return X},Z4=(Z,X,J)=>{try{if(Z.multi&&Z.delim)X[J]=X[J].reduce((W,Y)=>(W.push(...Y.split(Z.delim)),W),[]);X[J]=Z.coerce(X[J])}catch(W){throw new Error(`arg --${J}: ${W.message}`)}};var _1=async(Z)=>{const X=Z.argv||process.argv,J=!process.env.NO_COLOR,W={prefix:"",color:J,...Z.usage};try{let Y,B,U=Z.start??2;if(Z.single){if(Y=Object.keys(Z.commands)[0],!Y)H("no command provided");B=Z.commands[Y]}else{if(Y=X[U],B=Z.commands[Y],W.prefix+=X4(Z.commands),!B)b1(Z,W);U++}let V;try{V=v1({...Z.opts,...B.opts},X,{showUsage:!0,usageOpts:W,start:U})}catch(q){}if(!V)process.exit(1);if(B.inputs!==void 0&&B.inputs!==V.rest.length)process.stderr.write(`expected ${B.inputs||0} input(s)
|
|
5
|
+
`),b1(Z,W);const Q=await Z.ctx({logger:new g0(process.stderr,Z.name,"INFO"),format:J?M0:O1,opts:V.result,inputs:V.rest},B);if(await B.fn(Q),Z.post)await Z.post(Q,B)}catch(Y){process.stderr.write(Y.message+"\n\n"),process.exit(1)}},b1=(Z,X)=>{process.stderr.write(W0(Z.opts,X)),process.exit(1)},X4=(Z)=>["\nAvailable commands:\n",...Object.keys(Z).map((X)=>`${H0(16)(X)}: ${Z[X].desc}`),"\n"].join("\n");import{existsSync as J4,mkdirSync as W4,statSync as Y4} from"fs";import{sep as B4} from"path";var L1=(Z)=>{const X=Z.substring(0,Z.lastIndexOf(B4));return X.length>0&&!J4(X)?(W4(X,{recursive:!0}),!0):!1},S1=(Z)=>Y4(Z).isDirectory();var k=(Z)=>typeof Z==="function";var F=(Z)=>typeof Z==="string";import{readdirSync as U4,statSync as TZ} from"fs";import{sep as V4} from"path";function*h1(Z,X="",J,W=Infinity,Y=0){if(Y>=W)return;const B=z4(X);for(let U of U4(Z).sort()){const V=Z+V4+U;try{if(S1(V))yield*h1(V,X,J,W,Y+1);else if(B(V))yield V}catch(Q){J&&J.warn(`ignoring file: ${U} (${Q.message})`)}}}var y1=(Z,X="",J=Infinity,W)=>h1(Z,X,W,J,0);var Q4=(Z)=>F(Z)?new RegExp(`${Z.replace(/\./g,"\\.")}\$`):Z,z4=(Z)=>k(Z)?Z:(Z=Q4(Z),(X)=>Z.test(X));import{readFileSync as $4} from"fs";import{writeFileSync as q4} from"fs";var f1=(Z,X,J,W,Y=!1)=>{if(W&&W.info(`${Y?"[dryrun] ":""}writing file: ${Z}`),Y)return;L1(Z),q4(Z,X,!J&&F(X)?"utf-8":J)};var A=(Z,X,J="utf-8")=>{return X&&X.debug("reading file:",Z),$4(Z,J)},p0=(Z,X,J,W=!1)=>f1(Z,P(X)?X.join("\n"):X,"utf-8",J,W);var L=(Z,X)=>JSON.parse(A(Z,X));var P0=Object.freeze({level:C.NONE,enabled:()=>!1,fine(){},debug(){},info(){},warn(){},severe(){}});import{join as l4} from"path";var K4=I(()=>"Assertion failed"),N0=(typeof process!=="undefined"&&process.env!==void 0?!0:import.meta.env?import.meta.env.MODE!=="production"||!!import.meta.env.UMBRELLA_ASSERTS||!!import.meta.env.VITE_UMBRELLA_ASSERTS:!0)?(Z,X)=>{if(typeof Z==="function"&&!Z()||!Z)throw new K4(typeof X==="function"?X():X)}:()=>{};var w0=(Z)=>Z!=null&&typeof Z!=="function"&&Z.length!==void 0;var m1=(Z)=>{return(Z==null||!Z[Symbol.iterator])&&H(`value is not iterable: ${Z}`),Z};var u1=(Z)=>w0(Z)?Z:[...m1(Z)];var B0=(Z)=>Z[Z.length-1];var H4=I(()=>"illegal arity"),c=(Z)=>{throw new H4(Z)};var C4=I(()=>"illegal state"),r=(Z)=>{throw new C4(Z)};var o0=function(...Z){let[X,J,W,Y,B,U,V,Q,q,z]=Z;switch(Z.length){case 0:c(0);case 1:return X;case 2:return(...K)=>X(J(...K));case 3:return(...K)=>X(J(W(...K)));case 4:return(...K)=>X(J(W(Y(...K))));case 5:return(...K)=>X(J(W(Y(B(...K)))));case 6:return(...K)=>X(J(W(Y(B(U(...K))))));case 7:return(...K)=>X(J(W(Y(B(U(V(...K)))))));case 8:return(...K)=>X(J(W(Y(B(U(V(Q(...K))))))));case 9:return(...K)=>X(J(W(Y(B(U(V(Q(q(...K)))))))));case 10:default:const $=(...K)=>X(J(W(Y(B(U(V(Q(q(z(...K))))))))));return Z.length===10?$:o0($,...Z.slice(10))}};var g1=(Z,X)=>new Promise((J)=>setTimeout(()=>J(Z),X));var x1=(Z)=>Z;var d1=["-moz-","-ms-","-o-","-webkit-"],g={rules:"",ruleSep:",",valSep:"",decls:"",declStart:"{",declEnd:"}",indent:"",comments:!1},U0={rules:"\n",ruleSep:", ",valSep:" ",decls:"\n",declStart:" {\n",declEnd:"}\n",indent:" ",comments:!0};var G=(Z)=>Z!=null&&typeof Z[Symbol.iterator]==="function";var O0=(Z,X)=>Z!=null&&typeof Z[X]==="function";var x=(Z)=>O0(Z,"xform")?Z.xform():Z;var S=function(...Z){return Z=Z.map(x),o0.apply(null,Z)};var D0=(Z)=>Z!=null&&typeof Z!=="string"&&typeof Z[Symbol.iterator]==="function";var s=(Z,X)=>[Z[0],Z[1],X];var y=Symbol(),i0=()=>{};class a0{value;constructor(Z){this.value=Z}deref(){return this.value}}var j=(Z)=>Z instanceof a0;var h=(Z)=>Z instanceof a0?Z.deref():Z;var G0=function(...Z){const X=Z[0],J=X[0],W=X[1],Y=X[2];Z=M4(Z);const B=Z[0]==null?J():Z[0],U=Z[1];return h(W(O0(U,"$reduce")?U.$reduce(Y,B):w0(U)?F4(Y,B,U):P4(Y,B,U)))};var M4=(Z)=>Z.length===2?[void 0,Z[1]]:Z.length===3?[Z[1],Z[2]]:c(Z.length),F4=(Z,X,J)=>{for(let W=0,Y=J.length;W<Y;W++)if(X=Z(X,J[W]),j(X)){X=X.deref();break}return X},P4=(Z,X,J)=>{for(let W of J)if(X=Z(X,W),j(X)){X=X.deref();break}return X},e=(Z,X)=>[Z,(J)=>J,X];var j0=function(Z){return Z?[...Z]:e(()=>[],(X,J)=>(X.push(J),X))};function*k0(Z,X){const J=x(Z)(j0()),W=J[1],Y=J[2];for(let B of X){const U=Y([],B);if(j(U)){yield*h(W(U.deref()));return}if(U.length)yield*U}yield*h(W([]))}function*d(Z,X){const J=x(Z)([i0,i0,(W,Y)=>Y])[2];for(let W of X){let Y=J(y,W);if(j(Y)){if(Y=h(Y.deref()),Y!==y)yield Y;return}if(Y!==y)yield Y}}var T0=(Z,X,J=d)=>{const W=X.length-1;return G(X[W])?X.length>1?J(Z.apply(null,X.slice(0,W)),X[W]):J(Z(),X[0]):void 0};var t0=function(Z,X){return G(X)?k0(t0(Z),F(X)?[X]:X):(J)=>{const W=J[2],Y=(B,U)=>{const V=Z(U);if(V){for(let Q of V)if(B=Y(B,Q),j(B))break;return B}return W(B,U)};return s(J,Y)}};var n1=function(Z){return t0((X)=>D0(X)?X:void 0,Z)};var N=function(Z,X){return G(X)?d(N(Z),X):(J)=>{const W=J[2];return s(J,(Y,B)=>W(Y,Z(B)))}};function*I0(...Z){const X=Z.length-1;if(X<0)return;const J=new Array(X+1).fill(0),W=Z.map(u1),Y=W.reduce((B,U)=>B*U.length,1);for(let B=0;B<Y;B++){const U=[];for(let V=X;V>=0;V--){const Q=W[V];let q=J[V];if(q===Q.length)J[V]=q=0,V>0&&J[V-1]++;U[V]=Q[q]}J[X]++,yield U}}function*l1(Z,X=Infinity){while(X-- >0)yield Z}var c0=function(Z,X){Z=Z||"";let J=!0;return X?[...X].join(Z):e(()=>"",(W,Y)=>(W=J?W+Y:W+Z+Y,J=!1,W))};var R0=function(...Z){return N4(R0,G0,Z)};var N4=(Z,X,J)=>{let W,Y;switch(J.length){case 4:Y=J[3],W=J[2];break;case 3:Y=J[2];break;case 2:return N((B)=>Z(J[0],J[1],B));default:c(J.length)}return X(x(J[0])(J[1]),W,Y)};var w4=new Set,O4=":[",p1=S(n1(),N((Z)=>O4.indexOf(Z.charAt(0))>=0?Z:" "+Z)),D4=(Z,X)=>S(Z,N((J)=>F(J)&&J.indexOf(" .")==0?J+X:J)),Z0=(Z,X,J,W)=>{const Y=J.length,B=[];let U,V;const Q=(q,z)=>{let $=null;if(P(z))Z0(Z,r0(X,B),z,W);else if(G(z)&&!F(z))Z0(Z,r0(X,B),[...z],W);else if((V=k(z))||($=W.fns[z]))if(!X.length){if($)return $.apply(null,J.slice(q+1))(Z,W),!0;z(Z,W)}else if(V)Q(q,z());else H(`quoted fn ('${z}') only allowed at head position`);else if(R(z))U=Object.assign(U||{},z);else if(z!=null)B.push(z)};for(let q=0;q<Y;q++)if(Q(q,J[q]))return Z;return U&&Z.push(G4(X,B,U,W)),Z},r0=(Z,X)=>Z.length?[...I0(Z,X)]:X,G4=(Z,X,J,W)=>{const Y=W.format,B=A0(W),U=W.scope?D4(p1,W.scope):p1;return[B,R0(N((V)=>R0(U,c0(),P(V)?V:[V]).trim()),c0(Y.ruleSep),r0(Z,X)),Y.declStart,s0(J,W),B,Y.declEnd].join("")},s0=(Z,X)=>{const J=X.format,W=X.autoprefix||w4,Y=A0(X,X.depth+1),B=[];for(let U in Z)if(Z.hasOwnProperty(U)){let V=Z[U];if(k(V))V=V(Z);if(P(V))V=V.map((Q)=>P(Q)?Q.join(" "):Q).join(J.ruleSep);if(W.has(U))for(let Q of X.vendors)B.push(`${Y}${Q}${U}:${J.valSep}${V};`);B.push(`${Y}${U}:${J.valSep}${V};`)}return B.join(J.decls)+J.decls},A0=(Z,X=Z.depth)=>X>1?[...l1(Z.format.indent,X)].join(""):X>0?Z.format.indent:"";var i1=(Z,X,J)=>(W,Y)=>{const B=A0(Y);return W.push(`${B}${Z} ${j4(X)}${Y.format.declStart}`),Y.depth++,Z0(W,[],J,Y),Y.depth--,W.push(B+Y.format.declEnd),W},j4=(Z)=>{if(F(Z))return Z;const X=[];for(let J in Z)if(Z.hasOwnProperty(J)){let W=Z[J];if(W===!0)W=o1.has(J)?J:`(${J})`;else if(W===!1)W=`(not ${o1.has(J)?J:`(${J})`})`;else if(W==="only")W+=" "+J;else W=`(${J}:${W})`;X.push(W)}return X.join(" and ")},o1=new Set(["all","print","screen"]);var n=(Z,X)=>{return X={format:g,vendors:d1,fns:{},depth:0,...X},P(X.autoprefix)&&(X.autoprefix=new Set(X.autoprefix)),R(Z)?s0(Z,X):k(Z)?Z([],X).join(X.format.rules):Z0([],[],P(Z)?Z:D0(Z)?[...Z]:H("invalid rules"),X).join(X.format.rules)};var E0=(Z,X)=>i1("@media",Z,X);var a1=4,t1=(Z)=>a1=Z,D=(Z)=>Z===(Z|0)?String(Z):Z.toFixed(a1).replace(/^0./,".").replace(/^-0./,"-.").replace(/0+$/,""),c1=(Z)=>`${D(Z)}em`,r1=(Z)=>`${D(Z)}ex`,s1=(Z)=>`${D(Z)}rem`,e0=(Z)=>`${D(Z)}%`,e1=(Z)=>`${D(Z)}px`,Z8=(Z)=>`${D(Z)}vh`,X8=(Z)=>`${D(Z)}vw`,J8=(Z)=>`${D(Z)}vmin`,W8=(Z)=>`${D(Z)}vmax`,Y8=(Z)=>`${Z|0}ms`,B8=(Z)=>`${D(Z)}s`;var U8=(Z)=>`${D(Z)}deg`,V8=(Z)=>`${D(Z)}rad`,Q8=(Z)=>`${D(Z)}turn`,z8=(Z)=>`url(${Z})`;var w=((Z)=>{return Z[Z.IDLE=0]="IDLE",Z[Z.ACTIVE=1]="ACTIVE",Z[Z.DONE=2]="DONE",Z[Z.UNSUBSCRIBED=3]="UNSUBSCRIBED",Z[Z.ERROR=4]="ERROR",Z})(w||{}),T=((Z)=>{return Z[Z.NEVER=0]="NEVER",Z[Z.FIRST=1]="FIRST",Z[Z.LAST=2]="LAST",Z})(T||{});var k4=0,T4=()=>k4++,l=(Z,X)=>!X||!X.id?{...X,id:Z+"-"+T4()}:X;var O=P0;class f{constructor(Z,X){this.wrapped=Z,X=l("sub",{closeIn:T.LAST,closeOut:T.LAST,cache:!0,...X}),this.parent=X.parent,this.id=X.id,this.closeIn=X.closeIn,this.closeOut=X.closeOut,this.cacheLast=X.cache,X.xform&&(this.xform=X.xform(j0()))}id;closeIn;closeOut;parent;__owner;xform;cacheLast;last=y;state=w.IDLE;subs=[];deref(){return this.last!==y?this.last:void 0}getState(){return this.state}setState(Z){this.state=Z}subscribe(Z,X={}){this.ensureState();let J;if(Z instanceof f&&!X.xform)Z.ensureState(),N0(!Z.parent,`sub '${Z.id}' already has a parent`),Z.parent=this,J=Z;else J=new f(Z,{...X,parent:this});return this.subs.push(J),this.setState(w.ACTIVE),J.setState(w.ACTIVE),this.last!=y&&J.next(this.last),J}transform(...Z){let X,J;if(R(B0(Z)))J=Z.pop(),X={error:J.error};return this.subscribe(X,l("xform",Z.length>0?{...J,xform:S(...Z)}:J))}map(Z,X){return this.transform(N(Z),X||{})}unsubscribe(Z){return Z?this.unsubscribeChild(Z):this.unsubscribeSelf()}unsubscribeSelf(){return O.debug(this.id,"unsub self"),this.parent&&this.parent.unsubscribe(this),this.state<w.UNSUBSCRIBED&&(this.state=w.UNSUBSCRIBED),this.release(),!0}unsubscribeChild(Z){O.debug(this.id,"unsub child",Z.id);const X=this.subs.indexOf(Z);if(X>=0){if(this.subs.splice(X,1),this.closeOut===T.FIRST||!this.subs.length&&this.closeOut!==T.NEVER)this.unsubscribe();return!0}return!1}next(Z){if(this.state>=w.DONE)return;this.xform?this.dispatchXform(Z):this.dispatch(Z)}done(){if(O.debug(this.id,"entering done()"),this.state>=w.DONE)return;if(this.xform){if(!this.dispatchXformDone())return}if(this.state=w.DONE,this.dispatchTo("done"))this.state<w.UNSUBSCRIBED&&this.unsubscribe();O.debug(this.id,"exiting done()")}error(Z){const X=this.wrapped,J=X&&X.error;return J&&O.debug(this.id,"attempting wrapped error handler"),J&&X.error(Z)||this.unhandledError(Z)}unhandledError(Z){return(O!==P0?O:console).warn(this.id,"unhandled error:",Z),this.unsubscribe(),this.state=w.ERROR,!1}dispatchTo(Z,X){let J=this.wrapped;if(J)try{J[Z]&&J[Z](X)}catch(Y){if(!this.error(Y))return!1}const W=Z==="next"?this.subs:[...this.subs];for(let Y=W.length;Y-- >0;){J=W[Y];try{J[Z]&&J[Z](X)}catch(B){if(Z==="error"||!J.error||!J.error(B))return this.unhandledError(B)}}return!0}dispatch(Z){O.debug(this.id,"dispatch",Z),this.cacheLast&&(this.last=Z),this.dispatchTo("next",Z)}dispatchXform(Z){let X;try{X=this.xform[2]([],Z)}catch(J){this.error(J);return}if(this.dispatchXformVals(X))j(X)&&this.done()}dispatchXformDone(){let Z;try{Z=this.xform[1]([])}catch(X){return this.error(X)}return this.dispatchXformVals(Z)}dispatchXformVals(Z){const X=h(Z);for(let J=0,W=X.length;J<W&&this.state<w.DONE;J++)this.dispatch(X[J]);return this.state<w.ERROR}ensureState(){if(this.state>=w.DONE)r(`operation not allowed in state ${this.state}`)}release(){this.subs.length=0,delete this.parent,delete this.xform,delete this.last}}var q8=(Z,X)=>{const J=new $8(X);return J.next(Z),J};class $8 extends f{src;_cancel;_inited;constructor(Z,X){const[J,W]=k(Z)?[Z,X||{}]:[void 0,Z||{}];super(W.error?{error:W.error}:void 0,l("stream",W));this.src=J,this._inited=!1}subscribe(Z,X={}){const J=super.subscribe(Z,X);if(!this._inited){if(this.src)try{this._cancel=this.src(this)||(()=>{return})}catch(W){let Y=this.wrapped;if(!Y||!Y.error||!Y.error(W))this.unhandledError(W)}this._inited=!0}return J}unsubscribe(Z){const X=super.unsubscribe(Z);if(X&&(!Z||(!this.subs||!this.subs.length)&&this.closeOut!==T.NEVER))this.cancel();return X}done(){this.cancel(),super.done(),delete this.src,delete this._cancel}error(Z){if(super.error(Z))return!0;return this.cancel(),!1}cancel(){if(this._cancel){O.debug(this.id,"cancel");const Z=this._cancel;delete this._cancel,Z()}}}var K8=(Z,X)=>Z===T.FIRST||Z===T.LAST&&!X;var Z1=function(Z){return Z?G0(Z1(),Z):e(()=>({}),(X,[J,W])=>(X[J]=W,X))};var X1=function(Z,X){return G(X)?d(X1(Z),X):N(k(Z)?(J)=>[Z(J),J]:(J)=>[Z,J])};var J1=function(...Z){const X=T0(J1,Z);if(X)return X;const J=Z[0],W=Z[1]!==!1;return N((Y)=>{const B=W?{}:Y;for(let U in Y)B[U]=J(Y[U]);return B})};var W1=function(...Z){const X=T0(W1,Z,k0);if(X)return X;const{key:J,mergeOnly:W,reset:Y,all:B,backPressure:U}={key:x1,mergeOnly:!1,reset:!0,all:!0,backPressure:0,...Z[1]},V=P(Z[0])?new Set(Z[0]):Z[0],Q=new Set,q=new Map;let z={};const $=([K,v,p])=>{let b=!0;if(W||U<1)return[K,(M)=>{if(Y&&B&&Q.size>0||!Y&&b)M=p(M,z),z={},Q.clear(),b=!1;return v(M)},(M,_)=>{const E=J(_);if(V.has(E)){if(z[E]=_,Q.add(E),W||H8(V,Q))if(M=p(M,z),b=!1,Y)z={},Q.clear();else z={...z}}return M}];else return[K,(M)=>{if(B&&Q.size>0)M=p(M,C8(q,Q)),q.clear(),Q.clear();return v(M)},(M,_)=>{const E=J(_);if(V.has(E)){let q0=q.get(E);!q0&&q.set(E,q0=[]),q0.length>=U&&r(`max back pressure (${U}) exceeded for input: ${String(E)}`),q0.push(_),Q.add(E);while(H8(V,Q))if(M=p(M,C8(q,Q)),b=!1,j(M))break}return M}]};return $.keys=()=>V,$.clear=()=>{q.clear(),V.clear(),Q.clear(),z={}},$.add=(K)=>{V.add(K)},$.delete=(K,v=!0)=>{if(q.delete(K),V.delete(K),v)Q.delete(K),delete z[K]},$},H8=(Z,X)=>{if(X.size<Z.size)return!1;for(let J of Z)if(!X.has(J))return!1;return!0},C8=(Z,X)=>{const J={};for(let W of X){const Y=Z.get(W);J[W]=Y.shift(),!Y.length&&X.delete(W)}return J};var M8=(Z,X)=>{let J=!0;for(let W of X)J=Z.removeID(W)&&J;return J};var F8=(Z)=>new P8(Z);class P8 extends f{sources;idSources;realSourceIDs;invRealSourceIDs;psync;clean;constructor(Z){const X=W1(new Set,{key:(W)=>W[0],mergeOnly:Z.mergeOnly===!0,reset:Z.reset===!0,all:Z.all!==!1,backPressure:Z.backPressure||0}),J=J1((W)=>W[1]);super(void 0,l("streamsync",{...Z,xform:Z.xform?S(X,J,Z.xform):S(X,J)}));this.sources=new Map,this.realSourceIDs=new Map,this.invRealSourceIDs=new Map,this.idSources=new Map,this.psync=X,this.clean=!!Z.clean,Z.src&&this.addAll(Z.src)}add(Z,X){X||(X=Z.id),this.ensureState(),this.psync.add(X),this.realSourceIDs.set(X,Z.id),this.invRealSourceIDs.set(Z.id,X),this.idSources.set(Z.id,Z),this.sources.set(Z,Z.subscribe({next:(J)=>J[1]instanceof f?this.add(J[1]):this.next(J),done:()=>this.markDone(Z),__owner:this},{xform:X1(X),id:`in-${X}`}))}addAll(Z){for(let X in Z)this.psync.add(X);for(let X in Z)this.add(Z[X],X)}remove(Z){const X=this.sources.get(Z);if(X){const J=this.invRealSourceIDs.get(Z.id);return O.info(`removing src: ${Z.id} (${J})`),this.psync.delete(J,this.clean),this.realSourceIDs.delete(J),this.invRealSourceIDs.delete(Z.id),this.idSources.delete(Z.id),this.sources.delete(Z),X.unsubscribe(),!0}return!1}removeID(Z){const X=this.getSourceForID(Z);return X?this.remove(X):!1}removeAll(Z){for(let J of Z)this.psync.delete(this.invRealSourceIDs.get(J.id));let X=!0;for(let J of Z)X=this.remove(J)&&X;return X}removeAllIDs(Z){return M8(this,Z)}getSourceForID(Z){return this.idSources.get(this.realSourceIDs.get(Z))}getSources(){const Z={};for(let[X,J]of this.idSources)Z[this.invRealSourceIDs.get(X)]=J;return Z}unsubscribe(Z){if(!Z){O.debug(this.id,"unsub sources");for(let X of this.sources.values())X.unsubscribe();this.sources.clear(),this.psync.clear(),this.realSourceIDs.clear(),this.invRealSourceIDs.clear(),this.idSources.clear()}return super.unsubscribe(Z)}markDone(Z){this.remove(Z),K8(this.closeIn,this.sources.size)&&this.done()}}var Y1=o((Z,X=" ")=>{const J=i(String(X),Z);return(W,Y)=>{if(W==null)return J;return W=W.toString(),Y=Y!==void 0?Y:W.length,Y<Z?J.substring(Y)+W:W}}),A2=Y1(2,"0"),N8=Y1(3,"0"),E2=Y1(4,"0");var B1=function(Z,X){return G(X)?d(B1(Z),X):(J)=>{const W=J[2];return s(J,(Y,B)=>Z(B)?W(Y,B):Y)}};import{watch as R4} from"fs";import{resolve as Q0} from"path";var w8={specs:a({alias:"s",optional:!1,desc:"Path to generated JSON defs"})},v0={include:t({alias:"I",desc:"Include CSS files (prepend)"})},b0={noDecls:m({alias:"d",desc:"Don't emit framework decls"})},X0={pretty:m({alias:"p",desc:"Pretty print output"})},_0={noHeader:m({desc:"Don't emit generated header comment"})},O8={watch:m({alias:"w",desc:"Watch input files for changes"})};import{resolve as I4} from"path";var J0=(Z,X,J)=>{X=F(X)?X:X.join("\n"),Z?p0(I4(Z),X,J):console.log(X)},L0=({info:{name:Z,version:X}})=>`/*! ${Z} v${X} - generated by thi.ng/meta-css @ ${(new Date()).toISOString()} */`;var G8={desc:"Transpile & bundle meta stylesheets to CSS",opts:{...w8,...v0,...b0,...X0,..._0,...O8,eval:a({alias:"e",desc:"eval meta stylesheet in given string (ignores other inputs & includes)"}),force:t({alias:"f",hint:"STR",desc:"CSS classes to force include (wildcards are supported, @-prefix will read from file)",delim:","})},fn:async(Z)=>{const X=L(Q0(Z.opts.specs),Z.logger),J=b4(X,Z.opts.force||[],Z.logger);if(Z.opts.watch)await A4(Z,X,J);else if(Z.opts.eval)U1(Z,X,J,[Z.opts.eval]);else U1(Z,X,J,Z.inputs.map((W)=>A(Q0(W),Z.logger)))}},A4=async(Z,X,J)=>{let W=!0;const Y=()=>{Z.logger.info("closing watchers..."),B.forEach((U)=>U.watcher.close()),W=!1},B=Z.inputs.map((U,V)=>{U=Q0(U);const Q=q8(A(U,Z.logger),{id:`in${N8(V)}`});return{input:Q,watcher:R4(U,{},(q)=>{if(q==="change")try{Q.next(A(U,Z.logger))}catch(z){Z.logger.warn(z.message),Y()}else Z.logger.warn("input removed:",U),Y()})}});F8({src:Z1(N(({input:U})=>[U.id,U],B))}).subscribe({next(U){try{U1(Z,X,J,Object.keys(U).sort().map((V)=>U[V]))}catch(V){Z.logger.warn(V.message)}}}),process.on("SIGINT",Y);while(W)await g1(null,250)},U1=({logger:Z,opts:{include:X,noDecls:J,noHeader:W,out:Y,pretty:B}},U,V,Q)=>{const q={logger:Z,specs:U,format:B?U0:g,mediaQueryIDs:new Set(Object.keys(U.media)),mediaQueryRules:{...V.mediaQueryRules},plainRules:{...V.plainRules}},z=X?X.map(($)=>A(Q0($),Z).trim()):[];if(!W)z.push(L0(U));if(!J&&U.decls.length)z.push(n(U.decls,{format:q.format}));Q.forEach(($)=>_4($,q)),v4(z,q),E4(z,q),J0(Y,z,Z)},E4=(Z,{logger:X,specs:J,format:W,mediaQueryRules:Y})=>{for(let B in Y){const U=k8(Y[B],J);X.debug("mediaquery rules",B,U),Z.push(n(E0(y4(J.media,B),U),{format:W}))}},v4=(Z,{logger:X,specs:J,format:W,plainRules:Y})=>{const B=k8(Y,J);X.debug("plain rules",B),Z.push(n(B,{format:W}))},b4=(Z,X,J)=>{const W=new Set(Object.keys(Z.media)),Y=new Set(Object.keys(Z.classes)),B={},U={};if(X.length&&X[0][0]==="@")X=[...u(A(Q0(X[0].substring(1)),J))];for(let V of X){if(!V||V.startsWith("//"))continue;const{token:Q,query:q}=T8(V,W);let z;if(Q.includes("*")){const $=new RegExp(`^${Q.replace("*",".*")}\$`);z=[...B1((K)=>$.test(K),Y)]}else if(Y.has(Q))z=[Q];else{J.warn(`unknown include rule ID: ${V}, skipping...`);continue}for(let $ of z)J.debug("including class:",$),q?I8(B,q,`.${$}`,$):R8(U,`.${$}`,$)}return{mediaQueryRules:B,plainRules:U}},_4=(Z,{specs:X,mediaQueryIDs:J,mediaQueryRules:W,plainRules:Y})=>{const B=V0(),U=V0(B),V={root:B,curr:U,scopes:[U]};for(let Q of u(Z)){if(!Q||/^\s*\/\//.test(Q))continue;for(let q of u(Q,/\s+/g)){if(!q)continue;let z=V.curr;switch(z.state){case"sel":case"nest":if(q==="{"){if(z.state==="sel")z.sel=z.sel.map(($)=>$.replace(",","")),z.path=L4(V.scopes);z.state="class"}else if(q==="}")D8(V);else{const $=B0(z.sel);if(!$||$.endsWith(","))z.sel.push(q);else z.sel[z.sel.length-1]+=" "+q}break;case"class":if(q==="{")z.state="nest",V.scopes.push(V.curr=V0(z));else if(q==="}")D8(V);else{let{token:$,query:K}=T8(q,J);if(!X.classes[$])H(`unknown class ID: ${$}`);if(K)I8(W,K,z.path,$);else R8(Y,z.path,$)}break;default:r(z.state)}}}},V1=":",j8="///",V0=(Z)=>({state:"sel",sel:Z?[]:["<root>"],path:"",parent:Z}),D8=(Z)=>{const X=!Z.curr.sel.length;if(N0(!!Z.curr.parent,"stack underflow"),Z.scopes.pop(),Z.scopes.length>0){if(Z.curr=B0(Z.scopes),!X&&Z.curr.state==="nest")Z.scopes.push(Z.curr=V0(Z.curr))}else Z.scopes.push(Z.curr=V0(Z.root))},L4=(Z)=>Z.map((X)=>X.sel.join(",")).join(j8),k8=(Z,X)=>Object.entries(Z).map(([J,W])=>S4(J,W,X)),S4=(Z,X,J)=>{const W=[];let Y=W;const B=Z.split(j8);for(let U=0;U<B.length;U++){const V=B[U].split(",");if(U==B.length-1){const Q=Object.assign({},...N((q)=>J.classes[q],X));if("__user"in Q)delete Q.__user;V.push(Q)}Y.push(V),Y=V}return W[0]},T8=(Z,X)=>{if(/^::?/.test(Z))return{token:Z};const J=Z.lastIndexOf(V1);if(J<0)return{token:Z};const W=Z.substring(0,J);if(!W.split(V1).every((B)=>X.has(B)))H(`invalid media query in token: ${Z}`);return{token:Z.substring(J+1),query:W}},y4=(Z,X)=>X.split(V1).reduce((J,W)=>Object.assign(J,Z[W]),{}),I8=(Z,X,J,W)=>{if(!Z[X])Z[X]={};(Z[X][J]||(Z[X][J]=new Set)).add(W)},R8=(Z,X,J)=>(Z[X]||(Z[X]=new Set)).add(J);import{resolve as A8} from"path";var v8={desc:"Export entire generated framework as CSS",opts:{...v0,...b0,...X0,..._0,media:t({alias:"m",hint:"ID",desc:"Media query IDs (use 'ALL' for all)",delim:","})},inputs:1,fn:async(Z)=>{const{logger:X,opts:{include:J,media:W,noDecls:Y,noHeader:B,pretty:U,out:V},inputs:Q}=Z,q=L(A8(Q[0]),X),z=J?J.map(($)=>A(A8($),X).trim()):[];if(!B)z.push(L0(q));if(!Y&&q.decls.length)z.push(n(q.decls,{format:U?U0:g}));z.push(h4(q,W,U,X)),J0(V,z,X)}},h4=(Z,X,J,W)=>{const Y=E8("",Z);if(X){const B=X[0]==="ALL"?Object.keys(Z.media):X;for(let U of B)if(Z.media[U])Y.push(E0(Z.media[U],E8("-"+U,Z)));else W.warn(`invalid media query ID: ${U}, skipping...`)}return n(Y,{format:J?U0:g})},E8=(Z,X)=>Object.entries(X.classes).map(([J,W])=>[`.${J}${Z}`,f4(W)]),f4=(Z)=>{if("__user"in Z)Z={...Z},delete Z.__user;return Z};import{statSync as m4} from"fs";import{resolve as u4} from"path";var b8={deg:U8,em:c1,ex:r1,ms:Y8,percent:e0,px:e1,rad:V8,rem:s1,second:B8,turn:Q8,url:z8,vh:Z8,vmax:W8,vmin:J8,vw:X8,"%":e0},g4={"":[""],a:[""],h:["-left","-right"],v:["-top","-bottom"],t:["-top"],top:["top"],b:["-bottom"],bottom:["bottom"],r:["-right"],right:["right"],l:["-left"],left:["left"],x:["-x"],y:["-y"]},_8={desc:"Generate framework rules from specs",opts:{...X0,prec:M1({default:3,desc:"Number of fractional digits"})},inputs:1,fn:async(Z)=>{const{logger:X,opts:{prec:J,out:W,pretty:Y},inputs:B}=Z,U=u4(B[0]);if(!m4(U).isDirectory())H(`${U} is not a directory`);const V={info:{name:"TODO",version:"0.0.0"},media:{},classes:{},decls:[]};t1(J);for(let Q of y1(U,".json")){const q=L(Q,X);if(Object.assign(V.info,q.info),Object.assign(V.media,q.media),q.decls)V.decls.push(...q.decls);for(let z of q.specs)x4(q,z,V.classes,X)}J0(W,JSON.stringify(V,null,Y?4:0),X)}},x4=(Z,X,J,W)=>{const Y=P(X.var)?X.var:[""],B=F(X.props)?{[X.props]:"<v>"}:X.props,U=d4(X,Z),V=new Set;for(let Q of Y)for(let[q,z]of I0(Z.vars?.[Q]||g4[Q],Object.keys(U))){const $=z0(X.name,Q,q,z,U[z]),K=X.unit?z0(X.unit,Q,q,z,U[z]):void 0,v=n4(U[z],K);if(!J[$])J[$]=X.user!=null?{__user:z0(X.user,Q,q,z,U[z])}:{};else if(!V.has($))H(`duplicate class ID: ${$}`);V.add($);for(let[p,b]of Object.entries(B)){const M=z0(p,Q,q,z,U[z]),_=z0(!K||F(b)?String(b):b8[K](b),Q,q,z,v);J[$][M]=_,W.debug($,M,_)}}return J},d4=(Z,X)=>{const J=F(Z.values)?X.tables?.[Z.values]||H(`invalid table ID: ${Z.values}`):Z.values;if(R(J))return J;const W=Z.key==="v"?(Y)=>String(Y):Z.key==="i1"?(Y,B)=>String(B+1):Z.key===void 0?(Y,B)=>String(B):H(`invalid key type: ${Z.key}`);return J.reduce((Y,B,U)=>{return Y[W(B,U)]=B,Y},{})},n4=(Z,X)=>{if(!X||F(Z))return Z;const J=b8[X];if(!J)H(`invalid unit: ${X}`);return J(Z)},z0=(Z,X,J,W,Y)=>Z.replace("<vid>",X).replace("<var>",J).replace("<k>",W).replace("<v>",String(Y));var Q1=L(l4(import.meta.dir,"package.json"));_1({name:"metacss",opts:{out:a({alias:"o",desc:"Output file (or stdout)"}),verbose:m({alias:"v",desc:"Display extra process information"})},commands:{convert:G8,export:v8,generate:_8},ctx:async(Z)=>{if(Z.opts.verbose)Z.logger.level=C.DEBUG;return{...Z,format:M0}},usage:{prefix:`
|
|
6
6
|
\u2588 \u2588 \u2588 \u2502
|
|
7
7
|
\u2588\u2588 \u2588 \u2502
|
|
8
|
-
\u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 ${
|
|
9
|
-
\u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 ${
|
|
8
|
+
\u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 ${Q1.name} ${Q1.version}
|
|
9
|
+
\u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 ${Q1.description}
|
|
10
10
|
\u2588 \u2502
|
|
11
11
|
\u2588 \u2588 \u2502
|
|
12
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/meta-css",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Data-driven CSS framework codegen, transpiler & bundler",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@thi.ng/api": "^8.9.14",
|
|
42
|
-
"@thi.ng/args": "^2.3.
|
|
42
|
+
"@thi.ng/args": "^2.3.2",
|
|
43
43
|
"@thi.ng/arrays": "^2.7.11",
|
|
44
44
|
"@thi.ng/checks": "^3.4.14",
|
|
45
45
|
"@thi.ng/compose": "^2.1.53",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"status": "alpha",
|
|
106
106
|
"year": 2023
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "f156d361a652cce316c36e0b7df7d2ac5c2dbbf8\n"
|
|
109
109
|
}
|
package/specs/a11y.json
ADDED
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
package/specs/borders.json
CHANGED
|
@@ -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
|
}
|
package/specs/dimensions.json
CHANGED
|
@@ -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,
|
|
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": "
|
|
11
|
-
"name": "
|
|
15
|
+
"user": "<var>",
|
|
16
|
+
"name": "<vid><k>",
|
|
12
17
|
"key": "i1",
|
|
13
|
-
"props": "
|
|
18
|
+
"props": "<var>",
|
|
14
19
|
"values": "sizes-abs",
|
|
15
|
-
"unit": "rem"
|
|
20
|
+
"unit": "rem",
|
|
21
|
+
"var": ["w", "h"]
|
|
16
22
|
},
|
|
17
23
|
{
|
|
18
|
-
"user": "
|
|
19
|
-
"name": "
|
|
20
|
-
"props": "
|
|
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": "
|
|
26
|
-
"name": "
|
|
32
|
+
"user": "min. <var>",
|
|
33
|
+
"name": "min<vid><k>",
|
|
27
34
|
"key": "i1",
|
|
28
|
-
"props": "
|
|
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": "
|
|
34
|
-
"name": "
|
|
35
|
-
"props": "
|
|
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": "
|
|
41
|
-
"name": "
|
|
49
|
+
"user": "max. <var>",
|
|
50
|
+
"name": "max<vid><k>",
|
|
42
51
|
"key": "i1",
|
|
43
|
-
"props": "
|
|
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": "
|
|
49
|
-
"name": "
|
|
50
|
-
"props": "
|
|
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
|
}
|
package/specs/display.json
CHANGED
package/specs/grids.json
ADDED
|
@@ -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
|
+
}
|
package/specs/icons.json
ADDED
|
@@ -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,156 @@
|
|
|
1
|
+
{
|
|
2
|
+
"decls": [
|
|
3
|
+
[":root", { "font-size": "16px" }],
|
|
4
|
+
["html", { "line-height": 1.15, "-webkit-text-size-adjust": "100%" }],
|
|
5
|
+
["body", { "margin": 0 }],
|
|
6
|
+
["h1", { "font-size": "2em", "margin": "0.67em 0" }],
|
|
7
|
+
[
|
|
8
|
+
"hr",
|
|
9
|
+
{
|
|
10
|
+
"-webkit-box-sizing": "content-box",
|
|
11
|
+
"box-sizing": "content-box",
|
|
12
|
+
"height": 0,
|
|
13
|
+
"overflow": "visible"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
["a", { "background-color": "transparent" }],
|
|
17
|
+
[
|
|
18
|
+
"abbr[title]",
|
|
19
|
+
{
|
|
20
|
+
"border-bottom": "none",
|
|
21
|
+
"text-decoration": "underline dotted"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
["b", "strong", { "font-weight": "bolder" }],
|
|
25
|
+
[
|
|
26
|
+
"code",
|
|
27
|
+
"kbd",
|
|
28
|
+
"samp",
|
|
29
|
+
{ "font-family": "monospace", "font-size": "1em" }
|
|
30
|
+
],
|
|
31
|
+
["small", { "font-size": "80%" }],
|
|
32
|
+
[
|
|
33
|
+
"sub",
|
|
34
|
+
"sup",
|
|
35
|
+
{
|
|
36
|
+
"font-size": "75%",
|
|
37
|
+
"line-height": 0,
|
|
38
|
+
"position": "relative",
|
|
39
|
+
"vertical-align": "baseline"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
["sub", { "bottom": "-0.25em" }],
|
|
43
|
+
["sup", { "top": "-0.5em" }],
|
|
44
|
+
["img", { "border-style": "none" }],
|
|
45
|
+
[
|
|
46
|
+
"button",
|
|
47
|
+
"input",
|
|
48
|
+
"optgroup",
|
|
49
|
+
"select",
|
|
50
|
+
"textarea",
|
|
51
|
+
{
|
|
52
|
+
"font-family": "inherit",
|
|
53
|
+
"font-size": "100%",
|
|
54
|
+
"line-height": 1.15,
|
|
55
|
+
"margin": 0
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
["button", "input", { "overflow": "visible" }],
|
|
59
|
+
["button", "select", { "text-transform": "none" }],
|
|
60
|
+
[
|
|
61
|
+
"button",
|
|
62
|
+
"[type=\"button\"]",
|
|
63
|
+
"[type=\"reset\"]",
|
|
64
|
+
"[type=\"submit\"]",
|
|
65
|
+
{ "-webkit-appearance": "button" },
|
|
66
|
+
["::-moz-focus-inner", { "border-style": "none", "padding": 0 }],
|
|
67
|
+
[":-moz-focusring", { "outline": "1px dotted ButtonText" }]
|
|
68
|
+
],
|
|
69
|
+
["fieldset", { "padding": "0.35em 0.75em 0.625em" }],
|
|
70
|
+
[
|
|
71
|
+
"legend",
|
|
72
|
+
{
|
|
73
|
+
"display": "table",
|
|
74
|
+
"max-width": "100%",
|
|
75
|
+
"padding": 0,
|
|
76
|
+
"white-space": "normal"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
["progress", { "vertical-align": "baseline" }],
|
|
80
|
+
["textarea", { "overflow": "auto" }],
|
|
81
|
+
["[type=\"checkbox\"]", "[type=\"radio\"]", { "padding": 0 }],
|
|
82
|
+
[
|
|
83
|
+
"[type=\"number\"]",
|
|
84
|
+
[
|
|
85
|
+
"::-webkit-inner-spin-button",
|
|
86
|
+
"::-webkit-outer-spin-button",
|
|
87
|
+
{ "height": "auto" }
|
|
88
|
+
]
|
|
89
|
+
],
|
|
90
|
+
[
|
|
91
|
+
"[type=\"search\"]",
|
|
92
|
+
{
|
|
93
|
+
"-webkit-appearance": "textfield",
|
|
94
|
+
"outline-offset": "-2px"
|
|
95
|
+
},
|
|
96
|
+
["::-webkit-search-decoration", { "-webkit-appearance": "none" }]
|
|
97
|
+
],
|
|
98
|
+
[
|
|
99
|
+
"::-webkit-file-upload-button",
|
|
100
|
+
{
|
|
101
|
+
"-webkit-appearance": "button",
|
|
102
|
+
"font": "inherit"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
["details", { "display": "block" }],
|
|
106
|
+
["summary", { "display": "list-item" }],
|
|
107
|
+
["[hidden]", "template", { "display": "none" }],
|
|
108
|
+
[
|
|
109
|
+
"html",
|
|
110
|
+
"legend",
|
|
111
|
+
"input",
|
|
112
|
+
"textarea",
|
|
113
|
+
"[type=\"checkbox\"]",
|
|
114
|
+
"[type=\"date\"]",
|
|
115
|
+
"[type=\"datetime-local\"]",
|
|
116
|
+
"[type=\"file\"]",
|
|
117
|
+
"[type=\"radio\"]",
|
|
118
|
+
"[type=\"search\"]",
|
|
119
|
+
{ "box-sizing": "border-box", "-webkit-box-sizing": "border-box" }
|
|
120
|
+
],
|
|
121
|
+
["*", ":before", ":after", { "box-sizing": "inherit" }],
|
|
122
|
+
["html", "body", { "min-height": "100%" }],
|
|
123
|
+
["img", { "max-width": "100%", "height": "auto" }],
|
|
124
|
+
[
|
|
125
|
+
"blockquote",
|
|
126
|
+
"caption",
|
|
127
|
+
"cite",
|
|
128
|
+
"dd",
|
|
129
|
+
"dl",
|
|
130
|
+
"dt",
|
|
131
|
+
"fieldset",
|
|
132
|
+
"figcaption",
|
|
133
|
+
"h1",
|
|
134
|
+
"h2",
|
|
135
|
+
"h3",
|
|
136
|
+
"h4",
|
|
137
|
+
"h5",
|
|
138
|
+
"h6",
|
|
139
|
+
"hr",
|
|
140
|
+
"input",
|
|
141
|
+
"label",
|
|
142
|
+
"legend",
|
|
143
|
+
"ol",
|
|
144
|
+
"ol li",
|
|
145
|
+
"p",
|
|
146
|
+
"progress",
|
|
147
|
+
"table",
|
|
148
|
+
"textarea",
|
|
149
|
+
"ul",
|
|
150
|
+
"ul li",
|
|
151
|
+
[":first-child", { "margin-top": 0 }],
|
|
152
|
+
[":last-child", { "margin-bottom": 0 }]
|
|
153
|
+
]
|
|
154
|
+
],
|
|
155
|
+
"specs": []
|
|
156
|
+
}
|
package/specs/positions.json
CHANGED
|
@@ -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
|
+
}
|
package/specs/typography.json
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
"tables": {
|
|
3
3
|
"families": {
|
|
4
4
|
"system": "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'",
|
|
5
|
+
"system-sans-serif": "sans-serif",
|
|
6
|
+
"system-serif": "serif",
|
|
5
7
|
"sans-serif": "'Helvetica Neue', Helvetica, Arial, sans-serif",
|
|
6
8
|
"serif": "Georgia, 'Times New Roman', Times, serif",
|
|
7
9
|
"monospace": "Monaco, Menlo, Consolas, 'Courier New', monospace"
|
|
@@ -28,9 +30,10 @@
|
|
|
28
30
|
"name": "f-<k>",
|
|
29
31
|
"props": "font-size",
|
|
30
32
|
"values": {
|
|
31
|
-
"title":
|
|
32
|
-
"subtitle":
|
|
33
|
-
}
|
|
33
|
+
"title": 6,
|
|
34
|
+
"subtitle": 5
|
|
35
|
+
},
|
|
36
|
+
"unit": "rem"
|
|
34
37
|
},
|
|
35
38
|
{
|
|
36
39
|
"user": "font weights",
|
|
@@ -49,11 +52,16 @@
|
|
|
49
52
|
},
|
|
50
53
|
{
|
|
51
54
|
"user": "font variants",
|
|
52
|
-
"name": "<
|
|
53
|
-
"key": "v",
|
|
55
|
+
"name": "<v>",
|
|
54
56
|
"props": "font-variant",
|
|
55
57
|
"values": ["small-caps"]
|
|
56
58
|
},
|
|
59
|
+
{
|
|
60
|
+
"user": "font style",
|
|
61
|
+
"name": "<v>",
|
|
62
|
+
"props": "font-style",
|
|
63
|
+
"values": ["italic"]
|
|
64
|
+
},
|
|
57
65
|
{
|
|
58
66
|
"user": "text decorations",
|
|
59
67
|
"name": "<k>",
|
|
@@ -94,6 +102,7 @@
|
|
|
94
102
|
"name": "v-<k>",
|
|
95
103
|
"props": "vertical-align",
|
|
96
104
|
"values": {
|
|
105
|
+
"base": "baseline",
|
|
97
106
|
"btm": "bottom",
|
|
98
107
|
"mid": "middle",
|
|
99
108
|
"top": "top"
|
|
@@ -104,6 +113,7 @@
|
|
|
104
113
|
"name": "lh-<k>",
|
|
105
114
|
"props": "line-height",
|
|
106
115
|
"values": {
|
|
116
|
+
"0": 0,
|
|
107
117
|
"solid": 1,
|
|
108
118
|
"title": 1.25,
|
|
109
119
|
"copy": 1.5,
|
package/specs/grid.json
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"tables": {
|
|
3
|
-
"cols-rows": [
|
|
4
|
-
"1fr",
|
|
5
|
-
"1fr 1fr",
|
|
6
|
-
"1fr 1fr 1fr",
|
|
7
|
-
"repeat(4,1fr)",
|
|
8
|
-
"repeat(5,1fr)",
|
|
9
|
-
"repeat(6,1fr)",
|
|
10
|
-
"repeat(7,1fr)",
|
|
11
|
-
"repeat(8,1fr)",
|
|
12
|
-
"repeat(9,1fr)",
|
|
13
|
-
"repeat(10,1fr)"
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
"specs": [
|
|
17
|
-
{
|
|
18
|
-
"user": "grid layout",
|
|
19
|
-
"name": "gc<k>",
|
|
20
|
-
"key": "i1",
|
|
21
|
-
"props": "grid-template-columns",
|
|
22
|
-
"values": "cols-rows"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"user": "grid layout",
|
|
26
|
-
"name": "gr<k>",
|
|
27
|
-
"key": "i1",
|
|
28
|
-
"props": "grid-template-rows",
|
|
29
|
-
"values": "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
|
-
}
|
package/specs/shadow.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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": "shadow-<k>",
|
|
14
|
-
"key": "i1",
|
|
15
|
-
"props": "box-shadow",
|
|
16
|
-
"values": "shadows"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"user": "shadow",
|
|
20
|
-
"name": "i-shadow-<k>",
|
|
21
|
-
"key": "i1",
|
|
22
|
-
"props": { "box-shadow": "<v> inset" },
|
|
23
|
-
"values": "shadows"
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
}
|
|
File without changes
|