@maccesar/titools 3.2.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -61
- package/lib/cleanup.js +29 -0
- package/lib/commands/agents.js +8 -7
- package/lib/commands/skills.js +118 -23
- package/lib/config.js +13 -15
- package/lib/installer.js +5 -3
- package/lib/utils.js +36 -0
- package/package.json +1 -1
- package/skills/alloy-guides/SKILL.md +188 -0
- package/skills/alloy-guides/references/CLI_TASKS.md +233 -0
- package/skills/alloy-guides/references/CONCEPTS.md +171 -0
- package/skills/alloy-guides/references/CONTROLLERS.md +279 -0
- package/skills/alloy-guides/references/MODELS.md +742 -0
- package/skills/alloy-guides/references/MODELS_ADVANCED.md +482 -0
- package/skills/alloy-guides/references/PURGETSS.md +57 -0
- package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +235 -0
- package/skills/alloy-guides/references/VIEWS_STYLES.md +375 -0
- package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +102 -0
- package/skills/alloy-guides/references/VIEWS_XML.md +581 -0
- package/skills/alloy-guides/references/WIDGETS.md +160 -0
- package/skills/alloy-howtos/SKILL.md +179 -0
- package/skills/alloy-howtos/references/best_practices.md +121 -0
- package/skills/alloy-howtos/references/cli_reference.md +230 -0
- package/skills/alloy-howtos/references/config_files.md +158 -0
- package/skills/alloy-howtos/references/custom_tags.md +148 -0
- package/skills/alloy-howtos/references/debugging_troubleshooting.md +78 -0
- package/skills/alloy-howtos/references/samples.md +156 -0
- package/skills/purgetss/SKILL.md +184 -181
- package/skills/purgetss/references/EXAMPLES.md +8 -6
- package/skills/purgetss/references/app-branding.md +5 -0
- package/skills/purgetss/references/apply-directive.md +1 -1
- package/skills/purgetss/references/class-categories.md +1 -1
- package/skills/purgetss/references/class-index-properties.md +618 -0
- package/skills/purgetss/references/class-index.md +4 -610
- package/skills/purgetss/references/cli-commands.md +41 -410
- package/skills/purgetss/references/custom-fonts.md +292 -0
- package/skills/purgetss/references/custom-rules.md +1 -1
- package/skills/purgetss/references/customization-deep-dive.md +64 -1
- package/skills/purgetss/references/icon-fonts.md +208 -118
- package/skills/purgetss/references/installation-setup.md +4 -4
- package/skills/purgetss/references/migration-guide.md +53 -1
- package/skills/purgetss/references/multi-density-images.md +53 -2
- package/skills/purgetss/references/svg-pipeline.md +249 -0
- package/skills/purgetss/references/tikit-components.md +2 -2
- package/skills/purgetss/references/titanium-resets.md +2 -2
- package/skills/purgetss/references/ui-ux-design.md +7 -5
- package/skills/purgetss/references/version-history.md +71 -82
- package/skills/ti-api/SKILL.md +128 -0
- package/skills/ti-api/references/api-android.md +675 -0
- package/skills/ti-api/references/api-app-platform.md +636 -0
- package/skills/ti-api/references/api-core.md +764 -0
- package/skills/ti-api/references/api-data-network.md +641 -0
- package/skills/ti-api/references/api-media.md +655 -0
- package/skills/ti-api/references/api-modules-ble-bluetooth.md +657 -0
- package/skills/ti-api/references/api-modules-coremotion-urlsession.md +411 -0
- package/skills/ti-api/references/api-modules-map.md +632 -0
- package/skills/ti-api/references/api-modules-nfc.md +725 -0
- package/skills/ti-api/references/api-modules-social-misc.md +526 -0
- package/skills/ti-api/references/api-services.md +700 -0
- package/skills/ti-api/references/api-ui-android.md +499 -0
- package/skills/ti-api/references/api-ui-extras.md +702 -0
- package/skills/ti-api/references/api-ui-ios-animator.md +378 -0
- package/skills/ti-api/references/api-ui-ios.md +756 -0
- package/skills/ti-api/references/api-ui-lists.md +581 -0
- package/skills/ti-api/references/api-ui-text-input.md +607 -0
- package/skills/ti-api/references/api-ui-views.md +572 -0
- package/skills/ti-api/references/api-ui-windows-navigation.md +676 -0
- package/skills/ti-api/references/api-xml-global.md +743 -0
- package/skills/ti-guides/SKILL.md +82 -0
- package/skills/ti-guides/references/advanced-data-and-images.md +155 -0
- package/skills/ti-guides/references/android-manifest.md +97 -0
- package/skills/ti-guides/references/app-distribution.md +373 -0
- package/skills/ti-guides/references/application-frameworks.md +366 -0
- package/skills/ti-guides/references/cli-reference.md +700 -0
- package/skills/ti-guides/references/coding-best-practices.md +150 -0
- package/skills/ti-guides/references/commonjs-advanced.md +279 -0
- package/skills/ti-guides/references/hello-world.md +99 -0
- package/skills/ti-guides/references/hyperloop-native-access.md +458 -0
- package/skills/ti-guides/references/javascript-primer.md +402 -0
- package/skills/ti-guides/references/reserved-words.md +36 -0
- package/skills/ti-guides/references/resources.md +172 -0
- package/skills/ti-guides/references/style-and-conventions.md +104 -0
- package/skills/ti-guides/references/tiapp-config.md +655 -0
- package/skills/ti-howtos/SKILL.md +131 -0
- package/skills/ti-howtos/references/android-platform-deep-dives.md +609 -0
- package/skills/ti-howtos/references/automation-fastlane-appium.md +96 -0
- package/skills/ti-howtos/references/buffer-codec-streams.md +162 -0
- package/skills/ti-howtos/references/cross-platform-development.md +358 -0
- package/skills/ti-howtos/references/debugging-profiling.md +473 -0
- package/skills/ti-howtos/references/extending-titanium.md +684 -0
- package/skills/ti-howtos/references/google-maps-v2.md +172 -0
- package/skills/ti-howtos/references/ios-map-kit.md +149 -0
- package/skills/ti-howtos/references/ios-platform-deep-dives.md +595 -0
- package/skills/ti-howtos/references/local-data-sources.md +310 -0
- package/skills/ti-howtos/references/location-and-maps.md +267 -0
- package/skills/ti-howtos/references/media-apis.md +268 -0
- package/skills/ti-howtos/references/notification-services.md +539 -0
- package/skills/ti-howtos/references/remote-data-sources.md +339 -0
- package/skills/ti-howtos/references/tutorials.md +552 -0
- package/skills/ti-howtos/references/using-modules.md +182 -0
- package/skills/ti-howtos/references/web-content-integration.md +288 -0
- package/skills/ti-howtos/references/webpack-build-pipeline.md +125 -0
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
# PurgeTSS CLI Commands
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
> - **Opacity modifiers on semantic colors (v7.9.0)** — writing `bg-surface/65` (or any opacity modifier on a class mapped to a name in `semantic.colors.json`) now produces a working rule with Light/Dark switching preserved. PurgeTSS auto-derives a `<originalKey>_<alphaPercent>` entry in `semantic.colors.json` with the original `light`/`dark` hex values plus the requested alpha for both modes, then emits the rule against the derived key. Re-runs are idempotent; manual edits with conflicting values halt the build with a `Conflict` error. New alpha entries require one full Titanium build to be picked up — Liveview hot-reload alone does not refresh `semantic.colors.json`.
|
|
5
|
-
> - **Gradient + Window/View/ImageView preset fixes (v7.9.0)** — `theme.Window` / `theme.View` / `theme.ImageView` no longer leak the framework presets (white background, `Ti.UI.SIZE`, iOS `hires: true`) when defined at the top level (replace mode), so a Window declared at `theme.Window` with a `backgroundGradient` no longer ghosts on top of a default `backgroundColor: '#FFFFFF'`. `theme.extend.Window` keeps merging with the defaults as before. Also fixed: tonal palette inversion bug, position-dependent `from`/`to` color ordering after `sort()`, and `bg-gradient-to-X` direction silently dropped when combined with `from-X to-Y` colors.
|
|
6
|
-
> - **Glossary path renamed (v7.9.0, breaking)** — the user-facing glossary output path was renamed from `purgetss/experimental/tailwind-classes/` to `purgetss/glossary/tailwind-classes/`. Tooling or CI that reads from the old path needs updating on upgrade — no transition shim. The `--glossary` flag and command surface are unchanged.
|
|
7
|
-
> - **`images --width <n>` flag (v7.8.0)** — pins Android `mdpi` (= iPhone `@1x`) to a specific pixel width, with larger scales deriving as ×1.5, ×2, ×3, ×4 from that base. Use it for SVG sources from vector editors with disproportionate viewBoxes (Affinity, Illustrator). CLI-only; there is no matching `images:` config property because the right width is per-asset. See [`images` Command](#images-command).
|
|
8
|
-
> - **Class syntax pre-validation (v7.8.0)** — `purgetss` now stops with a structured `Class Syntax Error` block (file + line + suggested fix) when it detects known class-name mistakes: inverted negative sign (`top-(-10)` → `-top-(10)`), Tailwind-style brackets (`top-[10px]` → `top-(10px)`), empty parentheses (`wh-()`), whitespace inside parentheses (`wh-( 200 )`), and redundant `px` unit (`top-(10px)` → `top-(10)`). All offenders are reported in one run. Generic unknown classes still flow into the `// Unused or unsupported classes` block in `app.tss`.
|
|
9
|
-
> - **Negative-values-in-parens parser fix (v7.8.0)** — classes like `top-(-10)`, `mt-(-5)`, and `origin-(-10,-20)` no longer crash with `Cannot read properties of null (reading 'pop')`. The parser now extracts the `(...)` portion first, so a `-` inside the value does not break the split.
|
|
10
|
-
> - **`brand:` config grouped (v7.7.0)** — the flat `brand:` block from v7.6.0 was reorganized into purpose-based sections: `brand.logos`, `brand.padding`, `brand.android`, `brand.ios`, and `brand.colors`. Old projects keep working — newly-generated configs use the grouped form.
|
|
11
|
-
> - **Separate Android brand inputs (v7.7.0)** — `brand` can now use one logo for the general brand set, another for Android launcher icons (`logos.androidLauncher` / `--icon-logo`), and another for Android 12+ splash artwork (`logos.androidSplash` / `--splash-logo`). Drop `logo-icon.*` and `logo-splash.*` into `purgetss/brand/` or set the paths in `config.cjs`.
|
|
12
|
-
> - **Legacy Android splash fallback (v7.7.0)** — `purgetss brand` now regenerates `app/assets/android/default.png` (Alloy) or `Resources/android/default.png` (Classic). `cleanup-legacy` no longer removes `default.png`.
|
|
13
|
-
> - **`semantic` works in Classic projects (v7.6.2)** — writes to `Resources/semantic.colors.json` for Classic, keeps writing to `app/assets/semantic.colors.json` for Alloy.
|
|
14
|
-
> - **Confirmation prompt for destructive writes (v7.6.1)** — `brand` and `images` ask `[y/N/a]` before overwriting (auto-skipped on non-TTY, with `-y`/`--yes`, or `PURGETSS_YES=1`).
|
|
15
|
-
> - **New `brand` command (v7.6.0)** — generates the complete Titanium branding set (launcher icons, adaptive icons, iOS 18+ Dark/Tinted variants, marketplace artwork, optional notification/splash) from a single SVG or PNG logo. See [`brand` Command](#brand-command) and the deep-dive [app-branding.md](./app-branding.md).
|
|
16
|
-
> - **New `images` command (v7.6.0)** — generates multi-density UI images (Android `res-*` densities + iPhone `@1x`/`@2x`/`@3x` scales) from sources in `./purgetss/images/`. See [`images` Command](#images-command) and the deep-dive [multi-density-images.md](./multi-density-images.md).
|
|
17
|
-
> - **New `semantic` command (v7.6.0)** — generates Titanium semantic colors (Light/Dark) into `app/assets/semantic.colors.json` with two modes (tonal palette vs. single purpose-based color). See [`semantic` Command](#semantic-command) and the deep-dive [semantic-colors.md](./semantic-colors.md).
|
|
18
|
-
> - **`brand:` and `images:` config sections** auto-injected into `purgetss/config.cjs` on first run. Percentages may be written as quoted strings like `'15%'` or as plain numbers.
|
|
19
|
-
> - **Default font family classes (v7.5.3)** — `font-sans`, `font-serif`, and `font-mono` generated automatically with platform-appropriate values.
|
|
20
|
-
> - **XML validation (v7.5.3)** — detects illegal `--` sequences inside XML comments during pre-validation.
|
|
21
|
-
|
|
22
|
-
This page lists the commands available in PurgeTSS.
|
|
3
|
+
This page lists the commands available in PurgeTSS. For release-by-release feature additions and behavior changes, see [Version History](./version-history.md).
|
|
23
4
|
|
|
24
5
|
## Setup Commands
|
|
25
6
|
|
|
@@ -135,6 +116,7 @@ The `create` command generates a new Alloy project with PurgeTSS already set up.
|
|
|
135
116
|
|
|
136
117
|
- `-f, --force` to overwrite an existing project.
|
|
137
118
|
- `-d, --dependencies` to install ESLint and Tailwind CSS.
|
|
119
|
+
- `-m, --module` to install the `purgetss.ui.js` module in the project's `./app/lib/` folder.
|
|
138
120
|
- `-v, --vendor [fa,mi,ms,f7]` to copy the selected fonts into your project and add the CommonJS module in `./app/lib/`. See the `icon-library` command for available fonts.
|
|
139
121
|
|
|
140
122
|
If a project with the same name already exists, the command will prompt you to confirm whether you want to overwrite it.
|
|
@@ -506,7 +488,7 @@ purgetss id
|
|
|
506
488
|
|
|
507
489
|
## `icon-library` Command
|
|
508
490
|
|
|
509
|
-
|
|
491
|
+
Copies the bundled free font files (Font Awesome 7, Material Icons, Material Symbols, Framework7 Icons) into `./app/assets/fonts/`. Once the fonts are in place, every official icon class (`fa-home`, `ms-home`, `mi-home`, `f7-house`, etc.) works out of the box — PurgeTSS resolves them at compile time from its own bundled `dist/` files.
|
|
510
492
|
|
|
511
493
|
```bash
|
|
512
494
|
purgetss icon-library [--vendor=fa,mi,ms,f7] [--module] [--styles]
|
|
@@ -515,412 +497,47 @@ purgetss icon-library [--vendor=fa,mi,ms,f7] [--module] [--styles]
|
|
|
515
497
|
purgetss il [-v=fa,mi,ms,f7] [-m] [-s]
|
|
516
498
|
```
|
|
517
499
|
|
|
518
|
-
###
|
|
519
|
-
|
|
520
|
-
- `-v, --vendor [fa,mi,ms,f7]` to copy specific font vendors.
|
|
521
|
-
- `-m, --module` to copy the corresponding CommonJS module into the `./app/lib/` folder.
|
|
522
|
-
- `-s, --styles` to copy the corresponding `.tss` files into the `./purgetss/styles/` folder for your review.
|
|
523
|
-
|
|
524
|
-
`./app/assets/fonts/`
|
|
525
|
-
```bash
|
|
526
|
-
FontAwesome7Brands-Regular.ttf
|
|
527
|
-
FontAwesome7Free-Regular.ttf
|
|
528
|
-
FontAwesome7Free-Solid.ttf
|
|
529
|
-
Framework7-Icons.ttf
|
|
530
|
-
MaterialIcons-Regular.ttf
|
|
531
|
-
MaterialIconsOutlined-Regular.otf
|
|
532
|
-
MaterialIconsRound-Regular.otf
|
|
533
|
-
MaterialIconsSharp-Regular.otf
|
|
534
|
-
MaterialIconsTwoTone-Regular.otf
|
|
535
|
-
MaterialSymbolsOutlined-Regular.ttf
|
|
536
|
-
MaterialSymbolsRounded-Regular.ttf
|
|
537
|
-
MaterialSymbolsSharp-Regular.ttf
|
|
538
|
-
```
|
|
539
|
-
|
|
540
|
-
After copying the fonts, you can use them in Buttons and Labels. For example, for Font Awesome, set the font family to `fa` (Solid icons) and use a class like `fa-home`.
|
|
541
|
-
|
|
542
|
-
### Available Font Classes
|
|
543
|
-
|
|
544
|
-
- [fontawesome.tss](https://github.com/macCesar/purgeTSS/blob/main/dist/fontawesome.tss)
|
|
545
|
-
- [materialicons.tss](https://github.com/macCesar/purgeTSS/blob/main/dist/materialicons.tss)
|
|
546
|
-
- [materialsymbols.tss](https://github.com/macCesar/purgeTSS/blob/main/dist/materialsymbols.tss)
|
|
547
|
-
- [framework7icons.tss](https://github.com/macCesar/purgeTSS/blob/main/dist/framework7icons.tss)
|
|
548
|
-
|
|
549
|
-
### Copying Specific Font Vendors
|
|
550
|
-
|
|
551
|
-
```bash
|
|
552
|
-
purgetss icon-library --vendor="fontawesome, materialicons, materialsymbols, framework7"
|
|
553
|
-
|
|
554
|
-
# alias:
|
|
555
|
-
purgetss il -v=fa,mi,ms,f7
|
|
556
|
-
```
|
|
557
|
-
|
|
558
|
-
Available names and aliases:
|
|
559
|
-
|
|
560
|
-
- `fa`, `fontawesome` = Font Awesome Icons
|
|
561
|
-
- `mi`, `materialicons` = Material Icons
|
|
562
|
-
- `ms`, `materialsymbol` = Material Symbols
|
|
563
|
-
- `f7`, `framework7` = Framework7 Icons
|
|
564
|
-
|
|
565
|
-
### CommonJS Module
|
|
566
|
-
|
|
567
|
-
You can use the `--module` option to copy the corresponding CommonJS module into the `./app/lib/` folder.
|
|
568
|
-
|
|
569
|
-
```bash
|
|
570
|
-
purgetss icon-library --module [--vendor="fontawesome, materialicons, materialsymbols, framework7"]
|
|
571
|
-
|
|
572
|
-
# alias:
|
|
573
|
-
purgetss il -m [-v=fa,mi,ms,f7]
|
|
574
|
-
```
|
|
575
|
-
|
|
576
|
-
Each library includes a CommonJS module that exposes Unicode strings for the icon fonts.
|
|
577
|
-
|
|
578
|
-
All prefixes are stripped from their class names and camel-cased. For example:
|
|
579
|
-
|
|
580
|
-
- Font Awesome: `fa-flag` becomes `flag`.
|
|
581
|
-
- Material Icons: `mi-flag` becomes `flag`.
|
|
582
|
-
- Material Symbols: `ms-flag` becomes `flag`.
|
|
583
|
-
- Framework7 Icons: `f7-alarm_fill` becomes `alarmFill` and `f7-clock_fill` becomes `clockFill`.
|
|
584
|
-
|
|
585
|
-
### Font Awesome Pro
|
|
586
|
-
|
|
587
|
-
If you have a [Font Awesome Pro account](https://fontawesome.com/pro), you can generate a custom `./purgetss/styles/fontawesome.tss` file with the Pro-only classes (except duotone icons; see note below).
|
|
588
|
-
|
|
589
|
-
After setting the [@fortawesome scope](https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers#installing-pro) with your token, install it in your project's root folder using `npm init` and `npm install --save-dev @fortawesome/fontawesome-pro` (current version 7.1.0).
|
|
590
|
-
|
|
591
|
-
To generate a new `purgetss/styles/fontawesome.tss`, run `purgetss build`. It also copies the Pro font files into `./app/assets/fonts` if needed.
|
|
592
|
-
|
|
593
|
-
> **Caution**
|
|
594
|
-
> Titanium cannot use Font Awesome duotone icons because each icon uses two glyphs.
|
|
595
|
-
|
|
596
|
-
### Font Awesome 7 Beta
|
|
597
|
-
|
|
598
|
-
To generate a custom `fontawesome.tss` file from [Font Awesome 7 Beta](https://fontawesome.com/download):
|
|
599
|
-
|
|
600
|
-
Move the `css` and `webfonts` folders from `fontawesome-pro-7.0.0-beta3-web/`:
|
|
601
|
-
|
|
602
|
-
```bash
|
|
603
|
-
fontawesome-pro-7.0.0-beta3-web/
|
|
604
|
-
├─ css/
|
|
605
|
-
└─ webfonts/
|
|
606
|
-
```
|
|
607
|
-
|
|
608
|
-
Into `./purgetss/fontawesome-beta/`:
|
|
500
|
+
### Flags
|
|
609
501
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
```
|
|
502
|
+
| Flag | Purpose |
|
|
503
|
+
| --- | --- |
|
|
504
|
+
| `-v, --vendor [fa,mi,ms,f7]` | Copy specific font vendors only (default copies all four). |
|
|
505
|
+
| `-m, --module` | Copy the matching CommonJS module into `./app/lib/` so you can reference icons by name from controllers (`icons.fa.home`). |
|
|
506
|
+
| `-s, --styles` | Copy the official `.tss` source files into `./purgetss/styles/` for reference only — not needed for the classes to work. |
|
|
616
507
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
### Font Example File
|
|
620
|
-
|
|
621
|
-
To use this file:
|
|
622
|
-
|
|
623
|
-
1. Copy the content of `index.xml` into a new Alloy project.
|
|
624
|
-
2. Install the official icon font files using `purgetss icon-library`.
|
|
625
|
-
- Without `--vendor`, PurgeTSS copies all official icon fonts.
|
|
626
|
-
3. Run `purgetss` once to generate the required files.
|
|
627
|
-
4. Compile your app as usual.
|
|
628
|
-
5. Use `liveview` for faster testing.
|
|
629
|
-
|
|
630
|
-
```xml
|
|
631
|
-
<Alloy>
|
|
632
|
-
<Window>
|
|
633
|
-
<View class="grid">
|
|
634
|
-
<View class="vertical mx-auto grid-cols-2 gap-y-2">
|
|
635
|
-
<Label class="mt-2 text-gray-700" text="FontAwesome" />
|
|
636
|
-
<Button class="fa fa-home my-1 h-10 w-10 text-xl text-blue-500" />
|
|
637
|
-
<Button class="fa fa-home my-1 h-10 w-10 rounded bg-blue-500 text-xl text-white" />
|
|
638
|
-
</View>
|
|
639
|
-
|
|
640
|
-
<View class="vertical mx-auto grid-cols-2 gap-y-2">
|
|
641
|
-
<Label class="mt-2 text-gray-700" text="Material Icons" />
|
|
642
|
-
<Button class="mi mi-home my-1 h-10 w-10 text-xl text-blue-500" />
|
|
643
|
-
<Button class="mi mi-home my-1 h-10 w-10 rounded bg-blue-500 text-xl text-white" />
|
|
644
|
-
</View>
|
|
645
|
-
|
|
646
|
-
<View class="vertical mx-auto grid-cols-2 gap-y-2">
|
|
647
|
-
<Label class="mt-2 text-gray-700" text="Material Symbol" />
|
|
648
|
-
<Button class="ms ms-home my-1 h-10 w-10 text-xl text-blue-500" />
|
|
649
|
-
<Button class="ms ms-home my-1 h-10 w-10 rounded bg-blue-500 text-xl text-white" />
|
|
650
|
-
</View>
|
|
651
|
-
|
|
652
|
-
<View class="vertical mx-auto grid-cols-2 gap-y-2">
|
|
653
|
-
<Label class="mt-2 text-gray-700" text="Framework7-Icons" />
|
|
654
|
-
<Button class="f7 f7-house my-1 h-10 w-10 text-xl text-blue-500" />
|
|
655
|
-
<Button class="f7 f7-house my-1 h-10 w-10 rounded bg-blue-500 text-xl text-white" />
|
|
656
|
-
</View>
|
|
657
|
-
</View>
|
|
658
|
-
</Window>
|
|
659
|
-
</Alloy>
|
|
660
|
-
```
|
|
508
|
+
Vendor aliases: `fa`/`fontawesome`, `mi`/`materialicons`, `ms`/`materialsymbol`, `f7`/`framework7`.
|
|
661
509
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
* Created by Cesar Estrada
|
|
665
|
-
* https://github.com/macCesar/purgeTSS
|
|
666
|
-
*/
|
|
667
|
-
|
|
668
|
-
/* Ti Elements */
|
|
669
|
-
'View': { width: Ti.UI.SIZE, height: Ti.UI.SIZE }
|
|
670
|
-
'Window': { backgroundColor: '#FFFFFF' }
|
|
671
|
-
|
|
672
|
-
/* Main Styles */
|
|
673
|
-
'.bg-blue-500': { backgroundColor: '#3b82f6' }
|
|
674
|
-
'.gap-y-2': { top: 8, bottom: 8 }
|
|
675
|
-
'.grid': { layout: 'horizontal', width: '100%' }
|
|
676
|
-
'.grid-cols-2': { width: '50%' }
|
|
677
|
-
'.h-10': { height: 40 }
|
|
678
|
-
'.mt-2': { top: 8 }
|
|
679
|
-
'.mx-auto': { right: null, left: null }
|
|
680
|
-
'.my-1': { top: 4, bottom: 4 }
|
|
681
|
-
'.rounded': { borderRadius: 4 }
|
|
682
|
-
'.text-blue-500': { color: '#3b82f6', textColor: '#3b82f6' }
|
|
683
|
-
'.text-gray-700': { color: '#374151', textColor: '#374151' }
|
|
684
|
-
'.text-white': { color: '#ffffff', textColor: '#ffffff' }
|
|
685
|
-
'.text-xl': { font: { fontSize: 20 } }
|
|
686
|
-
'.vertical': { layout: 'vertical' }
|
|
687
|
-
'.w-10': { width: 40 }
|
|
688
|
-
|
|
689
|
-
/* Default Font Awesome */
|
|
690
|
-
'.fa': { font: { fontFamily: 'FontAwesome7Free-Solid' } }
|
|
691
|
-
'.fa-home': { text: '\uf015', title: '\uf015' }
|
|
692
|
-
|
|
693
|
-
/* Material Icons */
|
|
694
|
-
'.mi': { font: { fontFamily: 'MaterialIcons-Regular' } }
|
|
695
|
-
'.mi-home': { text: '\ue88a', title: '\ue88a' }
|
|
696
|
-
|
|
697
|
-
/* Material Symbols */
|
|
698
|
-
'.ms': { font: { fontFamily: 'MaterialSymbolsOutlined-Regular' } }
|
|
699
|
-
'.ms-home': { text: '\ue88a', title: '\ue88a' }
|
|
700
|
-
|
|
701
|
-
/* Framework7 */
|
|
702
|
-
'.f7': { font: { fontFamily: 'Framework7-Icons' } }
|
|
703
|
-
'.f7-house': { text: 'house', title: 'house' }
|
|
704
|
-
```
|
|
510
|
+
> **Tip**
|
|
511
|
+
> This is a quick reference. See [Icon Fonts](./icon-fonts.md) for the complete guide — variant tables (`.ms`/`.mso`/`.msr`/`.mss`, `.fa`/`.fas`/`.far`/`.fab`), XML usage patterns, the side-by-side four-family example, Font Awesome Pro / Beta workflow, and instructions for recreating removed libraries.
|
|
705
512
|
|
|
706
513
|
## `build-fonts` Command
|
|
707
514
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
Place all `.ttf` or `.otf` files in `./purgetss/fonts/`, then run the command. You can also use `--module` to generate a CommonJS module in `./app/lib/`.
|
|
711
|
-
|
|
712
|
-
```bash
|
|
713
|
-
purgetss build-fonts
|
|
714
|
-
|
|
715
|
-
# alias:
|
|
716
|
-
purgetss bf
|
|
717
|
-
```
|
|
718
|
-
|
|
719
|
-
1. Creates `./purgetss/styles/fonts.tss` with all class definitions and `fontFamily` selectors.
|
|
720
|
-
2. Copies the font files into `./app/assets/fonts`.
|
|
721
|
-
3. Renames the font files to match their PostScript names so they work on both iOS and Android.
|
|
722
|
-
|
|
723
|
-
Example using Bevan and Dancing Script from Google Fonts.
|
|
724
|
-
|
|
725
|
-
`./purgetss/fonts/`
|
|
726
|
-
```bash
|
|
727
|
-
purgetss
|
|
728
|
-
└─ fonts
|
|
729
|
-
├─ Bevan-Italic.ttf
|
|
730
|
-
├─ Bevan-Regular.ttf
|
|
731
|
-
├─ DancingScript-Bold.ttf
|
|
732
|
-
├─ DancingScript-Medium.ttf
|
|
733
|
-
├─ DancingScript-Regular.ttf
|
|
734
|
-
└─ DancingScript-SemiBold.ttf
|
|
735
|
-
```
|
|
736
|
-
|
|
737
|
-
After running `purgetss build-fonts`:
|
|
738
|
-
|
|
739
|
-
`./purgetss/styles/fonts.tss`
|
|
740
|
-
```tss
|
|
741
|
-
/* Fonts TSS file generated with PurgeTSS
|
|
742
|
-
* https://github.com/macCesar/purgeTSS
|
|
743
|
-
*/
|
|
744
|
-
|
|
745
|
-
'.bevan-italic': { font: { fontFamily: 'Bevan-Italic' } }
|
|
746
|
-
'.bevan-regular': { font: { fontFamily: 'Bevan-Regular' } }
|
|
747
|
-
|
|
748
|
-
'.dancingscript-bold': { font: { fontFamily: 'DancingScript-Bold' } }
|
|
749
|
-
'.dancingscript-medium': { font: { fontFamily: 'DancingScript-Medium' } }
|
|
750
|
-
'.dancingscript-regular': { font: { fontFamily: 'DancingScript-Regular' } }
|
|
751
|
-
'.dancingscript-semibold': { font: { fontFamily: 'DancingScript-SemiBold' } }
|
|
752
|
-
```
|
|
753
|
-
|
|
754
|
-
### Organizing the Fonts Folder
|
|
755
|
-
|
|
756
|
-
For better organization, group each font family in subfolders:
|
|
757
|
-
|
|
758
|
-
`./purgetss/fonts/`
|
|
759
|
-
```bash
|
|
760
|
-
purgetss
|
|
761
|
-
└─ fonts
|
|
762
|
-
├─ bevan
|
|
763
|
-
│ ├─ Bevan-Italic.ttf
|
|
764
|
-
│ └─ Bevan-Regular.ttf
|
|
765
|
-
└─ dancing-script
|
|
766
|
-
├─ DancingScript-Bold.ttf
|
|
767
|
-
├─ DancingScript-Medium.ttf
|
|
768
|
-
├─ DancingScript-Regular.ttf
|
|
769
|
-
└─ DancingScript-SemiBold.ttf
|
|
770
|
-
```
|
|
771
|
-
|
|
772
|
-
Subfolders don't change the output -- you get the same `fonts.tss` as the flat layout above.
|
|
773
|
-
|
|
774
|
-
### Renaming `fontFamily` Classes
|
|
775
|
-
|
|
776
|
-
To use a shorter or different class name, rename the font file.
|
|
777
|
-
|
|
778
|
-
`./purgetss/fonts/`
|
|
779
|
-
```bash
|
|
780
|
-
purgetss
|
|
781
|
-
└─ fonts
|
|
782
|
-
└─ dancing-script
|
|
783
|
-
├─ Script-Bold.ttf
|
|
784
|
-
├─ Script-Medium.ttf
|
|
785
|
-
├─ Script-Regular.ttf
|
|
786
|
-
└─ Script-SemiBold.ttf
|
|
787
|
-
```
|
|
788
|
-
|
|
789
|
-
Running `build-fonts` adjusts the class name accordingly:
|
|
790
|
-
|
|
791
|
-
```tss
|
|
792
|
-
'.script-bold': { font: { fontFamily: 'DancingScript-Bold' } }
|
|
793
|
-
'.script-medium': { font: { fontFamily: 'DancingScript-Medium' } }
|
|
794
|
-
'.script-regular': { font: { fontFamily: 'DancingScript-Regular' } }
|
|
795
|
-
'.script-semibold': { font: { fontFamily: 'DancingScript-SemiBold' } }
|
|
796
|
-
```
|
|
797
|
-
|
|
798
|
-
### Icon Font Libraries
|
|
799
|
-
|
|
800
|
-
You can add any icon font library that includes a `.ttf` or `.otf` file and a `.css` file with Unicode characters.
|
|
801
|
-
|
|
802
|
-
`./purgetss/fonts/`
|
|
803
|
-
```bash
|
|
804
|
-
purgetss
|
|
805
|
-
└─ fonts
|
|
806
|
-
├─ bevan
|
|
807
|
-
├─ dancing-script
|
|
808
|
-
├─ map-icons
|
|
809
|
-
│ ├─ map-icons.css
|
|
810
|
-
│ └─ map-icons.ttf
|
|
811
|
-
└─ microns
|
|
812
|
-
├─ microns.css
|
|
813
|
-
└─ microns.ttf
|
|
814
|
-
```
|
|
815
|
-
|
|
816
|
-
After running `purgetss build-fonts`, `fonts.tss` will include the `fontFamily` class definitions and Unicode characters.
|
|
817
|
-
|
|
818
|
-
`./purgetss/styles/fonts.tss`
|
|
819
|
-
```tss
|
|
820
|
-
/* Fonts TSS file generated with PurgeTSS */
|
|
821
|
-
/* https://github.com/macCesar/purgeTSS */
|
|
822
|
-
|
|
823
|
-
'.map-icons': { font: { fontFamily: 'map-icons' } }
|
|
824
|
-
'.microns': { font: { fontFamily: 'microns' } }
|
|
825
|
-
|
|
826
|
-
/* Unicode Characters */
|
|
827
|
-
/* To use your Icon Fonts in Buttons and Labels each class sets 'text' and 'title' properties */
|
|
828
|
-
|
|
829
|
-
/* map-icons/map-icons.css */
|
|
830
|
-
'.map-icon-abseiling': { text: '\ue800', title: '\ue800' }
|
|
831
|
-
'.map-icon-accounting': { text: '\ue801', title: '\ue801' }
|
|
832
|
-
'.map-icon-airport': { text: '\ue802', title: '\ue802' }
|
|
833
|
-
'.map-icon-amusement-park': { text: '\ue803', title: '\ue803' }
|
|
834
|
-
'.map-icon-aquarium': { text: '\ue804', title: '\ue804' }
|
|
835
|
-
|
|
836
|
-
/* microns/microns.css */
|
|
837
|
-
'.mu-arrow-left': { text: '\ue700', title: '\ue700' }
|
|
838
|
-
'.mu-arrow-right': { text: '\ue701', title: '\ue701' }
|
|
839
|
-
'.mu-arrow-up': { text: '\ue702', title: '\ue702' }
|
|
840
|
-
'.mu-arrow-down': { text: '\ue703', title: '\ue703' }
|
|
841
|
-
'.mu-left': { text: '\ue704', title: '\ue704' }
|
|
842
|
-
```
|
|
843
|
-
|
|
844
|
-
### Options
|
|
845
|
-
|
|
846
|
-
- `-m, --module`: Generate a CommonJS module in `./app/lib/`.
|
|
847
|
-
- `-f, --filename`: Use filenames as both font class names and icon prefixes (replaces the old `-p` flag).
|
|
848
|
-
|
|
849
|
-
### CommonJS Module
|
|
850
|
-
|
|
851
|
-
Use the `--module` option to generate a CommonJS module called `purgetss.fonts.js` in `./app/lib/`.
|
|
852
|
-
|
|
853
|
-
To avoid conflicts with other icon libraries, PurgeTSS keeps each icon's prefix.
|
|
515
|
+
Generates `./purgetss/styles/fonts.tss` with class definitions and `fontFamily` selectors for any user-defined fonts dropped into `./purgetss/fonts/` (Google Fonts, brand typefaces, community icon libraries with `.ttf` + `.css` pairs).
|
|
854
516
|
|
|
855
517
|
```bash
|
|
856
|
-
purgetss build-fonts
|
|
518
|
+
purgetss build-fonts [-m] [-f]
|
|
857
519
|
|
|
858
520
|
# alias:
|
|
859
|
-
purgetss bf -m
|
|
521
|
+
purgetss bf [-m] [-f]
|
|
860
522
|
```
|
|
861
523
|
|
|
862
|
-
|
|
863
|
-
```javascript
|
|
864
|
-
const icons = {
|
|
865
|
-
// map-icons/map-icons.css
|
|
866
|
-
mapIcon: {
|
|
867
|
-
abseiling: '\ue800',
|
|
868
|
-
accounting: '\ue801',
|
|
869
|
-
airport: '\ue802',
|
|
870
|
-
amusementPark: '\ue803'
|
|
871
|
-
},
|
|
872
|
-
// microns/microns.css
|
|
873
|
-
mu: {
|
|
874
|
-
arrowLeft: '\ue700',
|
|
875
|
-
arrowRight: '\ue701',
|
|
876
|
-
arrowUp: '\ue702',
|
|
877
|
-
arrowDown: '\ue703'
|
|
878
|
-
}
|
|
879
|
-
};
|
|
880
|
-
exports.icons = icons;
|
|
881
|
-
|
|
882
|
-
const families = {
|
|
883
|
-
// map-icons/map-icons.css
|
|
884
|
-
mapIcon: 'map-icons',
|
|
885
|
-
// microns/microns.css
|
|
886
|
-
mu: 'microns'
|
|
887
|
-
};
|
|
888
|
-
exports.families = families;
|
|
889
|
-
```
|
|
890
|
-
|
|
891
|
-
### Using Filenames for Class Names and Icon Prefixes
|
|
892
|
-
|
|
893
|
-
The `--filename` option uses the style's filename as both the font class name and the icon prefix in `fonts.tss` and `purgetss.fonts.js`.
|
|
894
|
-
|
|
895
|
-
`./purgetss/fonts/`
|
|
896
|
-
```bash
|
|
897
|
-
purgetss
|
|
898
|
-
└─ fonts
|
|
899
|
-
├─ map-icons
|
|
900
|
-
│ ├─ map.ttf
|
|
901
|
-
│ └─ mp.css
|
|
902
|
-
└─ microns
|
|
903
|
-
├─ mic.ttf
|
|
904
|
-
└─ mc.css
|
|
905
|
-
```
|
|
524
|
+
### Flags
|
|
906
525
|
|
|
907
|
-
|
|
526
|
+
| Flag | Purpose |
|
|
527
|
+
| --- | --- |
|
|
528
|
+
| `-m, --module` | Also generates a CommonJS module in `./app/lib/purgetss.fonts.js` exposing `exports.icons` and `exports.families` for use from controllers. |
|
|
529
|
+
| `-f, --font-class-from-filename` | Uses the font filename as the class name and icon prefix instead of the font family. Replaces the old `-p` flag. |
|
|
908
530
|
|
|
909
|
-
|
|
910
|
-
/* fontFamily classes use the font's filename */
|
|
911
|
-
'.map': { font: { fontFamily: 'map-icons' } }
|
|
912
|
-
'.mic': { font: { fontFamily: 'microns' } }
|
|
531
|
+
### What it does
|
|
913
532
|
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
'.mp-accounting': { text: '\ue801', title: '\ue801' }
|
|
533
|
+
1. Creates `./purgetss/styles/fonts.tss` with one `fontFamily` class per file.
|
|
534
|
+
2. Copies the font files into `./app/assets/fonts/`, renamed to their PostScript names so they work on both iOS and Android.
|
|
917
535
|
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
'.mc-arrow-right': { text: '\ue701', title: '\ue701' }
|
|
921
|
-
```
|
|
536
|
+
> **Tip**
|
|
537
|
+
> This is a quick reference. See [Custom Fonts](./custom-fonts.md) for the complete guide — folder organization, class renaming, adding icon libraries, the `--module` output structure, and `--font-class-from-filename` workflow.
|
|
922
538
|
|
|
923
|
-
|
|
539
|
+
> **Note**
|
|
540
|
+
> `build-fonts` is for **user-defined fonts only**. The 4 official icon families (Font Awesome 7, Material Icons, Material Symbols, Framework7) are bundled with PurgeTSS and installed via [`icon-library`](#icon-library-command), not `build-fonts`. See [Icon Fonts](./icon-fonts.md).
|
|
924
541
|
|
|
925
542
|
## `shades` Command
|
|
926
543
|
|
|
@@ -943,6 +560,7 @@ purgetss s [hexcode] [name]
|
|
|
943
560
|
- `-n, --name`: Specifies the name of the color.
|
|
944
561
|
- `-q, --quotes`: Retains double quotes in the `config.cjs` file.
|
|
945
562
|
- `-r, --random`: Generates shades from a random color.
|
|
563
|
+
- `-o, --override`: Places the new shades in `theme.colors` (instead of `theme.extend.colors`) to override default colors.
|
|
946
564
|
- `-s, --single`: Generates a single color definition.
|
|
947
565
|
- `-t, --tailwind`: Logs the generated shades with a `tailwind.config.js` compatible structure.
|
|
948
566
|
- `-l, --log`: Logs the generated shades instead of saving them.
|
|
@@ -1069,6 +687,10 @@ purgetss b
|
|
|
1069
687
|
|
|
1070
688
|
When `purgetss` runs (manually or via `watch`), it checks for changes in `config.cjs` and regenerates `utilities.tss` when needed.
|
|
1071
689
|
|
|
690
|
+
### Options
|
|
691
|
+
|
|
692
|
+
- `--glossary`: Creates a glossary folder with all generated classes.
|
|
693
|
+
|
|
1072
694
|
## `watch` Command
|
|
1073
695
|
|
|
1074
696
|
The `watch` command runs PurgeTSS on each project compile. You do not need to run `build` manually after each change.
|
|
@@ -1102,6 +724,15 @@ purgetss watch --off
|
|
|
1102
724
|
purgetss w -o
|
|
1103
725
|
```
|
|
1104
726
|
|
|
727
|
+
To completely remove the Auto-Purging hook from `alloy.jmk`, use `-d, --delete`.
|
|
728
|
+
|
|
729
|
+
```bash
|
|
730
|
+
purgetss watch --delete
|
|
731
|
+
|
|
732
|
+
# alias:
|
|
733
|
+
purgetss w -d
|
|
734
|
+
```
|
|
735
|
+
|
|
1105
736
|
## `module` Command
|
|
1106
737
|
|
|
1107
738
|
The `module` command installs `purgetss.ui.js` in the `lib` folder.
|