@thi.ng/meta-css 0.5.1 → 0.6.1
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 +21 -1
- package/README.md +106 -56
- package/index.js +6 -6
- package/package.json +14 -15
- package/specs/anim.mcss.json +27 -4
- package/specs/aspect.mcss.json +29 -7
- package/specs/colors.mcss.json +12 -12
- package/specs/content.mcss.json +10 -0
- package/specs/dimensions.mcss.json +1 -0
- package/specs/display.mcss.json +13 -13
- package/specs/flex.mcss.json +39 -0
- package/specs/grids.mcss.json +6 -6
- package/specs/margins.mcss.json +21 -1
- package/specs/normalize.mcss.json +1 -0
- package/specs/print.mcss.json +25 -0
- package/specs/scroll.mcss.json +24 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**:
|
|
3
|
+
- **Last updated**: 2024-01-26T18:03:04Z
|
|
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,26 @@ 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.6.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.6.1) (2024-01-26)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- update file watchers ([bb4d661](https://github.com/thi-ng/umbrella/commit/bb4d661))
|
|
17
|
+
|
|
18
|
+
## [0.6.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.6.0) (2024-01-23)
|
|
19
|
+
|
|
20
|
+
#### 🚀 Features
|
|
21
|
+
|
|
22
|
+
- update .mcss syntax, support var assignments ([468c9c5](https://github.com/thi-ng/umbrella/commit/468c9c5))
|
|
23
|
+
- update syntax to support `varname=value` assignments (incl. media prefixes)
|
|
24
|
+
- add tests
|
|
25
|
+
- add --only-decls option for export cmd ([ef8ef65](https://github.com/thi-ng/umbrella/commit/ef8ef65))
|
|
26
|
+
- update/add/rename commands ([3628c4c](https://github.com/thi-ng/umbrella/commit/3628c4c))
|
|
27
|
+
- rename `convert` => `bundle`
|
|
28
|
+
- add new `convert` command to transpile individual stylesheets
|
|
29
|
+
- update CLI arg specs/re-use
|
|
30
|
+
- merge bundle & convert cmds ([a2187cb](https://github.com/thi-ng/umbrella/commit/a2187cb))
|
|
31
|
+
|
|
12
32
|
### [0.5.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.5.1) (2023-12-31)
|
|
13
33
|
|
|
14
34
|
#### ♻️ Refactoring
|
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@ anti-framework.
|
|
|
22
22
|
- [Properties](#properties)
|
|
23
23
|
- [Key value generation](#key-value-generation)
|
|
24
24
|
- [Media query definitions](#media-query-definitions)
|
|
25
|
+
- [Custom declarations](#custom-declarations)
|
|
25
26
|
- [Converting meta stylesheets to CSS](#converting-meta-stylesheets-to-css)
|
|
26
27
|
- [Meta-stylesheets syntax](#meta-stylesheets-syntax)
|
|
27
28
|
- [Class identifiers & media query prefixes](#class-identifiers--media-query-prefixes)
|
|
@@ -79,10 +80,11 @@ parametric JSON rule specs. This process generates all desired, combinatorial
|
|
|
79
80
|
versions of various rules/declarations and exports them to a framework JSON file
|
|
80
81
|
used as intermediary stage for the other commands provided by this toolchain.
|
|
81
82
|
The [syntax/format of the generator rules](#framework-generation-specs--syntax)
|
|
82
|
-
is explained further on. These
|
|
83
|
-
for better handling, can define [
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
is explained further on. These framework specs can be split up into multiple
|
|
84
|
+
files for better handling and organization, can define [CSS base
|
|
85
|
+
declarations](#custom-declarations) (e.g. for normalization purposes),
|
|
86
|
+
[arbitrary media query criteria](#media-query-definitions) (all later
|
|
87
|
+
combinable), shared lookup tables for colors, margins, sizes, timings etc.
|
|
86
88
|
|
|
87
89
|
The package includes dozens of generator specs for a basic, fully customizable,
|
|
88
90
|
Tachyons-derived [CSS framework](#bundled-css-base-framework). These specs and
|
|
@@ -457,16 +459,37 @@ ALWAYS combined using `and`:
|
|
|
457
459
|
See [media queries in the bundled base
|
|
458
460
|
specs](https://github.com/thi-ng/umbrella/blob/982fff7bfcc48f108b6ad88f854ef00be4078510/packages/meta-css/specs/_info.json#L6-L24)
|
|
459
461
|
|
|
462
|
+
### Custom declarations
|
|
463
|
+
|
|
464
|
+
Each of the JSON spec files can provide fixed CSS declarations via the `decls`
|
|
465
|
+
key. These declarations are to be given in
|
|
466
|
+
[thi.ng/hiccup-css](https://github.com/thi-ng/umbrella/blob/develop/packages/hiccup-css/)
|
|
467
|
+
format and are passed as is to the CSS serializer used by the `convert` and
|
|
468
|
+
`export` commands. Please see
|
|
469
|
+
[`/specs/normalize.mcss.json`](https://github.com/thi-ng/umbrella/blob/develop/packages/meta-css/specs/normalize.mcss.json)
|
|
470
|
+
for examples and the [thi.ng/hiccup-css
|
|
471
|
+
readme](https://github.com/thi-ng/umbrella/blob/develop/packages/hiccup-css/README.md)
|
|
472
|
+
for detailed reference.
|
|
473
|
+
|
|
474
|
+
```json
|
|
475
|
+
{
|
|
476
|
+
"decls": [
|
|
477
|
+
[":root", { "font-size": "16px" }],
|
|
478
|
+
["*", { "margin": 0 }]
|
|
479
|
+
]
|
|
480
|
+
}
|
|
481
|
+
```
|
|
482
|
+
|
|
460
483
|
## Converting meta stylesheets to CSS
|
|
461
484
|
|
|
462
485
|
The `convert` command is used to compile & bundle actual CSS from user-provided
|
|
463
|
-
MetaCSS stylesheets (
|
|
486
|
+
MetaCSS stylesheets (`.mcss` files) and the JSON framework specs created by the
|
|
464
487
|
`generate` command. The meta-stylesheets support any CSS selectors, are nestable
|
|
465
488
|
and compose full CSS declarations from lists of the utility classes in the
|
|
466
489
|
generated framework.
|
|
467
490
|
|
|
468
491
|
Each item (aka utility class name) can be prefixed with an arbitrary number of
|
|
469
|
-
media query IDs (also custom defined in the framework): e.g. `dark:bg-black`
|
|
492
|
+
media query IDs (also custom defined in the framework): e.g. `dark:bg-color-black`
|
|
470
493
|
might refer to a CSS class to set a black ground, with the `dark:` prefix
|
|
471
494
|
referring to a defined media query which only applies this class when dark mode
|
|
472
495
|
is enabled...
|
|
@@ -477,8 +500,7 @@ rules** and can be generated in minified or pretty printed formats (it's also
|
|
|
477
500
|
possible to [force include CSS classes which are otherwise
|
|
478
501
|
unreferenced](#force-inclusion-of-unreferenced-classes)). Additionally, multiple
|
|
479
502
|
`.mcss` stylesheets can be watched for changes (their definitions getting
|
|
480
|
-
merged), and existing CSS files can be included (prepended) in the
|
|
481
|
-
output too.
|
|
503
|
+
merged), and existing CSS files can be included (prepended) in the output(s) too.
|
|
482
504
|
|
|
483
505
|
```text
|
|
484
506
|
metacss convert --help
|
|
@@ -487,8 +509,10 @@ Usage: metacss convert [opts] input [...]
|
|
|
487
509
|
|
|
488
510
|
Flags:
|
|
489
511
|
|
|
512
|
+
-b, --bundle Bundle inputs (see `out` option)
|
|
490
513
|
-d, --no-decls Don't emit framework decls
|
|
491
514
|
--no-header Don't emit generated header comment
|
|
515
|
+
--no-write Don't write files, use stdout only
|
|
492
516
|
-p, --pretty Pretty print output
|
|
493
517
|
-v, --verbose Display extra process information
|
|
494
518
|
-w, --watch Watch input files for changes
|
|
@@ -504,6 +528,16 @@ Main:
|
|
|
504
528
|
-s STR, --specs STR [required] Path to generated JSON defs
|
|
505
529
|
```
|
|
506
530
|
|
|
531
|
+
Notes:
|
|
532
|
+
|
|
533
|
+
- The `--no-write` flag is only used if `--bundle` is **disabled**
|
|
534
|
+
- The `--out` file arg is only used if `--bundle` is **enabled**
|
|
535
|
+
|
|
536
|
+
If bundling is disabled (default), each input `.mcss` file is converted
|
|
537
|
+
individually and results are written to the same directory, but using `.css` as
|
|
538
|
+
file extension (and unless `--no-write` is enabled). This behavior is intended
|
|
539
|
+
for local style definitions of web components.
|
|
540
|
+
|
|
507
541
|
### Meta-stylesheets syntax
|
|
508
542
|
|
|
509
543
|
As mentioned earlier, the `convert` command transpiles meta-stylesheets into
|
|
@@ -527,7 +561,7 @@ selector {
|
|
|
527
561
|
|
|
528
562
|
#### Class identifiers & media query prefixes
|
|
529
563
|
|
|
530
|
-
As indicated by the above file structure,
|
|
564
|
+
As indicated by the above file structure, `.mcss` stylesheets purely consist of
|
|
531
565
|
CSS selectors and the names of the utility classes defined in a generated framework.
|
|
532
566
|
For example, using the [bundled framework specs](#bundled-css-base-framework),
|
|
533
567
|
this simple meta-stylesheet `body { ma0 monospace blue }` creates a CSS rule for
|
|
@@ -549,7 +583,7 @@ class, and any utility class ID/token can be prefixed with any number of media
|
|
|
549
583
|
query IDs (separated by `:`). These [media queries are defined as part of the
|
|
550
584
|
framework generation specs](#media-query-definitions) and when used as a prefix,
|
|
551
585
|
multiple query IDs can be combined freely. For example, the meta-stylesheet
|
|
552
|
-
`a:hover { dark:bg-blue dark:anim:bg-anim2 }` will auto-create two separate CSS
|
|
586
|
+
`a:hover { dark:bg-color-blue dark:anim:bg-anim2 }` will auto-create two separate CSS
|
|
553
587
|
`@media`-query blocks for the query IDs `dark` and `(dark AND anim)`:
|
|
554
588
|
|
|
555
589
|
```css
|
|
@@ -575,21 +609,21 @@ body {
|
|
|
575
609
|
// no margins
|
|
576
610
|
ma0
|
|
577
611
|
// default colors
|
|
578
|
-
bg-white black
|
|
612
|
+
bg-color-white color-black
|
|
579
613
|
// colors for dark mode
|
|
580
|
-
dark:bg-black dark:white
|
|
614
|
+
dark:bg-color-black dark:color-white
|
|
581
615
|
}
|
|
582
616
|
|
|
583
617
|
#app { ma3 }
|
|
584
618
|
|
|
585
619
|
.bt-group-v > a {
|
|
586
620
|
db w-100 l:w-50 ph3 pv2 bwb1
|
|
587
|
-
dark:bg-purple dark:white dark:b--black
|
|
588
|
-
light:bg-light-blue light:black light:b--white
|
|
621
|
+
dark:bg-color-purple dark:color-white dark:b--color-black
|
|
622
|
+
light:bg-color-light-blue light:color-black light:b--color-white
|
|
589
623
|
|
|
590
624
|
// nested selectors
|
|
591
625
|
{
|
|
592
|
-
:hover { bg-gold black anim:bg-anim2 }
|
|
626
|
+
:hover { bg-color-gold color-black anim:bg-anim2 }
|
|
593
627
|
:first-child { brt3 }
|
|
594
628
|
:last-child { brb3 bwb0 }
|
|
595
629
|
}
|
|
@@ -737,23 +771,13 @@ framework generation aspects of this toolchain. This command merely takes an
|
|
|
737
771
|
existing generated framework JSON file and serializes it to a single CSS file,
|
|
738
772
|
e.g. to be then used with other CSS tooling (e.g. `postcss`).
|
|
739
773
|
|
|
740
|
-
### Media query variations
|
|
741
|
-
|
|
742
|
-
Users can choose to generate variations of all defined utility classes for any
|
|
743
|
-
of the framework-defined media query IDs. This will create additional suffixed
|
|
744
|
-
versions of all classes (with their appropriate media query wrappers) and cause
|
|
745
|
-
a potentially massive output (depending on the overall number/complexity of the
|
|
746
|
-
generated classes). Again, the idea is that the resulting CSS file will be
|
|
747
|
-
post-processed with 3rd party CSS tooling...
|
|
748
|
-
|
|
749
|
-
For example, if the framework contains a CSS class `w-50` (e.g. to set the width
|
|
750
|
-
to 50%) and media queries for different screen sizes (e.g. named `ns`, `l`),
|
|
751
|
-
then the export with said media queries will also generate classes `w-50-ns`
|
|
752
|
-
and `w-50-l` (incl. their corresponding `@media` wrappers).
|
|
753
|
-
|
|
754
774
|
As with the `convert` command, additional CSS files can also be included
|
|
755
775
|
(prepended) in the output file.
|
|
756
776
|
|
|
777
|
+
If the `--only-decls` option is used, **only** the [framework
|
|
778
|
+
declarations](#custom-declarations) but none of the generated utility classes
|
|
779
|
+
will be exported.
|
|
780
|
+
|
|
757
781
|
```text
|
|
758
782
|
metacss export --help
|
|
759
783
|
|
|
@@ -763,6 +787,7 @@ Flags:
|
|
|
763
787
|
|
|
764
788
|
-d, --no-decls Don't emit framework decls
|
|
765
789
|
--no-header Don't emit generated header comment
|
|
790
|
+
--only-decls Only emit framework decls
|
|
766
791
|
-p, --pretty Pretty print output
|
|
767
792
|
-v, --verbose Display extra process information
|
|
768
793
|
|
|
@@ -773,11 +798,25 @@ Main:
|
|
|
773
798
|
-o STR, --out STR Output file (or stdout)
|
|
774
799
|
```
|
|
775
800
|
|
|
801
|
+
### Media query variations
|
|
802
|
+
|
|
803
|
+
Users can choose to generate variations of all defined utility classes for any
|
|
804
|
+
of the framework-defined media query IDs. This will create additional suffixed
|
|
805
|
+
versions of all classes (with their appropriate media query wrappers) and cause
|
|
806
|
+
a potentially massive output (depending on the overall number/complexity of the
|
|
807
|
+
generated classes). Again, the idea is that the resulting CSS file will be
|
|
808
|
+
post-processed with 3rd party CSS tooling...
|
|
809
|
+
|
|
810
|
+
For example, if the framework contains a CSS class `w-50` (e.g. to set the width
|
|
811
|
+
to 50%) and media queries for different screen sizes (e.g. named `ns`, `l`),
|
|
812
|
+
then the export with said media queries will also generate classes `w-50-ns`
|
|
813
|
+
and `w-50-l` (incl. their corresponding `@media` wrappers).
|
|
814
|
+
|
|
776
815
|
## Bundled CSS base framework
|
|
777
816
|
|
|
778
|
-
The package includes a large number of useful specs in [/specs](https://github.com/thi-ng/umbrella/blob/develop/packages/meta-css/specs/). These are provided as starting point to define your custom framework(s)...
|
|
817
|
+
The package includes a large number of useful specs in [/specs](https://github.com/thi-ng/umbrella/blob/develop/packages/meta-css/specs/). These are readily usable, but also are provided as starting point to define your own custom framework(s)...
|
|
779
818
|
|
|
780
|
-
Currently
|
|
819
|
+
Currently, there are 940 CSS utility classes defined in MetaCSS base v0.0.1:
|
|
781
820
|
|
|
782
821
|
### Classes by category
|
|
783
822
|
|
|
@@ -787,11 +826,11 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
787
826
|
|
|
788
827
|
#### Animations / transitions <!-- notoc -->
|
|
789
828
|
|
|
790
|
-
`bg-anim1` / `bg-anim2` / `bg-anim3` / `fadein1` / `fadein2` / `fadein3`
|
|
829
|
+
`anim-alternate` / `anim-alternate-reverse` / `anim-normal` / `anim-reverse` / `bg-anim1` / `bg-anim2` / `bg-anim3` / `fadein1` / `fadein2` / `fadein3` / `fadeout1` / `fadeout2` / `fadeout3` / `spin1` / `spin2` / `spin3`
|
|
791
830
|
|
|
792
831
|
#### Aspect ratios <!-- notoc -->
|
|
793
832
|
|
|
794
|
-
`aspect-ratio-16x9` / `aspect-ratio-1x1` / `aspect-ratio-3x4` / `aspect-ratio-4x3` / `aspect-ratio-
|
|
833
|
+
`aspect-ratio-1x1` / `aspect-ratio-1x2` / `aspect-ratio-2x1` / `aspect-ratio-2x3` / `aspect-ratio-3x2` / `aspect-ratio-3x4` / `aspect-ratio-4x3` / `aspect-ratio-5x7` / `aspect-ratio-7x5` / `aspect-ratio-9x16` / `aspect-ratio-16x9` / `bg-aspect-ratio-1x1` / `bg-aspect-ratio-1x2` / `bg-aspect-ratio-2x1` / `bg-aspect-ratio-2x3` / `bg-aspect-ratio-3x2` / `bg-aspect-ratio-3x4` / `bg-aspect-ratio-4x3` / `bg-aspect-ratio-5x7` / `bg-aspect-ratio-7x5` / `bg-aspect-ratio-9x16` / `bg-aspect-ratio-16x9` / `bg-aspect-ratio-object`
|
|
795
834
|
|
|
796
835
|
#### Background <!-- notoc -->
|
|
797
836
|
|
|
@@ -799,15 +838,19 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
799
838
|
|
|
800
839
|
#### Border radius <!-- notoc -->
|
|
801
840
|
|
|
802
|
-
`
|
|
841
|
+
`br0` / `br1` / `br2` / `br3` / `br4` / `br-100` / `br-pill` / `brb0` / `brb1` / `brb2` / `brb3` / `brb4` / `brl0` / `brl1` / `brl2` / `brl3` / `brl4` / `brr0` / `brr1` / `brr2` / `brr3` / `brr4` / `brt0` / `brt1` / `brt2` / `brt3` / `brt4`
|
|
803
842
|
|
|
804
843
|
#### Border width <!-- notoc -->
|
|
805
844
|
|
|
806
|
-
`
|
|
845
|
+
`bw0` / `bw1` / `bw2` / `bw3` / `bw4` / `bw5` / `bw-1px` / `bwb0` / `bwb1` / `bwb2` / `bwb3` / `bwb4` / `bwb5` / `bwb-1px` / `bwl0` / `bwl1` / `bwl2` / `bwl3` / `bwl4` / `bwl5` / `bwl-1px` / `bwr0` / `bwr1` / `bwr2` / `bwr3` / `bwr4` / `bwr5` / `bwr-1px` / `bwt0` / `bwt1` / `bwt2` / `bwt3` / `bwt4` / `bwt5` / `bwt-1px`
|
|
807
846
|
|
|
808
847
|
#### Colors <!-- notoc -->
|
|
809
848
|
|
|
810
|
-
`b--black` / `b--blue` / `b--current` / `b--dark-blue` / `b--dark-gray` / `b--dark-green` / `b--dark-pink` / `b--dark-red` / `b--gold` / `b--gray` / `b--green` / `b--hot-pink` / `b--light-blue` / `b--light-gray` / `b--light-green` / `b--light-pink` / `b--light-purple` / `b--light-red` / `b--light-silver` / `b--light-yellow` / `b--lightest-blue` / `b--mid-gray` / `b--moon-gray` / `b--navy` / `b--near-black` / `b--near-white` / `b--orange` / `b--pink` / `b--purple` / `b--red` / `b--silver` / `b--transparent` / `b--
|
|
849
|
+
`b--color-black` / `b--color-blue` / `b--color-current` / `b--color-dark-blue` / `b--color-dark-gray` / `b--color-dark-green` / `b--color-dark-pink` / `b--color-dark-red` / `b--color-gold` / `b--color-gray` / `b--color-green` / `b--color-hot-pink` / `b--color-light-blue` / `b--color-light-gray` / `b--color-light-green` / `b--color-light-pink` / `b--color-light-purple` / `b--color-light-red` / `b--color-light-silver` / `b--color-light-yellow` / `b--color-lightest-blue` / `b--color-mid-gray` / `b--color-moon-gray` / `b--color-navy` / `b--color-near-black` / `b--color-near-white` / `b--color-orange` / `b--color-pink` / `b--color-purple` / `b--color-red` / `b--color-silver` / `b--color-transparent` / `b--color-washed-blue` / `b--color-washed-green` / `b--color-washed-red` / `b--color-washed-yellow` / `b--color-white` / `b--color-yellow` / `b--color1` / `b--color2` / `b--color3` / `b--color4` / `b--color5` / `b--color6` / `b--color7` / `b--color8` / `b--color9` / `b--color10` / `b--color11` / `b--color12` / `b--color13` / `b--color14` / `b--color15` / `b--color16` / `bg-color-black` / `bg-color-blue` / `bg-color-current` / `bg-color-dark-blue` / `bg-color-dark-gray` / `bg-color-dark-green` / `bg-color-dark-pink` / `bg-color-dark-red` / `bg-color-gold` / `bg-color-gray` / `bg-color-green` / `bg-color-hot-pink` / `bg-color-light-blue` / `bg-color-light-gray` / `bg-color-light-green` / `bg-color-light-pink` / `bg-color-light-purple` / `bg-color-light-red` / `bg-color-light-silver` / `bg-color-light-yellow` / `bg-color-lightest-blue` / `bg-color-mid-gray` / `bg-color-moon-gray` / `bg-color-navy` / `bg-color-near-black` / `bg-color-near-white` / `bg-color-orange` / `bg-color-pink` / `bg-color-purple` / `bg-color-red` / `bg-color-silver` / `bg-color-transparent` / `bg-color-washed-blue` / `bg-color-washed-green` / `bg-color-washed-red` / `bg-color-washed-yellow` / `bg-color-white` / `bg-color-yellow` / `bg-color1` / `bg-color2` / `bg-color3` / `bg-color4` / `bg-color5` / `bg-color6` / `bg-color7` / `bg-color8` / `bg-color9` / `bg-color10` / `bg-color11` / `bg-color12` / `bg-color13` / `bg-color14` / `bg-color15` / `bg-color16` / `color-black` / `color-blue` / `color-current` / `color-dark-blue` / `color-dark-gray` / `color-dark-green` / `color-dark-pink` / `color-dark-red` / `color-gold` / `color-gray` / `color-green` / `color-hot-pink` / `color-light-blue` / `color-light-gray` / `color-light-green` / `color-light-pink` / `color-light-purple` / `color-light-red` / `color-light-silver` / `color-light-yellow` / `color-lightest-blue` / `color-mid-gray` / `color-moon-gray` / `color-navy` / `color-near-black` / `color-near-white` / `color-orange` / `color-pink` / `color-purple` / `color-red` / `color-silver` / `color-transparent` / `color-washed-blue` / `color-washed-green` / `color-washed-red` / `color-washed-yellow` / `color-white` / `color-yellow` / `color1` / `color2` / `color3` / `color4` / `color5` / `color6` / `color7` / `color8` / `color9` / `color10` / `color11` / `color12` / `color13` / `color14` / `color15` / `color16` / `fill-color-black` / `fill-color-blue` / `fill-color-current` / `fill-color-dark-blue` / `fill-color-dark-gray` / `fill-color-dark-green` / `fill-color-dark-pink` / `fill-color-dark-red` / `fill-color-gold` / `fill-color-gray` / `fill-color-green` / `fill-color-hot-pink` / `fill-color-light-blue` / `fill-color-light-gray` / `fill-color-light-green` / `fill-color-light-pink` / `fill-color-light-purple` / `fill-color-light-red` / `fill-color-light-silver` / `fill-color-light-yellow` / `fill-color-lightest-blue` / `fill-color-mid-gray` / `fill-color-moon-gray` / `fill-color-navy` / `fill-color-near-black` / `fill-color-near-white` / `fill-color-orange` / `fill-color-pink` / `fill-color-purple` / `fill-color-red` / `fill-color-silver` / `fill-color-transparent` / `fill-color-washed-blue` / `fill-color-washed-green` / `fill-color-washed-red` / `fill-color-washed-yellow` / `fill-color-white` / `fill-color-yellow` / `fill-color1` / `fill-color2` / `fill-color3` / `fill-color4` / `fill-color5` / `fill-color6` / `fill-color7` / `fill-color8` / `fill-color9` / `fill-color10` / `fill-color11` / `fill-color12` / `fill-color13` / `fill-color14` / `fill-color15` / `fill-color16` / `o-0` / `o-10` / `o-20` / `o-30` / `o-40` / `o-50` / `o-60` / `o-70` / `o-80` / `o-90` / `o-100` / `stroke-color-black` / `stroke-color-blue` / `stroke-color-current` / `stroke-color-dark-blue` / `stroke-color-dark-gray` / `stroke-color-dark-green` / `stroke-color-dark-pink` / `stroke-color-dark-red` / `stroke-color-gold` / `stroke-color-gray` / `stroke-color-green` / `stroke-color-hot-pink` / `stroke-color-light-blue` / `stroke-color-light-gray` / `stroke-color-light-green` / `stroke-color-light-pink` / `stroke-color-light-purple` / `stroke-color-light-red` / `stroke-color-light-silver` / `stroke-color-light-yellow` / `stroke-color-lightest-blue` / `stroke-color-mid-gray` / `stroke-color-moon-gray` / `stroke-color-navy` / `stroke-color-near-black` / `stroke-color-near-white` / `stroke-color-orange` / `stroke-color-pink` / `stroke-color-purple` / `stroke-color-red` / `stroke-color-silver` / `stroke-color-transparent` / `stroke-color-washed-blue` / `stroke-color-washed-green` / `stroke-color-washed-red` / `stroke-color-washed-yellow` / `stroke-color-white` / `stroke-color-yellow` / `stroke-color1` / `stroke-color2` / `stroke-color3` / `stroke-color4` / `stroke-color5` / `stroke-color6` / `stroke-color7` / `stroke-color8` / `stroke-color9` / `stroke-color10` / `stroke-color11` / `stroke-color12` / `stroke-color13` / `stroke-color14` / `stroke-color15` / `stroke-color16`
|
|
850
|
+
|
|
851
|
+
#### Content <!-- notoc -->
|
|
852
|
+
|
|
853
|
+
`content-data-lang` / `content-href` / `content-id` / `content-name` / `content-slot` / `content-title`
|
|
811
854
|
|
|
812
855
|
#### Cursors <!-- notoc -->
|
|
813
856
|
|
|
@@ -815,7 +858,11 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
815
858
|
|
|
816
859
|
#### Display mode <!-- notoc -->
|
|
817
860
|
|
|
818
|
-
`db` / `
|
|
861
|
+
`db` / `di` / `dib` / `dif` / `dig` / `dn` / `dt` / `dtc` / `dtr` / `flex` / `grid`
|
|
862
|
+
|
|
863
|
+
#### Flex layout <!-- notoc -->
|
|
864
|
+
|
|
865
|
+
`align-content-center` / `align-content-end` / `align-content-start` / `flex-column` / `flex-column-reverse` / `flex-grow0` / `flex-grow1` / `flex-nowrap` / `flex-row` / `flex-row-reverse` / `flex-shrink0` / `flex-shrink1` / `flex-wrap` / `flex-wrap-reverse` / `justify-content-center` / `justify-content-end` / `justify-content-start`
|
|
819
866
|
|
|
820
867
|
#### Font families <!-- notoc -->
|
|
821
868
|
|
|
@@ -839,11 +886,11 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
839
886
|
|
|
840
887
|
#### Grid layout <!-- notoc -->
|
|
841
888
|
|
|
842
|
-
`align-items-center` / `align-items-end` / `align-items-start` / `align-items-stretch` / `align-self-center` / `align-self-end` / `align-self-start` / `align-self-stretch` / `
|
|
889
|
+
`align-items-center` / `align-items-end` / `align-items-start` / `align-items-stretch` / `align-self-center` / `align-self-end` / `align-self-start` / `align-self-stretch` / `gap0` / `gap1` / `gap2` / `gap3` / `gap4` / `gap5` / `gap-1px` / `gap-2px` / `gap-4px` / `gap-8px` / `grid-cols-1` / `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-cols-10` / `grid-rows-1` / `grid-rows-2` / `grid-rows-3` / `grid-rows-4` / `grid-rows-5` / `grid-rows-6` / `grid-rows-7` / `grid-rows-8` / `grid-rows-9` / `grid-rows-10` / `justify-items-center` / `justify-items-end` / `justify-items-start` / `justify-items-stretch` / `justify-self-center` / `justify-self-end` / `justify-self-start` / `justify-self-stretch`
|
|
843
890
|
|
|
844
891
|
#### Height <!-- notoc -->
|
|
845
892
|
|
|
846
|
-
`
|
|
893
|
+
`h1` / `h2` / `h3` / `h4` / `h5` / `h-10` / `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` / `h-100` / `vh-25` / `vh-50` / `vh-75` / `vh-100`
|
|
847
894
|
|
|
848
895
|
#### Icons <!-- notoc -->
|
|
849
896
|
|
|
@@ -851,7 +898,7 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
851
898
|
|
|
852
899
|
#### Letter spacing <!-- notoc -->
|
|
853
900
|
|
|
854
|
-
`ls
|
|
901
|
+
`ls-0` / `ls-1` / `ls-2` / `ls-3` / `ls--1` / `ls--2`
|
|
855
902
|
|
|
856
903
|
#### Line heights <!-- notoc -->
|
|
857
904
|
|
|
@@ -863,23 +910,23 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
863
910
|
|
|
864
911
|
#### Margin <!-- notoc -->
|
|
865
912
|
|
|
866
|
-
`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`
|
|
913
|
+
`center` / `ma0` / `ma1` / `ma2` / `ma3` / `ma4` / `ma5` / `mb0` / `mb1` / `mb2` / `mb3` / `mb4` / `mb5` / `mbe-0` / `mbe-1` / `mbe-2` / `mbe-3` / `mbe-4` / `mbe-5` / `mbs-0` / `mbs-1` / `mbs-2` / `mbs-3` / `mbs-4` / `mbs-5` / `mh0` / `mh1` / `mh2` / `mh3` / `mh4` / `mh5` / `ml0` / `ml1` / `ml2` / `ml3` / `ml4` / `ml5` / `mr0` / `mr1` / `mr2` / `mr3` / `mr4` / `mr5` / `mt0` / `mt1` / `mt2` / `mt3` / `mt4` / `mt5` / `mv0` / `mv1` / `mv2` / `mv3` / `mv4` / `mv5`
|
|
867
914
|
|
|
868
915
|
#### Max. height <!-- notoc -->
|
|
869
916
|
|
|
870
|
-
`
|
|
917
|
+
`maxh1` / `maxh2` / `maxh3` / `maxh4` / `maxh5` / `maxh-10` / `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` / `maxh-100`
|
|
871
918
|
|
|
872
919
|
#### Max. width <!-- notoc -->
|
|
873
920
|
|
|
874
|
-
`
|
|
921
|
+
`maxw1` / `maxw2` / `maxw3` / `maxw4` / `maxw5` / `maxw-10` / `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` / `maxw-100`
|
|
875
922
|
|
|
876
923
|
#### Min. height <!-- notoc -->
|
|
877
924
|
|
|
878
|
-
`
|
|
925
|
+
`minh1` / `minh2` / `minh3` / `minh4` / `minh5` / `minh-10` / `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` / `minh-100`
|
|
879
926
|
|
|
880
927
|
#### Min. width <!-- notoc -->
|
|
881
928
|
|
|
882
|
-
`
|
|
929
|
+
`minw1` / `minw2` / `minw3` / `minw4` / `minw5` / `minw-10` / `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` / `minw-100`
|
|
883
930
|
|
|
884
931
|
#### Overflow <!-- notoc -->
|
|
885
932
|
|
|
@@ -887,11 +934,19 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
887
934
|
|
|
888
935
|
#### Padding <!-- notoc -->
|
|
889
936
|
|
|
890
|
-
`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`
|
|
937
|
+
`pa0` / `pa1` / `pa2` / `pa3` / `pa4` / `pa5` / `pb0` / `pb1` / `pb2` / `pb3` / `pb4` / `pb5` / `pbe-0` / `pbe-1` / `pbe-2` / `pbe-3` / `pbe-4` / `pbe-5` / `pbs-0` / `pbs-1` / `pbs-2` / `pbs-3` / `pbs-4` / `pbs-5` / `ph0` / `ph1` / `ph2` / `ph3` / `ph4` / `ph5` / `pl0` / `pl1` / `pl2` / `pl3` / `pl4` / `pl5` / `pr0` / `pr1` / `pr2` / `pr3` / `pr4` / `pr5` / `pt0` / `pt1` / `pt2` / `pt3` / `pt4` / `pt5` / `pv0` / `pv1` / `pv2` / `pv3` / `pv4` / `pv5`
|
|
891
938
|
|
|
892
939
|
#### Positions <!-- notoc -->
|
|
893
940
|
|
|
894
|
-
`absolute` / `bottom
|
|
941
|
+
`absolute` / `bottom-0` / `bottom-1` / `bottom-2` / `bottom--1` / `bottom--2` / `fixed` / `left-0` / `left-1` / `left-2` / `left--1` / `left--2` / `relative` / `right-0` / `right-1` / `right-2` / `right--1` / `right--2` / `static` / `sticky` / `top-0` / `top-1` / `top-2` / `top--1` / `top--2`
|
|
942
|
+
|
|
943
|
+
#### Print <!-- notoc -->
|
|
944
|
+
|
|
945
|
+
`break-after-avoid` / `break-after-avoid-column` / `break-after-avoid-page` / `break-after-column` / `break-after-left` / `break-after-page` / `break-after-recto` / `break-after-right` / `break-after-verso` / `break-before-avoid` / `break-before-avoid-column` / `break-before-avoid-page` / `break-before-column` / `break-before-left` / `break-before-page` / `break-before-recto` / `break-before-right` / `break-before-verso`
|
|
946
|
+
|
|
947
|
+
#### Scrolling <!-- notoc -->
|
|
948
|
+
|
|
949
|
+
`ss-always` / `ss-both` / `ss-center` / `ss-end` / `ss-normal` / `ss-start` / `ss-x` / `ss-y`
|
|
895
950
|
|
|
896
951
|
#### Selection <!-- notoc -->
|
|
897
952
|
|
|
@@ -913,17 +968,13 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
913
968
|
|
|
914
969
|
`ttc` / `ttfsk` / `ttfw` / `tti` / `ttl` / `ttn` / `ttu`
|
|
915
970
|
|
|
916
|
-
#### Undefined <!-- notoc -->
|
|
917
|
-
|
|
918
|
-
`vh-100` / `vh-25` / `vh-50` / `vh-75` / `vw-100` / `vw-25` / `vw-50` / `vw-75`
|
|
919
|
-
|
|
920
971
|
#### Vertical align <!-- notoc -->
|
|
921
972
|
|
|
922
973
|
`v-base` / `v-btm` / `v-mid` / `v-top`
|
|
923
974
|
|
|
924
975
|
#### Visibility <!-- notoc -->
|
|
925
976
|
|
|
926
|
-
`hidden` / `visible`
|
|
977
|
+
`collapse` / `hidden` / `visible`
|
|
927
978
|
|
|
928
979
|
#### Whitespace <!-- notoc -->
|
|
929
980
|
|
|
@@ -931,7 +982,7 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
931
982
|
|
|
932
983
|
#### Width <!-- notoc -->
|
|
933
984
|
|
|
934
|
-
`
|
|
985
|
+
`vw-25` / `vw-50` / `vw-75` / `vw-100` / `w1` / `w2` / `w3` / `w4` / `w5` / `w-10` / `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` / `w-100`
|
|
935
986
|
|
|
936
987
|
#### Z-indices <!-- notoc -->
|
|
937
988
|
|
|
@@ -968,7 +1019,7 @@ distributed as CLI bundle with **no runtime dependencies**. The following
|
|
|
968
1019
|
dependencies are only shown for informational purposes and are (partially)
|
|
969
1020
|
included in the bundle.
|
|
970
1021
|
|
|
971
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 11.
|
|
1022
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 11.73 KB
|
|
972
1023
|
|
|
973
1024
|
## Dependencies
|
|
974
1025
|
|
|
@@ -976,7 +1027,6 @@ Package sizes (brotli'd, pre-treeshake): ESM: 11.46 KB
|
|
|
976
1027
|
- [@thi.ng/args](https://github.com/thi-ng/umbrella/tree/develop/packages/args)
|
|
977
1028
|
- [@thi.ng/arrays](https://github.com/thi-ng/umbrella/tree/develop/packages/arrays)
|
|
978
1029
|
- [@thi.ng/checks](https://github.com/thi-ng/umbrella/tree/develop/packages/checks)
|
|
979
|
-
- [@thi.ng/compose](https://github.com/thi-ng/umbrella/tree/develop/packages/compose)
|
|
980
1030
|
- [@thi.ng/errors](https://github.com/thi-ng/umbrella/tree/develop/packages/errors)
|
|
981
1031
|
- [@thi.ng/file-io](https://github.com/thi-ng/umbrella/tree/develop/packages/file-io)
|
|
982
1032
|
- [@thi.ng/hiccup-css](https://github.com/thi-ng/umbrella/tree/develop/packages/hiccup-css)
|
|
@@ -1015,4 +1065,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
1015
1065
|
|
|
1016
1066
|
## License
|
|
1017
1067
|
|
|
1018
|
-
© 2023 Karsten Schmidt // Apache License 2.0
|
|
1068
|
+
© 2023 - 2024 Karsten Schmidt // Apache License 2.0
|
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
`)}}var
|
|
4
|
-
`]:[],...Y(
|
|
5
|
-
`),L1(Z,W);const z=await Z.ctx({logger:new l0(process.stderr,Z.name,"INFO"),format:J?N0:G1,opts:V.result,inputs:V.rest},B);if(await B.fn(z),Z.post)await Z.post(z,B)}catch(Y){process.stderr.write(Y.message+"\n\n"),process.exit(1)}},L1=(Z,X)=>{process.stderr.write(U0(Z.opts,X)),process.exit(1)},Y8=(Z)=>["\nAvailable commands:\n",...Object.keys(Z).map((X)=>`${P0(16)(X)}: ${Z[X].desc}`),"\n"].join("\n");import{existsSync as B8,mkdirSync as U8,statSync as MZ} from"fs";import{sep as V8} from"path";var y1=(Z)=>{const X=Z.substring(0,Z.lastIndexOf(V8));return X.length>0&&!B8(X)?(U8(X,{recursive:!0}),!0):!1};var E=(Z)=>typeof Z==="function";var P=(Z)=>typeof Z==="string";import{readFileSync as Q8} from"fs";import{writeFileSync as z8} from"fs";var h1=(Z,X,J,W,Y=!1)=>{if(W&&W.info(`${Y?"[dryrun] ":""}writing file: ${Z}`),Y)return;y1(Z),z8(Z,X,!J&&P(X)?"utf-8":J)};var R=(Z,X,J="utf-8")=>{return X&&X.debug("reading file:",Z),Q8(Z,J)},a0=(Z,X,J,W=!1)=>h1(Z,F(X)?X.join("\n"):X,"utf-8",J,W);var S=(Z,X)=>JSON.parse(R(Z,X));var D0=Object.freeze({level:C.NONE,enabled:()=>!1,fine(){},debug(){},info(){},warn(){},severe(){}});import{join as x8} from"path";var q8=T(()=>"Assertion failed"),G0=(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 q8(typeof X==="function"?X():X)}:()=>{};var k0=(Z)=>Z!=null&&typeof Z!=="function"&&Z.length!==void 0;var f1=(Z)=>{return(Z==null||!Z[Symbol.iterator])&&K(`value is not iterable: ${Z}`),Z};var m1=(Z)=>k0(Z)?Z:[...f1(Z)];var z0=(Z)=>Z[Z.length-1];var $8=T(()=>"illegal arity"),s=(Z)=>{throw new $8(Z)};var H8=T(()=>"illegal state"),e=(Z)=>{throw new H8(Z)};var t0=function(...Z){let[X,J,W,Y,B,U,V,z,q,Q]=Z;switch(Z.length){case 0:s(0);case 1:return X;case 2:return(...H)=>X(J(...H));case 3:return(...H)=>X(J(W(...H)));case 4:return(...H)=>X(J(W(Y(...H))));case 5:return(...H)=>X(J(W(Y(B(...H)))));case 6:return(...H)=>X(J(W(Y(B(U(...H))))));case 7:return(...H)=>X(J(W(Y(B(U(V(...H)))))));case 8:return(...H)=>X(J(W(Y(B(U(V(z(...H))))))));case 9:return(...H)=>X(J(W(Y(B(U(V(z(q(...H)))))))));case 10:default:const $=(...H)=>X(J(W(Y(B(U(V(z(q(Q(...H))))))))));return Z.length===10?$:t0($,...Z.slice(10))}};var u1=(Z,X)=>new Promise((J)=>setTimeout(()=>J(Z),X));var g1=(Z)=>Z;var x1=["-moz-","-ms-","-o-","-webkit-"],x={rules:"",ruleSep:",",valSep:"",decls:"",declStart:"{",declEnd:"}",indent:"",comments:!1},Q0={rules:"\n",ruleSep:", ",valSep:" ",decls:"\n",declStart:" {\n",declEnd:"}\n",indent:" ",comments:!0};var G=(Z)=>Z!=null&&typeof Z[Symbol.iterator]==="function";var j0=(Z,X)=>Z!=null&&typeof Z[X]==="function";var d=(Z)=>j0(Z,"xform")?Z.xform():Z;var y=function(...Z){return Z=Z.map(d),t0.apply(null,Z)};var T0=(Z)=>Z!=null&&typeof Z!=="string"&&typeof Z[Symbol.iterator]==="function";var Z0=(Z,X)=>[Z[0],Z[1],X];var h=Symbol(),r0=()=>{};class c0{value;constructor(Z){this.value=Z}deref(){return this.value}}var k=(Z)=>Z instanceof c0;var f=(Z)=>Z instanceof c0?Z.deref():Z;var I0=function(...Z){const X=Z[0],J=X[0],W=X[1],Y=X[2];Z=K8(Z);const B=Z[0]==null?J():Z[0],U=Z[1];return f(W(j0(U,"$reduce")?U.$reduce(Y,B):k0(U)?C8(Y,B,U):M8(Y,B,U)))};var K8=(Z)=>Z.length===2?[void 0,Z[1]]:Z.length===3?[Z[1],Z[2]]:s(Z.length),C8=(Z,X,J)=>{for(let W=0,Y=J.length;W<Y;W++)if(X=Z(X,J[W]),k(X)){X=X.deref();break}return X},M8=(Z,X,J)=>{for(let W of J)if(X=Z(X,W),k(X)){X=X.deref();break}return X},X0=(Z,X)=>[Z,(J)=>J,X];var R0=function(Z){return Z?[...Z]:X0(()=>[],(X,J)=>(X.push(J),X))};function*A0(Z,X){const J=d(Z)(R0()),W=J[1],Y=J[2];for(let B of X){const U=Y([],B);if(k(U)){yield*f(W(U.deref()));return}if(U.length)yield*U}yield*f(W([]))}function*l(Z,X){const J=d(Z)([r0,r0,(W,Y)=>Y])[2];for(let W of X){let Y=J(h,W);if(k(Y)){if(Y=f(Y.deref()),Y!==h)yield Y;return}if(Y!==h)yield Y}}var v0=(Z,X,J=l)=>{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 s0=function(Z,X){return G(X)?A0(s0(Z),P(X)?[X]:X):(J)=>{const W=J[2],Y=(B,U)=>{const V=Z(U);if(V){for(let z of V)if(B=Y(B,z),k(B))break;return B}return W(B,U)};return Z0(J,Y)}};var d1=function(Z){return s0((X)=>T0(X)?X:void 0,Z)};var w=function(Z,X){return G(X)?l(w(Z),X):(J)=>{const W=J[2];return Z0(J,(Y,B)=>W(Y,Z(B)))}};function*E0(...Z){const X=Z.length-1;if(X<0)return;const J=new Array(X+1).fill(0),W=Z.map(m1),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 z=W[V];let q=J[V];if(q===z.length)J[V]=q=0,V>0&&J[V-1]++;U[V]=z[q]}J[X]++,yield U}}function*l1(Z,X=Infinity){while(X-- >0)yield Z}var e0=function(Z,X){Z=Z||"";let J=!0;return X?[...X].join(Z):X0(()=>"",(W,Y)=>(W=J?W+Y:W+Z+Y,J=!1,W))};var _0=function(...Z){return F8(_0,I0,Z)};var F8=(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 w((B)=>Z(J[0],J[1],B));default:s(J.length)}return X(d(J[0])(J[1]),W,Y)};var P8=new Set,w8=":[",n1=y(d1(),w((Z)=>w8.indexOf(Z.charAt(0))>=0?Z:" "+Z)),N8=(Z,X)=>y(Z,w((J)=>P(J)&&J.indexOf(" .")==0?J+X:J)),J0=(Z,X,J,W)=>{const Y=J.length,B=[];let U,V;const z=(q,Q)=>{let $=null;if(F(Q))J0(Z,Z1(X,B),Q,W);else if(G(Q)&&!P(Q))J0(Z,Z1(X,B),[...Q],W);else if((V=E(Q))||($=W.fns[Q]))if(!X.length){if($)return $.apply(null,J.slice(q+1))(Z,W),!0;Q(Z,W)}else if(V)z(q,Q());else K(`quoted fn ('${Q}') only allowed at head position`);else if(I(Q))U=Object.assign(U||{},Q);else if(Q!=null)B.push(Q)};for(let q=0;q<Y;q++)if(z(q,J[q]))return Z;return U&&Z.push(O8(X,B,U,W)),Z},Z1=(Z,X)=>Z.length?[...E0(Z,X)]:X,O8=(Z,X,J,W)=>{const Y=W.format,B=A(W),U=W.scope?N8(n1,W.scope):n1;return[B,_0(w((V)=>_0(U,e0(),F(V)?V:[V]).trim()),e0(Y.ruleSep),Z1(Z,X)),Y.declStart,q0(J,W),B,Y.declEnd].join("")},q0=(Z,X)=>{const J=X.format,W=X.autoprefix||P8,Y=A(X,X.depth+1),B=[];for(let U in Z)if(Z.hasOwnProperty(U)){let V=Z[U];if(E(V))V=V(Z);if(F(V))V=V.map((z)=>F(z)?z.join(" "):z).join(J.ruleSep);if(W.has(U))for(let z of X.vendors)B.push(`${Y}${z}${U}:${J.valSep}${V};`);B.push(`${Y}${U}:${J.valSep}${V};`)}return B.join(J.decls)+J.decls},A=(Z,X=Z.depth)=>X>1?[...l1(Z.format.indent,X)].join(""):X>0?Z.format.indent:"";var p1=function(Z,...X){const J=X.length===1?X[0]:{0:X[0],100:X[1]};return(W,Y)=>{const B=A(Y);Y.depth++;const U=A(Y);W.push(`${B}@keyframes ${Z}${Y.format.declStart}`);for(let V in J)if(J.hasOwnProperty(V))W.push([U,V+"%",Y.format.declStart,q0(J[V],Y),U,Y.format.declEnd].join(""));return Y.depth--,W.push(B+Y.format.declEnd),W}};var o1=(Z,X=!1)=>(J,W)=>{const Y=A(W),B=A(W,W.depth+1);if(W.format.comments||X)J.push(Y+"/*",Z.split("\n").map((U)=>B+U).join("\n"),Y+"*/");return J};var b0=(Z,X,J)=>(W,Y)=>{const B=A(Y);return W.push(`${B}${Z} ${D8(X)}${Y.format.declStart}`),Y.depth++,J0(W,[],J,Y),Y.depth--,W.push(B+Y.format.declEnd),W},D8=(Z)=>{if(P(Z))return Z;const X=[];for(let J in Z)if(Z.hasOwnProperty(J)){let W=Z[J];if(W===!0)W=i1.has(J)?J:`(${J})`;else if(W===!1)W=`(not ${i1.has(J)?J:`(${J})`})`;else if(W==="only")W+=" "+J;else W=`(${J}:${W})`;X.push(W)}return X.join(" and ")},i1=new Set(["all","print","screen"]);var n=(Z,X)=>{return X={format:x,vendors:x1,fns:{},depth:0,...X},F(X.autoprefix)&&(X.autoprefix=new Set(X.autoprefix)),I(Z)?q0(Z,X):E(Z)?Z([],X).join(X.format.rules):J0([],[],F(Z)?Z:T0(Z)?[...Z]:K("invalid rules"),X).join(X.format.rules)};var a1=(Z,...X)=>(J,W)=>(J.push(X.length?`@import url(${Z}) ${X.join(W.format.ruleSep)};`:`@import url(${Z});`),J);var W0=(Z,X)=>b0("@media",Z,X);var t1=function(...Z){return(X,J)=>(X.push(Z.length>1?`@namespace ${Z[0]} url(${Z[1]});`:`@namespace url(${Z[0]});`),X)};var r1=(Z,X)=>b0("@supports",Z,X);var p={"@comment":o1,"@import":a1,"@keyframes":p1,"@media":W0,"@namespace":t1,"@supports":r1};var c1=4,s1=(Z)=>c1=Z,D=(Z)=>Z===(Z|0)?String(Z):Z.toFixed(c1).replace(/^0./,".").replace(/^-0./,"-.").replace(/0+$/,""),e1=(Z)=>`${D(Z)}em`,Z5=(Z)=>`${D(Z)}ex`,X5=(Z)=>`${D(Z)}rem`,X1=(Z)=>`${D(Z)}%`,J5=(Z)=>`${D(Z)}px`,W5=(Z)=>`${D(Z)}vh`,Y5=(Z)=>`${D(Z)}vw`,B5=(Z)=>`${D(Z)}vmin`,U5=(Z)=>`${D(Z)}vmax`,V5=(Z)=>`${Z|0}ms`,z5=(Z)=>`${D(Z)}s`;var Q5=(Z)=>`${D(Z)}deg`,q5=(Z)=>`${D(Z)}rad`,$5=(Z)=>`${D(Z)}turn`,H5=(Z)=>`url(${Z})`;var N=((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})(N||{}),j=((Z)=>{return Z[Z.NEVER=0]="NEVER",Z[Z.FIRST=1]="FIRST",Z[Z.LAST=2]="LAST",Z})(j||{});var G8=0,k8=()=>G8++,o=(Z,X)=>!X||!X.id?{...X,id:Z+"-"+k8()}:X;var O=D0;class m{constructor(Z,X){this.wrapped=Z,X=o("sub",{closeIn:j.LAST,closeOut:j.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(R0()))}id;closeIn;closeOut;parent;__owner;xform;cacheLast;last=h;state=N.IDLE;subs=[];deref(){return this.last!==h?this.last:void 0}getState(){return this.state}setState(Z){this.state=Z}subscribe(Z,X={}){this.ensureState();let J;if(Z instanceof m&&!X.xform)Z.ensureState(),G0(!Z.parent,`sub '${Z.id}' already has a parent`),Z.parent=this,J=Z;else J=new m(Z,{...X,parent:this});return this.subs.push(J),this.setState(N.ACTIVE),J.setState(N.ACTIVE),this.last!=h&&J.next(this.last),J}transform(...Z){let X,J;if(I(z0(Z)))J=Z.pop(),X={error:J.error};return this.subscribe(X,o("xform",Z.length>0?{...J,xform:y(...Z)}:J))}map(Z,X){return this.transform(w(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<N.UNSUBSCRIBED&&(this.state=N.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===j.FIRST||!this.subs.length&&this.closeOut!==j.NEVER)this.unsubscribe();return!0}return!1}next(Z){if(this.state>=N.DONE)return;this.xform?this.dispatchXform(Z):this.dispatch(Z)}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(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!==D0?O:console).warn(this.id,"unhandled error:",Z),this.unsubscribe(),this.state=N.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))k(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=f(Z);for(let J=0,W=X.length;J<W&&this.state<N.DONE;J++)this.dispatch(X[J]);return this.state<N.ERROR}ensureState(){if(this.state>=N.DONE)e(`operation not allowed in state ${this.state}`)}release(){this.subs.length=0,delete this.parent,delete this.xform,delete this.last}}var K5=(Z,X)=>{const J=new C5(X);return J.next(Z),J};class C5 extends m{src;_cancel;_inited;constructor(Z,X){const[J,W]=E(Z)?[Z,X||{}]:[void 0,Z||{}];super(W.error?{error:W.error}:void 0,o("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!==j.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 M5=(Z,X)=>Z===j.FIRST||Z===j.LAST&&!X;var J1=function(Z){return Z?I0(J1(),Z):X0(()=>({}),(X,[J,W])=>(X[J]=W,X))};var W1=function(Z,X){return G(X)?l(W1(Z),X):w(E(Z)?(J)=>[Z(J),J]:(J)=>[Z,J])};var Y1=function(...Z){const X=v0(Y1,Z);if(X)return X;const J=Z[0],W=Z[1]!==!1;return w((Y)=>{const B=W?{}:Y;for(let U in Y)B[U]=J(Y[U]);return B})};var B1=function(...Z){const X=v0(B1,Z,A0);if(X)return X;const{key:J,mergeOnly:W,reset:Y,all:B,backPressure:U}={key:g1,mergeOnly:!1,reset:!0,all:!0,backPressure:0,...Z[1]},V=F(Z[0])?new Set(Z[0]):Z[0],z=new Set,q=new Map;let Q={};const $=([H,_,i])=>{let b=!0;if(W||U<1)return[H,(M)=>{if(Y&&B&&z.size>0||!Y&&b)M=i(M,Q),Q={},z.clear(),b=!1;return _(M)},(M,L)=>{const v=J(L);if(V.has(v)){if(Q[v]=L,z.add(v),W||F5(V,z))if(M=i(M,Q),b=!1,Y)Q={},z.clear();else Q={...Q}}return M}];else return[H,(M)=>{if(B&&z.size>0)M=i(M,P5(q,z)),q.clear(),z.clear();return _(M)},(M,L)=>{const v=J(L);if(V.has(v)){let C0=q.get(v);!C0&&q.set(v,C0=[]),C0.length>=U&&e(`max back pressure (${U}) exceeded for input: ${String(v)}`),C0.push(L),z.add(v);while(F5(V,z))if(M=i(M,P5(q,z)),b=!1,k(M))break}return M}]};return $.keys=()=>V,$.clear=()=>{q.clear(),V.clear(),z.clear(),Q={}},$.add=(H)=>{V.add(H)},$.delete=(H,_=!0)=>{if(q.delete(H),V.delete(H),_)z.delete(H),delete Q[H]},$},F5=(Z,X)=>{if(X.size<Z.size)return!1;for(let J of Z)if(!X.has(J))return!1;return!0},P5=(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 w5=(Z,X)=>{let J=!0;for(let W of X)J=Z.removeID(W)&&J;return J};var N5=(Z)=>new O5(Z);class O5 extends m{sources;idSources;realSourceIDs;invRealSourceIDs;psync;clean;constructor(Z){const X=B1(new Set,{key:(W)=>W[0],mergeOnly:Z.mergeOnly===!0,reset:Z.reset===!0,all:Z.all!==!1,backPressure:Z.backPressure||0}),J=Y1((W)=>W[1]);super(void 0,o("streamsync",{...Z,xform:Z.xform?y(X,J,Z.xform):y(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 m?this.add(J[1]):this.next(J),done:()=>this.markDone(Z),__owner:this},{xform:W1(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 w5(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),M5(this.closeIn,this.sources.size)&&this.done()}}var U1=a((Z,X=" ")=>{const J=t(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}}),S2=U1(2,"0"),D5=U1(3,"0"),y2=U1(4,"0");var V1=function(Z,X){return G(X)?l(V1(Z),X):(J)=>{const W=J[2];return Z0(J,(Y,B)=>Z(B)?W(Y,B):Y)}};import{watch as T8} from"fs";import{resolve as H0} from"path";var G5={specs:r({alias:"s",optional:!1,desc:"Path to generated JSON defs"})},L0={include:c({alias:"I",desc:"Include CSS files (prepend)"})},S0={noDecls:u({alias:"d",desc:"Don't emit framework decls"})},Y0={pretty:u({alias:"p",desc:"Pretty print output"})},y0={noHeader:u({desc:"Don't emit generated header comment"})},k5={watch:u({alias:"w",desc:"Watch input files for changes"})};import{resolve as j8} from"path";var B0=(Z,X,J)=>{X=P(X)?X:X.join("\n"),Z?a0(j8(Z),X,J):console.log(X)},h0=({info:{name:Z,version:X}})=>`/*! ${Z} v${X} - generated by thi.ng/meta-css @ ${(new Date()).toISOString()} */`;var T5={desc:"Transpile & bundle meta stylesheets to CSS",opts:{...G5,...L0,...S0,...Y0,...y0,...k5,eval:r({alias:"e",desc:"eval meta stylesheet in given string (ignores other inputs & includes)"}),force:c({alias:"f",hint:"STR",desc:"CSS classes to force include (wildcards are supported, @-prefix will read from file)",delim:","})},fn:async(Z)=>{const X=S(H0(Z.opts.specs),Z.logger),J=v8(X,Z.opts.force||[],Z.logger);if(Z.opts.watch)await I8(Z,X,J);else if(Z.opts.eval)z1(Z,X,J,[Z.opts.eval]);else z1(Z,X,J,Z.inputs.map((W)=>R(H0(W),Z.logger)))}},I8=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=H0(U);const z=K5(R(U,Z.logger),{id:`in${D5(V)}`});return{input:z,watcher:T8(U,{},(q)=>{if(q==="change")try{z.next(R(U,Z.logger))}catch(Q){Z.logger.warn(Q.message),Y()}else Z.logger.warn("input removed:",U),Y()})}});N5({src:J1(w(({input:U})=>[U.id,U],B))}).subscribe({next(U){try{z1(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 u1(null,250)},z1=({logger:Z,opts:{include:X,noDecls:J,noHeader:W,out:Y,pretty:B}},U,V,z)=>{const q={logger:Z,specs:U,format:B?Q0:x,mediaQueryIDs:new Set(Object.keys(U.media)),mediaQueryRules:{...V.mediaQueryRules},plainRules:{...V.plainRules}},Q=X?X.map(($)=>R(H0($),Z).trim()):[];if(!W)Q.push(h0(U));if(!J&&U.decls.length)Q.push(n(U.decls,{format:q.format,fns:p}));z.forEach(($)=>E8($,q)),A8(Q,q),R8(Q,q),B0(Y,Q,Z)},R8=(Z,{logger:X,specs:J,format:W,mediaQueryRules:Y})=>{for(let B in Y){const U=R5(Y[B],J);X.debug("mediaquery rules",B,U),Z.push(n(W0(L8(J.media,B),U),{format:W,fns:p}))}},A8=(Z,{logger:X,specs:J,format:W,plainRules:Y})=>{const B=R5(Y,J);X.debug("plain rules",B),Z.push(n(B,{format:W,fns:p}))},v8=(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=[...g(R(H0(X[0].substring(1)),J))];for(let V of X){if(!V||V.startsWith("//"))continue;const{token:z,query:q}=A5(V,W);let Q;if(z.includes("*")){const $=new RegExp(`^${z.replace("*",".*")}\$`);Q=[...V1((H)=>$.test(H),Y)]}else if(Y.has(z))Q=[z];else{J.warn(`unknown include rule ID: ${V}, skipping...`);continue}for(let $ of Q)J.debug("including class:",$),q?v5(B,q,`.${$}`,$):E5(U,`.${$}`,$)}return{mediaQueryRules:B,plainRules:U}},E8=(Z,{specs:X,mediaQueryIDs:J,mediaQueryRules:W,plainRules:Y})=>{const B=$0(),U=$0(B),V={root:B,curr:U,scopes:[U]};for(let z of g(Z)){if(!z||/^\s*\/\//.test(z))continue;for(let q of g(z,/\s+/g)){if(!q)continue;let Q=V.curr;switch(Q.state){case"sel":case"nest":if(q==="{"){if(Q.state==="sel")Q.sel=Q.sel.map(($)=>$.replace(",","")),Q.path=_8(V.scopes);Q.state="class"}else if(q==="}")j5(V);else{const $=z0(Q.sel);if(!$||$.endsWith(","))Q.sel.push(q);else Q.sel[Q.sel.length-1]+=" "+q}break;case"class":if(q==="{")Q.state="nest",V.scopes.push(V.curr=$0(Q));else if(q==="}")j5(V);else{let{token:$,query:H}=A5(q,J);if(!X.classes[$])K(`unknown class ID: ${$}`);if(H)v5(W,H,Q.path,$);else E5(Y,Q.path,$)}break;default:e(Q.state)}}}},Q1=":",I5="///",$0=(Z)=>({state:"sel",sel:Z?[]:["<root>"],path:"",parent:Z}),j5=(Z)=>{const X=!Z.curr.sel.length;if(G0(!!Z.curr.parent,"stack underflow"),Z.scopes.pop(),Z.scopes.length>0){if(Z.curr=z0(Z.scopes),!X&&Z.curr.state==="nest")Z.scopes.push(Z.curr=$0(Z.curr))}else Z.scopes.push(Z.curr=$0(Z.root))},_8=(Z)=>Z.map((X)=>X.sel.join(",")).join(I5),R5=(Z,X)=>Object.entries(Z).map(([J,W])=>b8(J,W,X)),b8=(Z,X,J)=>{const W=[];let Y=W;const B=Z.split(I5);for(let U=0;U<B.length;U++){const V=B[U].split(",");if(U==B.length-1){const z=Object.assign({},...w((q)=>J.classes[q],X));if("__user"in z)delete z.__user;V.push(z)}Y.push(V),Y=V}return W[0]},A5=(Z,X)=>{if(/^::?/.test(Z))return{token:Z};const J=Z.lastIndexOf(Q1);if(J<0)return{token:Z};const W=Z.substring(0,J);if(!W.split(Q1).every((B)=>X.has(B)))K(`invalid media query in token: ${Z}`);return{token:Z.substring(J+1),query:W}},L8=(Z,X)=>X.split(Q1).reduce((J,W)=>Object.assign(J,Z[W]),{}),v5=(Z,X,J,W)=>{if(!Z[X])Z[X]={};(Z[X][J]||(Z[X][J]=new Set)).add(W)},E5=(Z,X,J)=>(Z[X]||(Z[X]=new Set)).add(J);import{resolve as _5} from"path";var L5={desc:"Export entire generated framework as CSS",opts:{...L0,...S0,...Y0,...y0,media:c({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:z}=Z,q=S(_5(z[0]),X),Q=J?J.map(($)=>R(_5($),X).trim()):[];if(!B)Q.push(h0(q));if(!Y&&q.decls.length)Q.push(n(q.decls,{format:U?Q0:x,fns:p}));Q.push(S8(q,W,U,X)),B0(V,Q,X)}},S8=(Z,X,J,W)=>{const Y=b5("",Z);if(X){const B=X[0]==="ALL"?Object.keys(Z.media):X;for(let U of B)if(Z.media[U])Y.push(W0(Z.media[U],b5("-"+U,Z)));else W.warn(`invalid media query ID: ${U}, skipping...`)}return n(Y,{format:J?Q0:x,fns:p})},b5=(Z,X)=>Object.entries(X.classes).map(([J,W])=>[`.${J}${Z}`,y8(W)]),y8=(Z)=>{if("__user"in Z)Z={...Z},delete Z.__user;return Z};import{resolve as h8} from"path";var S5={deg:Q5,em:e1,ex:Z5,ms:V5,percent:X1,px:J5,rad:q5,rem:X5,second:z5,turn:$5,url:H5,vh:W5,vmax:U5,vmin:B5,vw:Y5,"%":X1},f8={"":[""],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"]},y5={desc:"Generate framework rules from specs",opts:{...Y0,prec:P1({default:3,desc:"Number of fractional digits"})},fn:async(Z)=>{const{logger:X,opts:{prec:J,out:W,pretty:Y},inputs:B}=Z,U={info:{name:"TODO",version:"0.0.0"},media:{},classes:{},decls:[]};s1(J);for(let V of B){const z=S(h8(V),X);if(Object.assign(U.info,z.info),Object.assign(U.media,z.media),z.decls)U.decls.push(...z.decls);for(let q of z.specs)m8(z,q,U.classes,X)}B0(W,JSON.stringify(U,null,Y?4:0),X)}},m8=(Z,X,J,W)=>{const Y=F(X.vars)?X.vars:[""],B=P(X.props)?{[X.props]:"<v>"}:X.props,U=u8(X,Z),V=new Set;for(let z of Y)for(let[q,Q]of E0(Z.vars?.[z]||f8[z],Object.keys(U))){const $=K0(X.name,z,q,Q,U[Q]),H=X.unit?K0(X.unit,z,q,Q,U[Q]):void 0,_=g8(U[Q],H);if(!J[$])J[$]=X.user!=null?{__user:K0(X.user,z,q,Q,U[Q])}:{};else if(!V.has($))K(`duplicate class ID: ${$}`);V.add($);for(let[i,b]of Object.entries(B)){const M=K0(i,z,q,Q,U[Q]),L=K0(!H||P(b)?String(b):S5[H](b),z,q,Q,_);J[$][M]=L,W.debug($,M,L)}}return J},u8=(Z,X)=>{const J=P(Z.values)?X.tables?.[Z.values]||K(`invalid table ID: ${Z.values}`):Z.values;if(I(J))return J;const W=Z.key==="v"?(Y)=>String(Y):Z.key==="i+1"?(Y,B)=>String(B+1):Z.key===void 0?(Y,B)=>String(B):K(`invalid key type: ${Z.key}`);return J.reduce((Y,B,U)=>{return Y[W(B,U)]=B,Y},{})},g8=(Z,X)=>{if(!X||P(Z))return Z;const J=S5[X];if(!J)K(`invalid unit: ${X}`);return J(Z)},K0=(Z,X,J,W,Y)=>Z.replace("<vid>",X).replace("<var>",J).replace("<k>",W).replace("<v>",String(Y));var q1=S(x8(import.meta.dir,"package.json"));S1({name:"metacss",opts:{out:r({alias:"o",desc:"Output file (or stdout)"}),verbose:u({alias:"v",desc:"Display extra process information"})},commands:{convert:T5,export:L5,generate:y5},ctx:async(Z)=>{if(Z.opts.verbose)Z.logger.level=C.DEBUG;return{...Z,format:N0}},usage:{prefix:`
|
|
2
|
+
var u0={default:95,hint:90,multi:90,param:96,required:33};var g0=(X)=>X;var t=function(X,Z){return!Z&&(Z={}),(...J)=>{const W=JSON.stringify(J);if(W!==void 0)return W in Z?Z[W]:Z[W]=X.apply(null,J);return X.apply(null,J)}};var r=t((X,Z)=>X.repeat(Z));var K1=(X)=>/^[a-f0-9]+$/i.test(X);var H1=(X)=>/^[-+]?\d+$/.test(X),C1=(X)=>/^[-+]?\d*\.?\d+(e[-+]?\d+)?$/i.test(X);var R=(X,Z=(J)=>J!==void 0?": "+J:"")=>class extends Error{constructor(J){super(X(J)+Z(J))}};var x4=R(()=>"illegal argument(s)"),H=(X)=>{throw new x4(X)};var x0=(X)=>C1(X)?parseFloat(X):H(`not a numeric value: ${X}`),M1=(X)=>X.map(x0),d0=(X)=>K1(X)?parseInt(X,16):H(`not a hex value: ${X}`),F1=(X)=>X.map(d0),n0=(X)=>H1(X)?parseInt(X):H(`not an integer: ${X}`),P1=(X)=>X.map(n0);var M0=(X,Z)=>(J)=>({coerce:X,hint:Z,group:"main",...J}),F0=(X,Z)=>(J)=>({hint:d4(Z,J.delim),multi:!0,coerce:X,group:"main",...J}),d4=(X,Z)=>X+(Z?`[${Z}..]`:""),T=(X)=>({flag:!0,default:!1,group:"flags",...X}),P0=M0(g0,"STR"),O0=F0(g0,"STR"),MX=M0(x0,"NUM"),FX=M0(d0,"HEX"),O1=M0(n0,"INT"),PX=F0(M1,"NUM"),OX=F0(F1,"HEX"),wX=F0(P1,"INT");var C=((X)=>{return X[X.FINE=0]="FINE",X[X.DEBUG=1]="DEBUG",X[X.INFO=2]="INFO",X[X.WARN=3]="WARN",X[X.SEVERE=4]="SEVERE",X[X.NONE=5]="NONE",X})(C||{});class l0{id;level;constructor(X,Z=C.FINE){this.id=X,this.level=typeof Z==="string"?C[Z]:Z}enabled(X){return this.level<=X}fine(...X){this.level<=C.FINE&&this.log(C.FINE,X)}debug(...X){this.level<=C.DEBUG&&this.log(C.DEBUG,X)}info(...X){this.level<=C.INFO&&this.log(C.INFO,X)}warn(...X){this.level<=C.WARN&&this.log(C.WARN,X)}severe(...X){this.level<=C.SEVERE&&this.log(C.SEVERE,X)}}var w1=(X)=>X.map((Z)=>{if(typeof Z==="function")Z=Z();if(!(typeof Z==="string"||typeof Z==="number"))Z=JSON.stringify(Z);return Z}).join(" ");class p0 extends l0{constructor(X,Z,J=C.FINE){super(Z,J);this.target=X}log(X,Z){this.target.write(`[${C[X]}] ${this.id}: ${w1(Z)}
|
|
3
|
+
`)}}var w0=t((X,Z=" ")=>{const J=r(String(Z),X);return(W,Y)=>{if(W==null)return J;return W=W.toString(),Y=Y!==void 0?Y:W.length,Y<X?W+J.substring(Y):W}});var N1=(X,Z)=>{return!Z&&(Z=new Map),(J)=>{let W;return Z.has(J)?Z.get(J):(Z.set(J,W=X(J)),W)}};var o0={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 n4=(X,Z)=>(J)=>X.format(Z,J),i0=(X)=>Object.keys(o0).reduce((Z,J)=>(Z[J]=n4(X,o0[J]),Z),{format:X});var D1="\x1B[0m",l4=["","1","2","1;2","4","1;4","2;4","1;2;4"],N0={format:(X,Z)=>N0.start(X)+Z+N0.end,start:N1((X)=>{let Z=[],J=X&15;return J&&Z.push(29+(X>>4&1)*60+J),J=X>>5&15,J&&Z.push(39+(X>>9&1)*60+J),J=X>>10,J&&Z.push(l4[J]),"\x1B["+Z.join(";")+"m"}),end:D1,prefix:D1,suffix:"\n"};var G1={format:(X,Z)=>String(Z),prefix:"",suffix:"\n",start:()=>"",end:""};var D0=i0(N0),k1=i0(G1);var F=Array.isArray;var p4=(X)=>X.toUpperCase(),j1=(X)=>X.toLowerCase(),T1=(X)=>X.length?X[0].toUpperCase()+X.substring(1):X,I1=(X,Z="-")=>j1(X.replace(/([a-z0-9\u00e0-\u00fd])([A-Z\u00c0-\u00dd])/g,(J,W,Y)=>W+Z+Y));var R1=(X,Z="-")=>j1(X).replace(new RegExp(`\\${Z}+(\\w)`,"g"),(J,W)=>p4(W));var A1=Object.getPrototypeOf,A=(X)=>{let Z;return X!=null&&typeof X==="object"&&((Z=A1(X))===null||A1(Z)===null)};var o4=/\x1b\[[0-9;]+m/g,i4=(X)=>X.replace(o4,"");var G0=(X)=>i4(X).length;var v1=(X=!1,Z)=>(J)=>X||typeof J!=="string"&&typeof J!=="number"?JSON.stringify(J,null,Z):String(J);function*g(X,Z=/\r?\n/g,J=!1){let W=0;const Y=X.length,B=~~J;let V;if(typeof Z==="string")V=new RegExp(Z,"g");else if(!Z.flags.includes("g"))V=new RegExp(Z,Z.flags+"g");else V=Z;for(;W<Y;){const z=V.exec(X);if(!z){yield X.substring(W);return}const U=z[0].length;yield X.substring(W,z.index+B*U),W=z.index+U}}class a0{n=0;w=[];constructor(X,Z){X!=null&&this.add(X,Z)}add(X,Z=X.length){return this.w.push(X),this.n+=Z+~~(this.n>0),this}toString(){return this.w.join(" ")}}var a4={length:(X)=>X.length,split:(X,Z)=>Z},b1={length:G0,split:(X,Z)=>{const J=/\x1b\[[0-9;]+m/g;let W=Z,Y;while(Y=J.exec(X)){if(Y.index>=Z)break;const B=Y[0].length;W+=B,Z+=B}return W}},E1=(X,Z,J,W)=>{const Y=X[X.length-1];Y&&W-Y.n>J?Y.add(Z,J):X.push(new a0(Z,J))},t4=(X,{width:Z,min:J,hard:W,splitter:Y},B=0,V=[])=>{let z=Y.length(X),U=Z-B;if(U<J&&U<z)U=Z;while(W&&z>U){const q=Y.split(X,U),Q=X.substring(0,q);E1(V,Q,U,Z),X=X.substring(q),U=Z,z=Y.length(X)}return E1(V,X,z,Z),V},r4=(X,Z,J=[])=>{if(!X.length)return J.push(new a0),J;const W={width:80,min:4,hard:!1,splitter:a4,...Z};for(let Y of g(X,Z.delimWord||/\s/g)){const B=J[J.length-1];t4(Y,W,B&&B.n>0?B.n+1:0,J)}return J},S1=(X,Z)=>{let J=[];for(let W of g(X,Z.delimLine))J=J.concat(r4(W,Z));return J};var V0=(X,Z={})=>{Z={lineWidth:80,paramWidth:32,showDefaults:!0,prefix:"",suffix:"",groups:["flags","main"],...Z};const J=A(Z.color)?{...u0,...Z.color}:Z.color?u0:{},W=r(" ",Z.paramWidth),Y=(z)=>z.map((U)=>c4(U,X[U],Z,J,W)),B=Object.keys(X).sort(),V=Z.groups?Z.groups.map((z)=>[z,B.filter((U)=>X[U].group===z)]).filter((z)=>!!z[1].length):[["options",B]];return[...t0(Z.prefix,Z.lineWidth),...V.map(([z,U])=>[...Z.showGroupNames?[`${T1(z)}:
|
|
4
|
+
`]:[],...Y(U),""].join("\n")),...t0(Z.suffix,Z.lineWidth)].join("\n")},c4=(X,Z,J,W,Y)=>{const B=s4(Z,W),V=e4(Z,W,B),z=z0(`--${I1(X)}`,W.param),U=`${V}${z}${B}`,q=Z.optional===!1&&Z.default===void 0,Q=[];q&&Q.push("required"),Z.multi&&Q.push("multiple");const $=X8(Q,W,q)+(Z.desc||"")+Z8(Z,J,W);return w0(J.paramWidth)(U,G0(U))+t0($,J.lineWidth-J.paramWidth).map((K,S)=>S>0?Y+K:K).join("\n")},s4=(X,Z)=>X.hint?z0(" "+X.hint,Z.hint):"",e4=(X,Z,J)=>X.alias?`${z0("-"+X.alias,Z.param)}${J}, `:"",X8=(X,Z,J)=>X.length?z0(`[${X.join(", ")}] `,J?Z.required:Z.multi):"",Z8=(X,Z,J)=>Z.showDefaults&&X.default!=null&&X.default!==!1?z0(` (default: ${v1(!0)(X.defaultHint!=null?X.defaultHint:X.default)})`,J.default):"",z0=(X,Z)=>Z!=null?`\x1B[${Z}m${X}\x1B[0m`:X,t0=(X,Z)=>X?S1(X,{width:Z,splitter:b1,hard:!1}):[];var J8=R(()=>"parse error"),L1=(X,Z,J)=>{J={start:2,showUsage:!0,help:["--help","-h"],...J};try{return W8(X,Z,J)}catch(W){if(J.showUsage)console.log(W.message+"\n\n"+V0(X,J.usageOpts));throw new J8(W.message)}},W8=(X,Z,J)=>{const W=Y8(X),Y={};let B,V,z=J.start;for(;z<Z.length;){const U=Z[z];if(!B){if(J.help.includes(U)){console.log(V0(X,J.usageOpts));return}const q=B8(X,W,Y,U);if(B=q.id,V=q.spec,z=z+~~(q.state<2),q.state)break}else{if(V8(V,Y,B,U))break;B=null,z++}}return B&&H(`missing value for: --${B}`),{result:z8(X,Y),index:z,rest:Z.slice(z),done:z>=Z.length}},Y8=(X)=>Object.entries(X).reduce((Z,[J,W])=>W.alias?(Z[W.alias]=J,Z):Z,{}),B8=(X,Z,J,W)=>{if(W[0]==="-"){let Y;if(W[1]==="-"){if(W==="--")return{state:1};Y=R1(W.substring(2))}else Y=Z[W.substring(1)],!Y&&H(`unknown option: ${W}`);const B=X[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}},V8=(X,Z,J,W)=>{if(/^-[a-z]/i.test(W)&&H(`missing value for: --${J}`),X.multi)F(Z[J])?Z[J].push(W):Z[J]=[W];else Z[J]=W;return X.fn&&!X.fn(W)},z8=(X,Z)=>{let J;for(let W in X)if(J=X[W],Z[W]===void 0){if(J.default!==void 0)Z[W]=J.default;else if(J.optional===!1)H(`missing arg: --${W}`)}else if(J.coerce)U8(J,Z,W);return Z},U8=(X,Z,J)=>{try{if(X.multi&&X.delim)Z[J]=Z[J].reduce((W,Y)=>(W.push(...Y.split(X.delim)),W),[]);Z[J]=X.coerce(Z[J])}catch(W){throw new Error(`arg --${J}: ${W.message}`)}};var y1=async(X)=>{const Z=X.argv||process.argv,J=!process.env.NO_COLOR,W={prefix:"",color:J,...X.usage};try{let Y,B,V=X.start??2;if(X.single){if(Y=Object.keys(X.commands)[0],!Y)H("no command provided");B=X.commands[Y]}else{if(Y=Z[V],B=X.commands[Y],W.prefix+=Q8(X.commands),!B)_1(X,W);V++}let z;try{z=L1({...X.opts,...B.opts},Z,{showUsage:!0,usageOpts:W,start:V})}catch(q){}if(!z)process.exit(1);if(B.inputs!==void 0&&B.inputs!==z.rest.length)process.stderr.write(`expected ${B.inputs||0} input(s)
|
|
5
|
+
`),_1(X,W);const U=await X.ctx({logger:new p0(process.stderr,X.name,"INFO"),format:J?D0:k1,opts:z.result,inputs:z.rest},B);if(await B.fn(U),X.post)await X.post(U,B)}catch(Y){process.stderr.write(Y.message+"\n\n"),process.exit(1)}},_1=(X,Z)=>{process.stderr.write(V0(X.opts,Z)),process.exit(1)},Q8=(X)=>["\nAvailable commands:\n",...Object.keys(X).map((Z)=>`${w0(16)(Z)}: ${X[Z].desc}`),"\n"].join("\n");import{existsSync as q8,mkdirSync as $8,statSync as DZ} from"fs";import{sep as K8} from"path";var h1=(X)=>{const Z=X.substring(0,X.lastIndexOf(K8));return Z.length>0&&!q8(Z)?($8(Z,{recursive:!0}),!0):!1};var b=(X)=>typeof X==="function";var P=(X)=>typeof X==="string";import{readFileSync as C8} from"fs";import{writeFileSync as H8} from"fs";var m1=(X,Z,J,W,Y=!1)=>{if(W&&W.info(`${Y?"[dryrun] ":""}writing file: ${X}`),Y)return;h1(X),H8(X,Z,!J&&P(Z)?"utf-8":J)};var G=(X,Z,J="utf-8")=>{return Z&&Z.debug("reading file:",X),C8(X,J)},r0=(X,Z,J,W=!1)=>m1(X,F(Z)?Z.join("\n"):Z,"utf-8",J,W);var y=(X,Z)=>JSON.parse(G(X,Z));var h=Symbol(),c0=()=>{};var k0=Object.freeze({level:C.NONE,enabled:()=>!1,fine(){},debug(){},info(){},warn(){},severe(){}});import{join as i8} from"path";var M8=R(()=>"Assertion failed"),j0=(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 M8(typeof Z==="function"?Z():Z)}:()=>{};var T0=(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 u1=(X)=>T0(X)?X:[...f1(X)];var U0=(X)=>X[X.length-1];var F8=R(()=>"illegal arity"),c=(X)=>{throw new F8(X)};var P8=R(()=>"illegal state"),s=(X)=>{throw new P8(X)};var g1=["-moz-","-ms-","-o-","-webkit-"],x={rules:"",ruleSep:",",valSep:"",decls:"",declStart:"{",declEnd:"}",indent:"",comments:!1},Q0={rules:"\n",ruleSep:", ",valSep:" ",decls:"\n",declStart:" {\n",declEnd:"}\n",indent:" ",comments:!0};var k=(X)=>X!=null&&typeof X[Symbol.iterator]==="function";var s0=function(...X){let[Z,J,W,Y,B,V,z,U,q,Q]=X;switch(X.length){case 0:c(0);case 1:return Z;case 2:return(...K)=>Z(J(...K));case 3:return(...K)=>Z(J(W(...K)));case 4:return(...K)=>Z(J(W(Y(...K))));case 5:return(...K)=>Z(J(W(Y(B(...K)))));case 6:return(...K)=>Z(J(W(Y(B(V(...K))))));case 7:return(...K)=>Z(J(W(Y(B(V(z(...K)))))));case 8:return(...K)=>Z(J(W(Y(B(V(z(U(...K))))))));case 9:return(...K)=>Z(J(W(Y(B(V(z(U(q(...K)))))))));case 10:default:const $=(...K)=>Z(J(W(Y(B(V(z(U(q(Q(...K))))))))));return X.length===10?$:s0($,...X.slice(10))}};var I0=(X,Z)=>X!=null&&typeof X[Z]==="function";var d=(X)=>I0(X,"xform")?X.xform():X;var m=function(...X){return X=X.map(d),s0.apply(null,X)};var R0=(X)=>X!=null&&typeof X!=="string"&&typeof X[Symbol.iterator]==="function";var e=(X,Z)=>[X[0],X[1],Z];class e0{value;constructor(X){this.value=X}deref(){return this.value}}var j=(X)=>X instanceof e0;var f=(X)=>X instanceof e0?X.deref():X;var A0=function(...X){const Z=X[0],J=Z[0],W=Z[1],Y=Z[2];X=O8(X);const B=X[0]==null?J():X[0],V=X[1];return f(W(I0(V,"$reduce")?V.$reduce(Y,B):T0(V)?w8(Y,B,V):N8(Y,B,V)))};var O8=(X)=>X.length===2?[void 0,X[1]]:X.length===3?[X[1],X[2]]:c(X.length),w8=(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},N8=(X,Z,J)=>{for(let W of J)if(Z=X(Z,W),j(Z)){Z=Z.deref();break}return Z},X0=(X,Z)=>[X,(J)=>J,Z];var v0=function(X){return X?[...X]:X0(()=>[],(Z,J)=>(Z.push(J),Z))};function*E0(X,Z){const J=d(X)(v0()),W=J[1],Y=J[2];for(let B of Z){const V=Y([],B);if(j(V)){yield*f(W(V.deref()));return}if(V.length)yield*V}yield*f(W([]))}function*n(X,Z){const J=d(X)([c0,c0,(W,Y)=>Y])[2];for(let W of Z){let Y=J(h,W);if(j(Y)){if(Y=f(Y.deref()),Y!==h)yield Y;return}if(Y!==h)yield Y}}var b0=(X,Z,J=n)=>{const W=Z.length-1;return k(Z[W])?Z.length>1?J(X.apply(null,Z.slice(0,W)),Z[W]):J(X(),Z[0]):void 0};var X1=function(X,Z){return k(Z)?E0(X1(X),P(Z)?[Z]:Z):(J)=>{const W=J[2],Y=(B,V)=>{const z=X(V);if(z){for(let U of z)if(B=Y(B,U),j(B))break;return B}return W(B,V)};return e(J,Y)}};var x1=function(X){return X1((Z)=>R0(Z)?Z:void 0,X)};var O=function(X,Z){return k(Z)?n(O(X),Z):(J)=>{const W=J[2];return e(J,(Y,B)=>W(Y,X(B)))}};function*S0(...X){const Z=X.length-1;if(Z<0)return;const J=new Array(Z+1).fill(0),W=X.map(u1),Y=W.reduce((B,V)=>B*V.length,1);for(let B=0;B<Y;B++){const V=[];for(let z=Z;z>=0;z--){const U=W[z];let q=J[z];if(q===U.length)J[z]=q=0,z>0&&J[z-1]++;V[z]=U[q]}J[Z]++,yield V}}function*d1(X,Z=Infinity){while(Z-- >0)yield X}var Z1=function(X,Z){X=X||"";let J=!0;return Z?[...Z].join(X):X0(()=>"",(W,Y)=>(W=J?W+Y:W+X+Y,J=!1,W))};var L0=function(...X){return D8(L0,A0,X)};var D8=(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 O((B)=>X(J[0],J[1],B));default:c(J.length)}return Z(d(J[0])(J[1]),W,Y)};var G8=new Set,k8=":[",n1=m(x1(),O((X)=>k8.indexOf(X.charAt(0))>=0?X:" "+X)),j8=(X,Z)=>m(X,O((J)=>P(J)&&J.indexOf(" .")==0?J+Z:J)),Z0=(X,Z,J,W)=>{const Y=J.length,B=[];let V,z;const U=(q,Q)=>{let $=null;if(F(Q))Z0(X,J1(Z,B),Q,W);else if(k(Q)&&!P(Q))Z0(X,J1(Z,B),[...Q],W);else if((z=b(Q))||($=W.fns[Q]))if(!Z.length){if($)return $.apply(null,J.slice(q+1))(X,W),!0;Q(X,W)}else if(z)U(q,Q());else H(`quoted fn ('${Q}') only allowed at head position`);else if(A(Q))V=Object.assign(V||{},Q);else if(Q!=null)B.push(Q)};for(let q=0;q<Y;q++)if(U(q,J[q]))return X;return V&&X.push(T8(Z,B,V,W)),X},J1=(X,Z)=>X.length?[...S0(X,Z)]:Z,T8=(X,Z,J,W)=>{const Y=W.format,B=v(W),V=W.scope?j8(n1,W.scope):n1;return[B,L0(O((z)=>L0(V,Z1(),F(z)?z:[z]).trim()),Z1(Y.ruleSep),J1(X,Z)),Y.declStart,q0(J,W),B,Y.declEnd].join("")},q0=(X,Z)=>{const J=Z.format,W=Z.autoprefix||G8,Y=v(Z,Z.depth+1),B=[];for(let V in X)if(X.hasOwnProperty(V)){let z=X[V];if(b(z))z=z(X);if(F(z))z=z.map((U)=>F(U)?U.join(" "):U).join(J.ruleSep);if(W.has(V))for(let U of Z.vendors)B.push(`${Y}${U}${V}:${J.valSep}${z};`);B.push(`${Y}${V}:${J.valSep}${z};`)}return B.join(J.decls)+J.decls},v=(X,Z=X.depth)=>Z>1?[...d1(X.format.indent,Z)].join(""):Z>0?X.format.indent:"";var l1=function(X,...Z){const J=Z.length===1?Z[0]:{0:Z[0],100:Z[1]};return(W,Y)=>{const B=v(Y);Y.depth++;const V=v(Y);W.push(`${B}@keyframes ${X}${Y.format.declStart}`);for(let z in J)if(J.hasOwnProperty(z))W.push([V,z+"%",Y.format.declStart,q0(J[z],Y),V,Y.format.declEnd].join(""));return Y.depth--,W.push(B+Y.format.declEnd),W}};var p1=(X,Z=!1)=>(J,W)=>{const Y=v(W),B=v(W,W.depth+1);if(W.format.comments||Z)J.push(Y+"/*",X.split("\n").map((V)=>B+V).join("\n"),Y+"*/");return J};var _0=(X,Z,J)=>(W,Y)=>{const B=v(Y);return W.push(`${B}${X} ${I8(Z)}${Y.format.declStart}`),Y.depth++,Z0(W,[],J,Y),Y.depth--,W.push(B+Y.format.declEnd),W},I8=(X)=>{if(P(X))return X;const Z=[];for(let J in X)if(X.hasOwnProperty(J)){let W=X[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})`;Z.push(W)}return Z.join(" and ")},o1=new Set(["all","print","screen"]);var l=(X,Z)=>{return Z={format:x,vendors:g1,fns:{},depth:0,...Z},F(Z.autoprefix)&&(Z.autoprefix=new Set(Z.autoprefix)),A(X)?q0(X,Z):b(X)?X([],Z).join(Z.format.rules):Z0([],[],F(X)?X:R0(X)?[...X]:H("invalid rules"),Z).join(Z.format.rules)};var i1=(X,...Z)=>(J,W)=>(J.push(Z.length?`@import url(${X}) ${Z.join(W.format.ruleSep)};`:`@import url(${X});`),J);var J0=(X,Z)=>_0("@media",X,Z);var a1=function(...X){return(Z,J)=>(Z.push(X.length>1?`@namespace ${X[0]} url(${X[1]});`:`@namespace url(${X[0]});`),Z)};var t1=(X,Z)=>_0("@supports",X,Z);var p={"@comment":p1,"@import":i1,"@keyframes":l1,"@media":J0,"@namespace":a1,"@supports":t1};var r1=4,c1=(X)=>r1=X,D=(X)=>X===(X|0)?String(X):X.toFixed(r1).replace(/^0./,".").replace(/^-0./,"-.").replace(/0+$/,""),s1=(X)=>`${D(X)}em`,e1=(X)=>`${D(X)}ex`,X4=(X)=>`${D(X)}rem`,W1=(X)=>`${D(X)}%`,Z4=(X)=>`${D(X)}px`,J4=(X)=>`${D(X)}vh`,W4=(X)=>`${D(X)}vw`,Y4=(X)=>`${D(X)}vmin`,B4=(X)=>`${D(X)}vmax`,V4=(X)=>`${X|0}ms`,z4=(X)=>`${D(X)}s`;var U4=(X)=>`${D(X)}deg`,Q4=(X)=>`${D(X)}rad`,q4=(X)=>`${D(X)}turn`,$4=(X)=>`url(${X})`;var w=((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})(w||{}),I=((X)=>{return X[X.NEVER=0]="NEVER",X[X.FIRST=1]="FIRST",X[X.LAST=2]="LAST",X})(I||{});var R8=0,A8=()=>R8++,o=(X,Z)=>!Z||!Z.id?{...Z,id:X+"-"+A8()}:Z;var N=k0;class u{constructor(X,Z){this.wrapped=X,Z=o("sub",{closeIn:I.LAST,closeOut:I.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(v0()))}id;closeIn;closeOut;parent;__owner;xform;cacheLast;last=h;state=w.IDLE;subs=[];deref(){return this.last!==h?this.last:void 0}getState(){return this.state}setState(X){this.state=X}subscribe(X,Z={}){this.ensureState();let J;if(X instanceof u&&!Z.xform)X.ensureState(),j0(!X.parent,`sub '${X.id}' already has a parent`),X.parent=this,J=X;else J=new u(X,{...Z,parent:this});return this.subs.push(J),this.setState(w.ACTIVE),J.setState(w.ACTIVE),this.last!=h&&J.next(this.last),J}transform(...X){let Z,J;if(A(U0(X)))J=X.pop(),Z={error:J.error};return this.subscribe(Z,o("xform",X.length>0?{...J,xform:m(...X)}:J))}map(X,Z){return this.transform(O(X),Z||{})}unsubscribe(X){return X?this.unsubscribeChild(X):this.unsubscribeSelf()}unsubscribeSelf(){return N.debug(this.id,"unsub self"),this.parent&&this.parent.unsubscribe(this),this.state<w.UNSUBSCRIBED&&(this.state=w.UNSUBSCRIBED),this.release(),!0}unsubscribeChild(X){N.debug(this.id,"unsub child",X.id);const Z=this.subs.indexOf(X);if(Z>=0){if(this.subs.splice(Z,1),this.closeOut===I.FIRST||!this.subs.length&&this.closeOut!==I.NEVER)this.unsubscribe();return!0}return!1}next(X){if(this.state>=w.DONE)return;this.xform?this.dispatchXform(X):this.dispatch(X)}done(){if(N.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();N.debug(this.id,"exiting done()")}error(X){const Z=this.wrapped,J=Z&&Z.error;return J&&N.debug(this.id,"attempting wrapped error handler"),J&&Z.error(X)||this.unhandledError(X)}unhandledError(X){return(N!==k0?N:console).warn(this.id,"unhandled error:",X),this.unsubscribe(),this.state=w.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(B){if(X==="error"||!J.error||!J.error(B))return this.unhandledError(B)}}return!0}dispatch(X){N.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=f(X);for(let J=0,W=Z.length;J<W&&this.state<w.DONE;J++)this.dispatch(Z[J]);return this.state<w.ERROR}ensureState(){if(this.state>=w.DONE)s(`operation not allowed in state ${this.state}`)}release(){this.subs.length=0,delete this.parent,delete this.xform,delete this.last}}var K4=(X,Z)=>{const J=new H4(Z);return J.next(X),J};class H4 extends u{src;_cancel;_inited;constructor(X,Z){const[J,W]=b(X)?[X,Z||{}]:[void 0,X||{}];super(W.error?{error:W.error}:void 0,o("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!==I.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){N.debug(this.id,"cancel");const X=this._cancel;delete this._cancel,X()}}}var C4=(X,Z)=>X===I.FIRST||X===I.LAST&&!Z;var Y1=function(X){return X?A0(Y1(),X):X0(()=>({}),(Z,[J,W])=>(Z[J]=W,Z))};var B1=function(X,Z){return k(Z)?n(B1(X),Z):O(b(X)?(J)=>[X(J),J]:(J)=>[X,J])};var V1=function(...X){const Z=b0(V1,X);if(Z)return Z;const J=X[0],W=X[1]!==!1;return O((Y)=>{const B=W?{}:Y;for(let V in Y)B[V]=J(Y[V]);return B})};var M4=(X)=>X;var z1=function(...X){const Z=b0(z1,X,E0);if(Z)return Z;const{key:J,mergeOnly:W,reset:Y,all:B,backPressure:V}={key:M4,mergeOnly:!1,reset:!0,all:!0,backPressure:0,...X[1]},z=F(X[0])?new Set(X[0]):X[0],U=new Set,q=new Map;let Q={};const $=([K,S,a])=>{let L=!0;if(W||V<1)return[K,(M)=>{if(Y&&B&&U.size>0||!Y&&L)M=a(M,Q),Q={},U.clear(),L=!1;return S(M)},(M,_)=>{const E=J(_);if(z.has(E)){if(Q[E]=_,U.add(E),W||F4(z,U))if(M=a(M,Q),L=!1,Y)Q={},U.clear();else Q={...Q}}return M}];else return[K,(M)=>{if(B&&U.size>0)M=a(M,P4(q,U)),q.clear(),U.clear();return S(M)},(M,_)=>{const E=J(_);if(z.has(E)){let C0=q.get(E);!C0&&q.set(E,C0=[]),C0.length>=V&&s(`max back pressure (${V}) exceeded for input: ${String(E)}`),C0.push(_),U.add(E);while(F4(z,U))if(M=a(M,P4(q,U)),L=!1,j(M))break}return M}]};return $.keys=()=>z,$.clear=()=>{q.clear(),z.clear(),U.clear(),Q={}},$.add=(K)=>{z.add(K)},$.delete=(K,S=!0)=>{if(q.delete(K),z.delete(K),S)U.delete(K),delete Q[K]},$},F4=(X,Z)=>{if(Z.size<X.size)return!1;for(let J of X)if(!Z.has(J))return!1;return!0},P4=(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 O4=(X,Z)=>{let J=!0;for(let W of Z)J=X.removeID(W)&&J;return J};var w4=(X)=>new N4(X);class N4 extends u{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=V1((W)=>W[1]);super(void 0,o("streamsync",{...X,xform:X.xform?m(Z,J,X.xform):m(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 u?this.add(J[1]):this.next(J),done:()=>this.markDone(X),__owner:this},{xform:B1(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 N.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 O4(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){N.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),C4(this.closeIn,this.sources.size)&&this.done()}}var U1=t((X,Z=" ")=>{const J=r(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}}),u2=U1(2,"0"),g2=U1(3,"0"),D4=U1(4,"0");var Q1=function(X,Z){return k(Z)?n(Q1(X),Z):(J)=>{const W=J[2];return e(J,(Y,B)=>X(B)?W(Y,B):Y)}};import{watch as v4} from"fs";import{resolve as i} from"path";var G4={specs:P0({alias:"s",optional:!1,desc:"Path to generated JSON defs"})},y0={include:O0({alias:"I",desc:"Include CSS files (prepend)"})},k4={eval:P0({alias:"e",desc:"eval meta stylesheet in given string (ignores other inputs & includes)"})},j4={force:O0({alias:"f",hint:"STR",desc:"CSS classes to force include (wildcards are supported, @-prefix will read from file)",delim:","})},T4={media:O0({alias:"m",hint:"ID",desc:"Media query IDs (use 'ALL' for all)",delim:","})},I4={onlyDecls:T({desc:"Only emit framework decls"})},W0={out:P0({alias:"o",desc:"Output file (or stdout)"})},Y0={pretty:T({alias:"p",desc:"Pretty print output"})},h0={noDecls:T({alias:"d",desc:"Don't emit framework decls"})},m0={noHeader:T({desc:"Don't emit generated header comment"})},R4={watch:T({alias:"w",desc:"Watch input files for changes"})};import{resolve as v8} from"path";var B0=(X,Z,J)=>{Z=P(Z)?Z:Z.join("\n"),X?r0(v8(X),Z,J):process.stdout.write(Z+"\n")},f0=({info:{name:X,version:Z}})=>`/*! ${X} v${Z} - generated by thi.ng/meta-css @ ${(new Date()).toISOString()} */`;var E4={desc:"Transpile (and optionally bundle) meta stylesheets to CSS",opts:{...k4,...h0,...j4,...y0,...m0,...W0,...Y0,...G4,...R4,bundle:T({alias:"b",desc:"Bundle inputs (see `out` option)"}),noWrite:T({desc:"Don't write files, use stdout only"})},fn:async(X)=>{const Z=y(i(X.opts.specs),X.logger),J=_8(Z,X.opts.force||[],X.logger);if(X.opts.bundle)if(X.opts.watch)await b8(X,Z,J);else $0(X,Z,J,X.opts.eval?[X.opts.eval]:X.inputs.map((W)=>G(i(W),X.logger)),X.opts.out);else if(X.opts.watch)await E8(X,Z,J);else if(X.opts.eval)try{$0(X,Z,J,[X.opts.eval])}catch(W){X.logger.warn(W.message)}else for(let W of X.inputs)try{W=i(W);const Y=!X.opts.noWrite?W.replace(/\.mcss$/,".css"):void 0;$0(X,Z,J,[G(W,X.logger)],Y)}catch(Y){X.logger.warn(Y.message)}}},E8=async(X,Z,J)=>{let W;const Y=()=>{X.logger.info("closing watchers..."),W.forEach((B)=>B.close())};W=X.inputs.map((B)=>{B=i(B);const V=!X.opts.noWrite?B.replace(/\.mcss$/,".css"):void 0,z=()=>{try{return $0(X,Z,J,[G(B,X.logger)],V),!0}catch(U){if(X.logger.warn(U.message+": "+B),W)Y()}};if(!z())process.exit(1);return v4(B,{},(U)=>{if(U==="change")z();else X.logger.warn("input removed:",B),Y()})}),X.logger.info("waiting for changes, press ctrl+c to cancel..."),process.on("SIGINT",Y)},b8=async(X,Z,J)=>{const W=()=>{X.logger.info("closing watchers..."),Y.forEach((B)=>B.watcher.close())},Y=X.inputs.map((B,V)=>{B=i(B);const z=K4(G(B,X.logger),{id:`in${D4(V)}`});return{input:z,watcher:v4(B,{},(U)=>{if(U==="change")try{z.next(G(B,X.logger))}catch(q){X.logger.warn(q.message),W()}else X.logger.warn("input removed:",B),W()})}});w4({src:Y1(O(({input:B})=>[B.id,B],Y))}).subscribe({next(B){try{$0(X,Z,J,Object.keys(B).sort().map((V)=>B[V]),X.opts.out)}catch(V){X.logger.warn(V.message)}}}),process.on("SIGINT",W)},$0=({logger:X,opts:{include:Z,noDecls:J,noHeader:W,pretty:Y}},B,V,z,U)=>{const q={logger:X,specs:B,format:Y?Q0:x,mediaQueryIDs:new Set(Object.keys(B.media)),mediaQueryRules:{...V.mediaQueryRules},plainRules:{...V.plainRules}},Q=Z?Z.map(($)=>G(i($),X).trim()):[];if(!W)Q.push(f0(B));if(!J&&B.decls.length)Q.push(l(B.decls,{format:q.format,fns:p}));z.forEach(($)=>y8($,q)),L8(Q,q),S8(Q,q),B0(U,Q,X)},S8=(X,{logger:Z,specs:J,format:W,mediaQueryRules:Y})=>{for(let B in Y){const V=S4(Y[B],J);Z.debug("mediaquery rules",B,V),X.push(l(J0(f8(J.media,B),V),{format:W,fns:p}))}},L8=(X,{logger:Z,specs:J,format:W,plainRules:Y})=>{const B=S4(Y,J);Z.debug("plain rules",B),X.push(l(B,{format:W,fns:p}))},_8=(X,Z,J)=>{const W=new Set(Object.keys(X.media)),Y=new Set(Object.keys(X.classes)),B={},V={};if(Z.length&&Z[0][0]==="@")Z=[...g(G(i(Z[0].substring(1)),J))];for(let z of Z){if(!z||z.startsWith("//"))continue;const{token:U,query:q}=L4(z,W);let Q;if(U.includes("*")){const $=new RegExp(`^${U.replace("*",".*")}\$`);Q=[...Q1((K)=>$.test(K),Y)]}else if(Y.has(U))Q=[U];else{J.warn(`unknown include rule ID: ${z}, skipping...`);continue}for(let $ of Q)J.debug("including class:",$),q?_4(B,q,`.${$}`,$):y4(V,`.${$}`,$)}return{mediaQueryRules:B,plainRules:V}},y8=(X,{specs:Z,mediaQueryIDs:J,mediaQueryRules:W,plainRules:Y})=>{const B=K0(),V=K0(B),z={root:B,curr:V,scopes:[V]};for(let U of g(X)){if(!U||/^\s*\/\//.test(U))continue;for(let q of g(U,/\s+/g)){if(!q)continue;let Q=z.curr;switch(Q.state){case"sel":case"nest":if(q==="{"){if(Q.state==="sel")Q.sel=Q.sel.map(($)=>$.replace(",","")),Q.path=h8(z.scopes);Q.state="class"}else if(q==="}")A4(z);else{const $=U0(Q.sel);if(!$||$.endsWith(","))Q.sel.push(q);else Q.sel[Q.sel.length-1]+=" "+q}break;case"class":if(q==="{")Q.state="nest",z.scopes.push(z.curr=K0(Q));else if(q==="}")A4(z);else{let{token:$,query:K}=L4(q,J);if(!Z.classes[$]&&!$.includes("="))H(`unknown class ID: ${$}`);if(K)_4(W,K,Q.path,$);else y4(Y,Q.path,$)}break;default:s(Q.state)}}}},q1=":",b4="///",K0=(X)=>({state:"sel",sel:X?[]:["<root>"],path:"",parent:X}),A4=(X)=>{const Z=!X.curr.sel.length;if(j0(!!X.curr.parent,"stack underflow"),X.scopes.pop(),X.scopes.length>0){if(X.curr=U0(X.scopes),!Z&&X.curr.state==="nest")X.scopes.push(X.curr=K0(X.curr))}else X.scopes.push(X.curr=K0(X.root))},h8=(X)=>X.map((Z)=>Z.sel.join(",")).join(b4),S4=(X,Z)=>Object.entries(X).map(([J,W])=>m8(J,W,Z)),m8=(X,Z,J)=>{const W=[];let Y=W;const B=X.split(b4);for(let V=0;V<B.length;V++){const z=B[V].split(",");if(V==B.length-1){const U=Object.assign({},...O((q)=>u8(J,q),Z));if("__user"in U)delete U.__user;z.push(U)}Y.push(z),Y=z}return W[0]},L4=(X,Z)=>{if(/^::?/.test(X))return{token:X};const J=X.lastIndexOf(q1);if(J<0)return{token:X};const W=X.substring(0,J);if(!W.split(q1).every((B)=>Z.has(B)))H(`invalid media query in token: ${X}`);return{token:X.substring(J+1),query:W}},f8=(X,Z)=>Z.split(q1).reduce((J,W)=>Object.assign(J,X[W]),{}),_4=(X,Z,J,W)=>{if(!X[Z])X[Z]={};(X[Z][J]||(X[Z][J]=new Set)).add(W)},y4=(X,Z,J)=>(X[Z]||(X[Z]=new Set)).add(J),u8=(X,Z)=>{const J=Z.indexOf("=");return J>0?{[`--${Z.substring(0,J)}`]:Z.substring(J+1)}:X.classes[Z]};import{resolve as h4} from"path";var f4={desc:"Export entire generated framework as CSS",opts:{...y0,...h0,...I4,...W0,...Y0,...m0,...T4},inputs:1,fn:async(X)=>{const{logger:Z,opts:{include:J,media:W,noDecls:Y,noHeader:B,onlyDecls:V,pretty:z,out:U},inputs:q}=X,Q=y(h4(q[0]),Z),$=J?J.map((K)=>G(h4(K),Z).trim()):[];if(!B)$.push(f0(Q));if(!Y&&Q.decls.length)$.push(l(Q.decls,{format:z?Q0:x,fns:p}));if(!V)$.push(g8(Q,W,z,Z));B0(U,$,Z)}},g8=(X,Z,J,W)=>{const Y=m4("",X);if(Z){const B=Z[0]==="ALL"?Object.keys(X.media):Z;for(let V of B)if(X.media[V])Y.push(J0(X.media[V],m4("-"+V,X)));else W.warn(`invalid media query ID: ${V}, skipping...`)}return l(Y,{format:J?Q0:x,fns:p})},m4=(X,Z)=>Object.entries(Z.classes).map(([J,W])=>[`.${J}${X}`,x8(W)]),x8=(X)=>{if("__user"in X)X={...X},delete X.__user;return X};import{resolve as d8} from"path";var u4={deg:U4,em:s1,ex:e1,ms:V4,percent:W1,px:Z4,rad:Q4,rem:X4,second:z4,turn:q4,url:$4,vh:J4,vmax:B4,vmin:Y4,vw:W4,"%":W1},n8={"":[""],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"]},g4={desc:"Generate framework rules from specs",opts:{...W0,...Y0,prec:O1({default:3,desc:"Number of fractional digits"})},fn:async(X)=>{const{logger:Z,opts:{prec:J,out:W,pretty:Y},inputs:B}=X,V={info:{name:"TODO",version:"0.0.0"},media:{},classes:{},decls:[]};c1(J);for(let z of B){const U=y(d8(z),Z);if(Object.assign(V.info,U.info),Object.assign(V.media,U.media),U.decls)V.decls.push(...U.decls);for(let q of U.specs)l8(U,q,V.classes,Z)}B0(W,JSON.stringify(V,null,Y?4:0),Z)}},l8=(X,Z,J,W)=>{const Y=F(Z.vars)?Z.vars:[""],B=P(Z.props)?{[Z.props]:"<v>"}:Z.props,V=p8(Z,X),z=new Set;for(let U of Y)for(let[q,Q]of S0(X.vars?.[U]||n8[U],Object.keys(V))){const $=H0(Z.name,U,q,Q,V[Q]),K=Z.unit?H0(Z.unit,U,q,Q,V[Q]):void 0,S=o8(V[Q],K);if(!J[$])J[$]=Z.user!=null?{__user:H0(Z.user,U,q,Q,V[Q])}:{};else if(!z.has($))H(`duplicate class ID: ${$}`);z.add($);for(let[a,L]of Object.entries(B)){const M=H0(a,U,q,Q,V[Q]),_=H0(!K||P(L)?String(L):u4[K](L),U,q,Q,S);J[$][M]=_,W.debug($,M,_)}}return J},p8=(X,Z)=>{const J=P(X.values)?Z.tables?.[X.values]||H(`invalid table ID: ${X.values}`):X.values;if(A(J))return J;const W=X.key==="v"?(Y)=>String(Y):X.key==="i+1"?(Y,B)=>String(B+1):X.key===void 0?(Y,B)=>String(B):H(`invalid key type: ${X.key}`);return J.reduce((Y,B,V)=>{return Y[W(B,V)]=B,Y},{})},o8=(X,Z)=>{if(!Z||P(X))return X;const J=u4[Z];if(!J)H(`invalid unit: ${Z}`);return J(X)},H0=(X,Z,J,W,Y)=>X.replace("<vid>",Z).replace("<var>",J).replace("<k>",W).replace("<v>",String(Y));var $1=y(i8(import.meta.dir,"package.json"));y1({name:"metacss",opts:{verbose:T({alias:"v",desc:"Display extra process information"})},commands:{convert:E4,export:f4,generate:g4},ctx:async(X)=>{if(X.opts.verbose)X.logger.level=C.DEBUG;return{...X,format:D0}},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 ${$1.name} ${$1.version}
|
|
9
|
+
\u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 ${$1.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.6.1",
|
|
4
4
|
"description": "Data-driven CSS framework codegen, transpiler & bundler",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -38,19 +38,18 @@
|
|
|
38
38
|
"test": "bun test"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@thi.ng/api": "^8.9.
|
|
42
|
-
"@thi.ng/args": "^2.3.
|
|
43
|
-
"@thi.ng/arrays": "^2.7.
|
|
44
|
-
"@thi.ng/checks": "^3.4.
|
|
45
|
-
"@thi.ng/
|
|
46
|
-
"@thi.ng/
|
|
47
|
-
"@thi.ng/
|
|
48
|
-
"@thi.ng/
|
|
49
|
-
"@thi.ng/
|
|
50
|
-
"@thi.ng/
|
|
51
|
-
"@thi.ng/
|
|
52
|
-
"@thi.ng/
|
|
53
|
-
"@thi.ng/transducers": "^8.8.20"
|
|
41
|
+
"@thi.ng/api": "^8.9.18",
|
|
42
|
+
"@thi.ng/args": "^2.3.6",
|
|
43
|
+
"@thi.ng/arrays": "^2.7.15",
|
|
44
|
+
"@thi.ng/checks": "^3.4.18",
|
|
45
|
+
"@thi.ng/errors": "^2.4.11",
|
|
46
|
+
"@thi.ng/file-io": "^1.2.0",
|
|
47
|
+
"@thi.ng/hiccup-css": "^2.4.1",
|
|
48
|
+
"@thi.ng/logger": "^2.1.4",
|
|
49
|
+
"@thi.ng/rstream": "^8.2.21",
|
|
50
|
+
"@thi.ng/strings": "^3.7.9",
|
|
51
|
+
"@thi.ng/text-format": "^2.0.5",
|
|
52
|
+
"@thi.ng/transducers": "^8.8.22"
|
|
54
53
|
},
|
|
55
54
|
"devDependencies": {
|
|
56
55
|
"@microsoft/api-extractor": "^7.39.0",
|
|
@@ -105,5 +104,5 @@
|
|
|
105
104
|
"status": "alpha",
|
|
106
105
|
"year": 2023
|
|
107
106
|
},
|
|
108
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "7426e2ae6fca5482c6eaf649872296fc89955374\n"
|
|
109
108
|
}
|
package/specs/anim.mcss.json
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"decls": [
|
|
2
|
+
"decls": [
|
|
3
|
+
["@keyframes", "fadein", { "opacity": 0 }, { "opacity": 1 }],
|
|
4
|
+
["@keyframes", "fadeout", { "opacity": 1 }, { "opacity": 0 }],
|
|
5
|
+
["@keyframes", "spin", { "rotate": 0 }, { "rotate": "1turn" }]
|
|
6
|
+
],
|
|
7
|
+
"vars": {
|
|
8
|
+
"in": [""],
|
|
9
|
+
"out": [""]
|
|
10
|
+
},
|
|
3
11
|
"specs": [
|
|
4
12
|
{
|
|
5
13
|
"user": "animations / transitions",
|
|
6
|
-
"name": "
|
|
14
|
+
"name": "fade<vid><k>",
|
|
7
15
|
"key": "i+1",
|
|
8
|
-
"props": { "animation": "
|
|
16
|
+
"props": { "animation": "fade<vid> <v> ease-in-out forwards" },
|
|
9
17
|
"values": [0.25, 0.5, 1],
|
|
10
|
-
"unit": "second"
|
|
18
|
+
"unit": "second",
|
|
19
|
+
"vars": ["in", "out"]
|
|
11
20
|
},
|
|
12
21
|
{
|
|
13
22
|
"user": "animations / transitions",
|
|
@@ -16,6 +25,20 @@
|
|
|
16
25
|
"props": { "transition": "<v> background-color ease-in-out" },
|
|
17
26
|
"values": [0.15, 0.25, 0.5],
|
|
18
27
|
"unit": "second"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"user": "animations / transitions",
|
|
31
|
+
"name": "spin<k>",
|
|
32
|
+
"key": "i+1",
|
|
33
|
+
"props": { "animation": "spin <v> linear infinite" },
|
|
34
|
+
"values": [0.75, 1.5, 2.5],
|
|
35
|
+
"unit": "second"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"user": "animations / transitions",
|
|
39
|
+
"name": "anim-<v>",
|
|
40
|
+
"props": "animation-direction",
|
|
41
|
+
"values": ["normal", "reverse", "alternate", "alternate-reverse"]
|
|
19
42
|
}
|
|
20
43
|
]
|
|
21
44
|
}
|
package/specs/aspect.mcss.json
CHANGED
|
@@ -3,25 +3,47 @@
|
|
|
3
3
|
{
|
|
4
4
|
"user": "aspect ratios",
|
|
5
5
|
"name": "aspect-ratio-<k>",
|
|
6
|
+
"props": "aspect-ratio",
|
|
7
|
+
"values": {
|
|
8
|
+
"1x1": "1/1",
|
|
9
|
+
"1x2": "1/2",
|
|
10
|
+
"2x1": "2/1",
|
|
11
|
+
"2x3": "2/3",
|
|
12
|
+
"3x2": "3/2",
|
|
13
|
+
"3x4": "3/4",
|
|
14
|
+
"4x3": "4/3",
|
|
15
|
+
"5x7": "5/7",
|
|
16
|
+
"7x5": "7/5",
|
|
17
|
+
"9x16": "9/16",
|
|
18
|
+
"16x9": "16/9"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"user": "aspect ratios",
|
|
23
|
+
"name": "bg-aspect-ratio-<k>",
|
|
6
24
|
"props": {
|
|
7
25
|
"height": 0,
|
|
8
26
|
"position": "relative",
|
|
9
27
|
"padding-bottom": "<v>"
|
|
10
28
|
},
|
|
11
29
|
"values": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
30
|
+
"1x1": 100,
|
|
31
|
+
"1x2": 200,
|
|
32
|
+
"2x1": 50,
|
|
33
|
+
"2x3": 150,
|
|
34
|
+
"3x2": 66.6666,
|
|
15
35
|
"3x4": 133.3333,
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
36
|
+
"4x3": 75,
|
|
37
|
+
"5x7": 140,
|
|
38
|
+
"7x5": 71.4286,
|
|
39
|
+
"9x16": 177.7777,
|
|
40
|
+
"16x9": 56.25
|
|
19
41
|
},
|
|
20
42
|
"unit": "%"
|
|
21
43
|
},
|
|
22
44
|
{
|
|
23
45
|
"user": "aspect ratios",
|
|
24
|
-
"name": "aspect-ratio-object",
|
|
46
|
+
"name": "bg-aspect-ratio-object",
|
|
25
47
|
"props": {
|
|
26
48
|
"position": "absolute",
|
|
27
49
|
"top": 0,
|
package/specs/colors.mcss.json
CHANGED
|
@@ -70,64 +70,64 @@
|
|
|
70
70
|
"specs": [
|
|
71
71
|
{
|
|
72
72
|
"user": "colors",
|
|
73
|
-
"name": "b--
|
|
73
|
+
"name": "b--color<k>",
|
|
74
74
|
"key": "i+1",
|
|
75
75
|
"props": { "border-color": "<v>" },
|
|
76
76
|
"values": "var-palette"
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
"user": "colors",
|
|
80
|
-
"name": "b
|
|
80
|
+
"name": "b--color-<k>",
|
|
81
81
|
"props": "border-color",
|
|
82
82
|
"values": "palette"
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
"user": "colors",
|
|
86
|
-
"name": "b
|
|
86
|
+
"name": "b--color-<k>",
|
|
87
87
|
"props": "border-color",
|
|
88
88
|
"values": "grays"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
"user": "colors",
|
|
92
|
-
"name": "
|
|
92
|
+
"name": "color<k>",
|
|
93
93
|
"key": "i+1",
|
|
94
94
|
"props": { "color": "<v>" },
|
|
95
95
|
"values": "var-palette"
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
"user": "colors",
|
|
99
|
-
"name": "
|
|
99
|
+
"name": "color-<k>",
|
|
100
100
|
"props": "color",
|
|
101
101
|
"values": "palette"
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
"user": "colors",
|
|
105
|
-
"name": "
|
|
105
|
+
"name": "color-<k>",
|
|
106
106
|
"props": "color",
|
|
107
107
|
"values": "grays"
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
"user": "colors",
|
|
111
|
-
"name": "bg-
|
|
111
|
+
"name": "bg-color<k>",
|
|
112
112
|
"key": "i+1",
|
|
113
113
|
"props": { "background-color": "<v>" },
|
|
114
114
|
"values": "var-palette"
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
117
|
"user": "colors",
|
|
118
|
-
"name": "bg-<k>",
|
|
118
|
+
"name": "bg-color-<k>",
|
|
119
119
|
"props": "background-color",
|
|
120
120
|
"values": "palette"
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
"user": "colors",
|
|
124
|
-
"name": "bg-<k>",
|
|
124
|
+
"name": "bg-color-<k>",
|
|
125
125
|
"props": "background-color",
|
|
126
126
|
"values": "grays"
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
"user": "colors",
|
|
130
|
-
"name": "<var>-
|
|
130
|
+
"name": "<var>-color<k>",
|
|
131
131
|
"key": "i+1",
|
|
132
132
|
"props": { "<var>": "<v>" },
|
|
133
133
|
"values": "var-palette",
|
|
@@ -135,14 +135,14 @@
|
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
"user": "colors",
|
|
138
|
-
"name": "<var
|
|
138
|
+
"name": "<var>-color-<k>",
|
|
139
139
|
"props": { "<var>": "<v>" },
|
|
140
140
|
"values": "palette",
|
|
141
141
|
"vars": ["fill-stroke"]
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
144
|
"user": "colors",
|
|
145
|
-
"name": "<var
|
|
145
|
+
"name": "<var>-color-<k>",
|
|
146
146
|
"props": { "<var>": "<v>" },
|
|
147
147
|
"values": "grays",
|
|
148
148
|
"vars": ["fill-stroke"]
|
package/specs/display.mcss.json
CHANGED
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
"specs": [
|
|
3
3
|
{
|
|
4
4
|
"user": "display mode",
|
|
5
|
-
"name": "
|
|
5
|
+
"name": "<k>",
|
|
6
6
|
"props": "display",
|
|
7
7
|
"values": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
8
|
+
"db": "block",
|
|
9
|
+
"flex": "flex",
|
|
10
|
+
"grid": "grid",
|
|
11
|
+
"di": "inline",
|
|
12
|
+
"dib": "inline-block",
|
|
13
|
+
"dif": "inline-flex",
|
|
14
|
+
"dig": "inline-grid",
|
|
15
|
+
"dn": "none",
|
|
16
|
+
"dt": "table",
|
|
17
|
+
"dtc": "table-cell",
|
|
18
|
+
"dtr": "table-row"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"user": "visibility",
|
|
23
23
|
"name": "<v>",
|
|
24
24
|
"props": { "visibility": "<v> !important" },
|
|
25
|
-
"values": ["hidden", "visible"]
|
|
25
|
+
"values": ["hidden", "visible", "collapse"]
|
|
26
26
|
}
|
|
27
27
|
]
|
|
28
28
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tables": {
|
|
3
|
+
"align": ["start", "end", "center"]
|
|
4
|
+
},
|
|
5
|
+
"vars": {
|
|
6
|
+
"align": [""],
|
|
7
|
+
"justify": [""],
|
|
8
|
+
"grow": [""],
|
|
9
|
+
"shrink": [""]
|
|
10
|
+
},
|
|
11
|
+
"specs": [
|
|
12
|
+
{
|
|
13
|
+
"user": "flex layout",
|
|
14
|
+
"name": "flex-<v>",
|
|
15
|
+
"props": "flex-direction",
|
|
16
|
+
"values": ["column", "column-reverse", "row", "row-reverse"]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"user": "flex layout",
|
|
20
|
+
"name": "<vid>-content-<v>",
|
|
21
|
+
"props": "<vid>-content",
|
|
22
|
+
"values": "align",
|
|
23
|
+
"vars": ["align", "justify"]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"user": "flex layout",
|
|
27
|
+
"name": "flex-<v>",
|
|
28
|
+
"props": "flex-wrap",
|
|
29
|
+
"values": ["wrap", "nowrap", "wrap-reverse"]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"user": "flex layout",
|
|
33
|
+
"name": "flex-<vid><v>",
|
|
34
|
+
"props": "flex-<vid>",
|
|
35
|
+
"values": [0, 1],
|
|
36
|
+
"vars": ["grow", "shrink"]
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
package/specs/grids.mcss.json
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"align": ["start", "end", "center", "stretch"]
|
|
4
4
|
},
|
|
5
5
|
"vars": {
|
|
6
|
-
"align": ["
|
|
7
|
-
"justify": ["
|
|
6
|
+
"align": [""],
|
|
7
|
+
"justify": [""],
|
|
8
8
|
"cols": ["columns"],
|
|
9
9
|
"rows": ["rows"]
|
|
10
10
|
},
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"user": "grid layout",
|
|
47
|
-
"name": "<
|
|
48
|
-
"props": "<
|
|
47
|
+
"name": "<vid>-self-<v>",
|
|
48
|
+
"props": "<vid>-self",
|
|
49
49
|
"values": "align",
|
|
50
50
|
"vars": ["align", "justify"]
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"user": "grid layout",
|
|
54
|
-
"name": "<
|
|
55
|
-
"props": "<
|
|
54
|
+
"name": "<vid>-items-<v>",
|
|
55
|
+
"props": "<vid>-items",
|
|
56
56
|
"values": "align",
|
|
57
57
|
"vars": ["align", "justify"]
|
|
58
58
|
}
|
package/specs/margins.mcss.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"tables": {
|
|
3
|
-
"margins": [0, 0.25, 0.5, 1, 2]
|
|
3
|
+
"margins": [0, 0.25, 0.5, 1, 2, 4]
|
|
4
|
+
},
|
|
5
|
+
"vars": {
|
|
6
|
+
"s": ["start"],
|
|
7
|
+
"e": ["end"]
|
|
4
8
|
},
|
|
5
9
|
"specs": [
|
|
6
10
|
{
|
|
@@ -27,6 +31,22 @@
|
|
|
27
31
|
"margin-right": "<v>"
|
|
28
32
|
},
|
|
29
33
|
"values": { "center": "auto" }
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"user": "padding",
|
|
37
|
+
"name": "pb<vid>-<k>",
|
|
38
|
+
"props": "padding-block-<var>",
|
|
39
|
+
"values": "margins",
|
|
40
|
+
"unit": "rem",
|
|
41
|
+
"vars": ["s", "e"]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"user": "margin",
|
|
45
|
+
"name": "mb<vid>-<k>",
|
|
46
|
+
"props": "margin-block-<var>",
|
|
47
|
+
"values": "margins",
|
|
48
|
+
"unit": "rem",
|
|
49
|
+
"vars": ["s", "e"]
|
|
30
50
|
}
|
|
31
51
|
]
|
|
32
52
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"decls": [
|
|
3
3
|
["@comment", "----- start: CSS normalization -----"],
|
|
4
|
+
["@comment", "based on: https://github.com/necolas/normalize.css"],
|
|
4
5
|
[":root", { "font-size": "16px" }],
|
|
5
6
|
["html", { "line-height": 1.15, "-webkit-text-size-adjust": "100%" }],
|
|
6
7
|
["body", { "margin": 0 }],
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"vars": {
|
|
3
|
+
"after": [""],
|
|
4
|
+
"before": [""]
|
|
5
|
+
},
|
|
6
|
+
"specs": [
|
|
7
|
+
{
|
|
8
|
+
"user": "print",
|
|
9
|
+
"name": "break-<vid>-<v>",
|
|
10
|
+
"props": "break-<vid>",
|
|
11
|
+
"values": [
|
|
12
|
+
"avoid",
|
|
13
|
+
"avoid-column",
|
|
14
|
+
"avoid-page",
|
|
15
|
+
"column",
|
|
16
|
+
"left",
|
|
17
|
+
"right",
|
|
18
|
+
"page",
|
|
19
|
+
"recto",
|
|
20
|
+
"verso"
|
|
21
|
+
],
|
|
22
|
+
"vars": ["after", "before"]
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"specs": [
|
|
3
|
+
{
|
|
4
|
+
"user": "scrolling",
|
|
5
|
+
"name": "ss-<v>",
|
|
6
|
+
"props": {
|
|
7
|
+
"scroll-snap-type": "<v> mandatory"
|
|
8
|
+
},
|
|
9
|
+
"values": ["x", "y", "both"]
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"user": "scrolling",
|
|
13
|
+
"name": "ss-<v>",
|
|
14
|
+
"props": "scroll-snap-align",
|
|
15
|
+
"values": ["start", "end", "center"]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"user": "scrolling",
|
|
19
|
+
"name": "ss-<v>",
|
|
20
|
+
"props": "scroll-snap-stop",
|
|
21
|
+
"values": ["normal", "always"]
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|