@maccesar/titools 2.8.0 → 2.10.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.
Files changed (29) hide show
  1. package/package.json +1 -1
  2. package/skills/purgetss/SKILL.md +36 -0
  3. package/skills/purgetss/references/EXAMPLES.md +86 -24
  4. package/skills/purgetss/references/app-branding.md +554 -0
  5. package/skills/purgetss/references/appearance-module.md +161 -0
  6. package/skills/purgetss/references/apply-directive.md +87 -31
  7. package/skills/purgetss/references/arbitrary-values.md +4 -0
  8. package/skills/purgetss/references/class-categories.md +10 -7
  9. package/skills/purgetss/references/class-index.md +25 -18
  10. package/skills/purgetss/references/cli-commands.md +309 -8
  11. package/skills/purgetss/references/configurable-properties.md +11 -7
  12. package/skills/purgetss/references/custom-rules.md +7 -3
  13. package/skills/purgetss/references/customization-deep-dive.md +73 -4
  14. package/skills/purgetss/references/dynamic-component-creation.md +29 -14
  15. package/skills/purgetss/references/grid-layout.md +20 -8
  16. package/skills/purgetss/references/icon-fonts.md +4 -0
  17. package/skills/purgetss/references/installation-setup.md +3 -8
  18. package/skills/purgetss/references/ios-large-titles.md +141 -0
  19. package/skills/purgetss/references/migration-guide.md +162 -25
  20. package/skills/purgetss/references/multi-density-images.md +363 -0
  21. package/skills/purgetss/references/opacity-modifier.md +4 -0
  22. package/skills/purgetss/references/performance-tips.md +5 -0
  23. package/skills/purgetss/references/platform-modifiers.md +4 -0
  24. package/skills/purgetss/references/semantic-colors.md +386 -0
  25. package/skills/purgetss/references/smart-mappings.md +50 -28
  26. package/skills/purgetss/references/tikit-components.md +3 -1
  27. package/skills/purgetss/references/titanium-resets.md +46 -15
  28. package/skills/purgetss/references/ui-ux-design.md +32 -6
  29. package/skills/purgetss/references/values-and-units.md +120 -0
@@ -1,12 +1,17 @@
1
1
  # PurgeTSS CLI Commands
2
2
 
3
- > **Info: What's new in v7.2.x**
4
- > - Node.js 20+ required (due to the "inquirer" v13 upgrade).
5
- > - Font Awesome 7 support, including the CSS custom properties format.
6
- > - Titanium SDK 13.1.x support, with new properties from 13.1.0.GA.
7
- > - **Removed deprecated commands:** `copy-fonts` and `build-legacy` are no longer available.
8
- > - Install size reduced by ~45MB (non-essential assets moved to dev dependencies).
9
- > - Improved Unicode extraction for more formats and direct character mappings.
3
+ > **Info: What's new in v7.5.3 / v7.6.x / v7.7.0**
4
+ > - **`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.
5
+ > - **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`.
6
+ > - **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`.
7
+ > - **`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.
8
+ > - **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`).
9
+ > - **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).
10
+ > - **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).
11
+ > - **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).
12
+ > - **`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.
13
+ > - **Default font family classes (v7.5.3)** — `font-sans`, `font-serif`, and `font-mono` generated automatically with platform-appropriate values.
14
+ > - **XML validation (v7.5.3)** — detects illegal `--` sequences inside XML comments during pre-validation.
10
15
 
11
16
  This page lists the commands available in PurgeTSS.
12
17
 
@@ -14,6 +19,8 @@ This page lists the commands available in PurgeTSS.
14
19
 
15
20
  - `init`: Initializes PurgeTSS on an existing Alloy project.
16
21
  - `create`: Creates a new Alloy project with PurgeTSS already set up.
22
+ - `brand`: Generates the Titanium branding set from a single logo. See [`brand` Command](#brand-command).
23
+ - `images`: Generates multi-density UI images from sources in `./purgetss/images/`. See [`images` Command](#images-command).
17
24
 
18
25
  ## Development Commands
19
26
 
@@ -28,6 +35,7 @@ This page lists the commands available in PurgeTSS.
28
35
  ## Utility Commands
29
36
 
30
37
  - `shades`: Generates shades and tints for a color and writes the palette to `config.cjs`.
38
+ - `semantic`: Generates Titanium semantic colors (Light/Dark) into `app/assets/semantic.colors.json`. See [`semantic` Command](#semantic-command).
31
39
  - `color-module`: Creates `./app/lib/purgetss.colors.js` with the colors defined in `config.cjs`.
32
40
  - `module`: Installs `purgetss.ui.js` in the `lib` folder.
33
41
 
@@ -64,14 +72,51 @@ module.exports = {
64
72
  plugins: [] // Array of properties to ignore
65
73
  }
66
74
  },
75
+ brand: {
76
+ logos: {
77
+ // Optional overrides. If omitted, PurgeTSS auto-discovers files from purgetss/brand/:
78
+ // primary: './docs/logo.svg',
79
+ // androidLauncher: './docs/app-icon.svg',
80
+ // androidSplash: './docs/splash.svg',
81
+ // monochrome: './docs/logo-mono.svg',
82
+ // iosDark: './docs/logo-dark.svg',
83
+ // iosTinted: './docs/logo-tinted.svg'
84
+ },
85
+ padding: {
86
+ ios: '4%', // iOS aesthetic padding. Range 2-8%.
87
+ androidLegacy: '10%', // legacy ic_launcher.png padding %
88
+ androidAdaptive: '19%' // adaptive icon safe-zone %. Spec floor 19.44%.
89
+ },
90
+ android: {
91
+ splash: false, // also generate splash_icon.png × 5
92
+ notification: false // also generate ic_stat_notify.png × 5
93
+ },
94
+ colors: {
95
+ background: '#FFFFFF' // Android adaptive bg + iOS/marketplace flatten
96
+ },
97
+ // Optional iOS overrides:
98
+ // ios: {
99
+ // dark: false,
100
+ // tinted: false,
101
+ // darkBackground: '#111111'
102
+ // },
103
+ confirmOverwrites: true // prompt before overwriting files (set false to skip)
104
+ },
105
+ images: {
106
+ quality: 85, // JPEG/WebP/AVIF quality (0-100)
107
+ format: null, // null = keep original; 'webp' | 'jpeg' | 'png' to convert every image
108
+ confirmOverwrites: true // prompt before overwriting files (set false to skip)
109
+ },
67
110
  theme: {
68
111
  extend: {}
69
112
  }
70
113
  };
71
114
  ```
72
115
 
116
+ `init` also creates empty `purgetss/fonts/`, `purgetss/brand/`, and `purgetss/images/` folders so you can see where each kind of asset goes.
117
+
73
118
  > **Tip**
74
- > PurgeTSS looks for `./purgetss/config.cjs`. Each section is optional and can be customized. Missing sections use the default configuration.
119
+ > PurgeTSS looks for `./purgetss/config.cjs`. Each section is optional and can be customized. Missing sections use the default configuration. The `brand:` and `images:` sections are auto-injected into older configs on first run in v7.6.0+.
75
120
 
76
121
  ## `create` Command
77
122
 
@@ -143,6 +188,249 @@ Recommended VSCode extensions:
143
188
 
144
189
  `purgetss create "Name of the Project" [--dependencies --vendor=fa,mi,ms,f7]` runs: `ti config` (reads idprefix/workspace), `ti create -t app -p all -n "Name"`, `alloy new`, `purgetss w`, `purgetss b`, optional `--vendor` (copies fonts + CommonJS module), optional `--dependencies` (installs Tailwind CSS, ESLint with Titanium plugins, and config files), then opens the project in VS Code, Sublime Text, or Finder.
145
190
 
191
+ ## `brand` Command
192
+
193
+ Introduced in v7.6.0, restructured in v7.7.0. Generates the complete Titanium branding set (launcher icons, adaptive icons, iOS 18+ Dark/Tinted variants, marketplace artwork, optional notification/splash icons) from a single logo image — with optional Android-specific logo overrides when you need them. Alloy and Classic projects are auto-detected.
194
+
195
+ > **Tip**
196
+ > This is a quick reference. See [app-branding.md](./app-branding.md) for the complete guide — workflow, padding guidance, Android dark mode, iOS 18+ variants, alpha channel handling, and troubleshooting.
197
+
198
+ ```bash
199
+ purgetss brand # uses purgetss/brand/logo.{svg,png} + config
200
+ purgetss brand path/to/logo.svg # positional logo path override
201
+ ```
202
+
203
+ ### Flags
204
+
205
+ **Project & output**
206
+
207
+ | Flag | Purpose |
208
+ | --- | --- |
209
+ | `--project <path>` | Project root (defaults to cwd). |
210
+ | `--dry-run` | Preview what would be generated without writing any files. |
211
+ | `--output <dir>` | Stage into `<dir>` instead of writing in place. |
212
+ | `-y, --yes` | Skip the overwrite confirmation prompt for this invocation. |
213
+
214
+ **Visual customization**
215
+
216
+ | Flag | Purpose |
217
+ | --- | --- |
218
+ | `--bg-color <hex>` | Background color for Android adaptive + iOS/marketplace flatten. |
219
+ | `--padding <n>` | Shortcut: sets BOTH Android paddings to the same value for one run. |
220
+ | `--android-adaptive-padding <n>` | Adaptive icon safe-zone % (default `19`). |
221
+ | `--android-legacy-padding <n>` | Legacy `ic_launcher.png` padding % (default `10`). |
222
+ | `--ios-padding <n>` | iOS aesthetic padding % (range `2-8`, default `4`). |
223
+
224
+ **Optional asset types**
225
+
226
+ | Flag | Purpose |
227
+ | --- | --- |
228
+ | `--notification` | Also emit `ic_stat_notify.png × 5`. |
229
+ | `--splash` | Also emit `splash_icon.png × 5`. |
230
+
231
+ **Logo variants & overrides**
232
+
233
+ | Flag | Purpose |
234
+ | --- | --- |
235
+ | `--icon-logo <path>` | Override `purgetss/brand/logo-icon.{svg,png}` for Android launcher icons (square mark for non-square main logos). |
236
+ | `--monochrome-logo <path>` | Override `purgetss/brand/logo-mono.{svg,png}`. |
237
+ | `--dark-logo <path>` | Override `purgetss/brand/logo-dark.{svg,png}`. |
238
+ | `--dark-bg-color <hex>` | Opaque dark bg for `DefaultIcon-Dark.png` (default: transparent per Apple HIG). |
239
+ | `--splash-logo <path>` | Override `purgetss/brand/logo-splash.{svg,png}` for Android 12+ splash artwork. |
240
+ | `--tinted-logo <path>` | Override `purgetss/brand/logo-tinted.{svg,png}`. |
241
+ | `--no-dark` | Skip `DefaultIcon-Dark.png`. |
242
+ | `--no-tinted` | Skip `DefaultIcon-Tinted.png`. |
243
+
244
+ **Legacy cleanup**
245
+
246
+ | Flag | Purpose |
247
+ | --- | --- |
248
+ | `--cleanup-legacy` | Remove obsolete branding artifacts (reads `tiapp.xml` for safety rules). Keeps `default.png` on purpose. |
249
+ | `--aggressive` | With `--cleanup-legacy`, also remove `ldpi` density folders. |
250
+
251
+ **Diagnostics**
252
+
253
+ | Flag | Purpose |
254
+ | --- | --- |
255
+ | `--notes` | Print full `tiapp.xml` snippets + padding tuning guide. |
256
+ | `--debug` | Print extra diagnostics. |
257
+
258
+ ### Positional argument
259
+
260
+ - `[logo-path]` (optional) — overrides auto-discovery of `purgetss/brand/logo.{svg,png}`.
261
+
262
+ ### Config block (v7.7.0 grouped structure)
263
+
264
+ Defaults live under `brand:` in `purgetss/config.cjs` and are injected automatically:
265
+
266
+ ```javascript
267
+ brand: {
268
+ logos: {
269
+ // Optional overrides. If omitted, PurgeTSS auto-discovers files from purgetss/brand/:
270
+ // primary: './docs/logo.svg',
271
+ // androidLauncher: './docs/app-icon.svg',
272
+ // androidSplash: './docs/splash.svg',
273
+ // monochrome: './docs/logo-mono.svg',
274
+ // iosDark: './docs/logo-dark.svg',
275
+ // iosTinted: './docs/logo-tinted.svg'
276
+ },
277
+ padding: {
278
+ ios: '4%', // iOS aesthetic padding. Range 2-8%.
279
+ androidLegacy: '10%', // legacy ic_launcher.png padding %
280
+ androidAdaptive: '19%' // adaptive icon safe-zone %. Spec floor 19.44%.
281
+ },
282
+ android: {
283
+ splash: false, // also generate splash_icon.png × 5
284
+ notification: false // also generate ic_stat_notify.png × 5
285
+ },
286
+ colors: {
287
+ background: '#FFFFFF' // Android adaptive bg + iOS/marketplace flatten
288
+ },
289
+ // Optional iOS overrides:
290
+ // ios: {
291
+ // dark: false, // skip DefaultIcon-Dark.png
292
+ // tinted: false, // skip DefaultIcon-Tinted.png
293
+ // darkBackground: '#111' // opaque dark bg for DefaultIcon-Dark.png
294
+ // },
295
+ confirmOverwrites: true // prompt before overwriting files
296
+ }
297
+ ```
298
+
299
+ The recommended workflow is convention-first: drop files in `purgetss/brand/`, let auto-discovery pick them up. Treat `brand.logos.*` as optional overrides for one-off paths or when masters live outside `purgetss/brand/`.
300
+
301
+ ### Confirmation prompt
302
+
303
+ `brand` writes in place, so it asks `Continue? [y/N/a]` before overwriting anything. Choose `a` (always) to write `confirmOverwrites: false` into `config.cjs` and silence the prompt on future runs. The prompt is skipped automatically when `stdin` is not a TTY (`alloy.jmk` hook, CI, pipes), when `-y`/`--yes` is passed, or when `PURGETSS_YES=1` is set.
304
+
305
+ ### Examples
306
+
307
+ ```bash
308
+ purgetss brand # uses purgetss/brand/logo.svg + config
309
+ purgetss brand --bg-color "#0B1326" # override bg color
310
+ purgetss brand --icon-logo ./docs/app-icon.svg # dedicated square Android launcher mark
311
+ purgetss brand --splash --splash-logo ./docs/splash.svg # custom Android 12+ splash artwork
312
+ purgetss brand --notification --splash # add notification + splash
313
+ purgetss brand --no-tinted # skip iOS 18+ tinted variant
314
+ purgetss brand --dry-run # preview without writing
315
+ purgetss brand --cleanup-legacy --dry-run # preview legacy cleanup
316
+ ```
317
+
318
+ ### Android output groups
319
+
320
+ `brand` writes three Android-facing asset groups, each with a different job:
321
+
322
+ - `ic_launcher*` for the app icon and the default Android 12+ system splash path
323
+ - `splash_icon.png` when you pass `--splash` and want custom Android 12+ splash artwork
324
+ - `default.png` as the older Titanium Android splash fallback (regenerated since v7.7.0)
325
+
326
+ ## `images` Command
327
+
328
+ Introduced in v7.6.0. Generates multi-density variants of your UI images (buttons, illustrations, logos, screen graphics) from a single high-resolution source per image. Alloy and Classic projects are auto-detected.
329
+
330
+ > **Tip**
331
+ > This is a quick reference. See [multi-density-images.md](./multi-density-images.md) for the complete guide — 4× source convention, re-processing single files, format conversion, subdirectory preservation, and troubleshooting.
332
+
333
+ ```bash
334
+ purgetss images # uses purgetss/images/ + config
335
+ purgetss images background/pink-texture.png # re-process one file (short path)
336
+ purgetss images background/ # re-process one subfolder
337
+ ```
338
+
339
+ ### Flags
340
+
341
+ | Flag | Purpose |
342
+ | --- | --- |
343
+ | `--android` | Only emit Android density variants. Mutually exclusive with `--ios`. |
344
+ | `--ios` | Only emit iPhone scale variants. Mutually exclusive with `--android`. |
345
+ | `--format <ext>` | Convert all outputs to `webp`, `jpeg`, `png`, `avif`, `gif`, or `tiff`. Default: keep source format. |
346
+ | `--quality <n>` | Quality `0-100` for lossy formats. Default `85`. |
347
+ | `--dry-run` | Preview without writing any files. |
348
+ | `--project <path>` | Project root (defaults to cwd). |
349
+ | `-y, --yes` | Skip the overwrite confirmation prompt. |
350
+ | `--debug` | Print extra diagnostics. |
351
+
352
+ ### Positional argument
353
+
354
+ - `[source]` (optional) — path to override auto-discovery. Resolves first against `purgetss/images/` (short paths like `buttons/btn.png`), then against cwd.
355
+
356
+ ### Config block
357
+
358
+ Defaults live under `images:` in `purgetss/config.cjs`:
359
+
360
+ ```javascript
361
+ images: {
362
+ quality: 85, // JPEG/WebP/AVIF quality (0-100)
363
+ format: null, // null = keep original; 'webp' | 'jpeg' | 'png' | 'avif' | 'gif' | 'tiff'
364
+ confirmOverwrites: true // prompt before overwriting files
365
+ }
366
+ ```
367
+
368
+ Like `brand`, `images` writes in place and asks `Continue? [y/N/a]` before overwriting. Selecting `a` flips `confirmOverwrites: false` in `config.cjs`. Skipped automatically when `stdin` is not a TTY, when `-y`/`--yes` is passed, or when `PURGETSS_YES=1` is set.
369
+
370
+ ### Examples
371
+
372
+ ```bash
373
+ purgetss images # uses purgetss/images/ + config
374
+ purgetss images background/pink-texture.png # re-process one file (short path)
375
+ purgetss images background/ # re-process one subfolder
376
+ purgetss images --android # only Android densities
377
+ purgetss images --format webp --quality 90 # convert all outputs to WebP
378
+ purgetss images --dry-run # preview
379
+ ```
380
+
381
+ ## `semantic` Command
382
+
383
+ Introduced in v7.6.0. Generates Titanium semantic colors (Light/Dark mode aware) into `app/assets/semantic.colors.json`. The command dispatches between two distinct modes based on whether `--single` is passed.
384
+
385
+ > **Tip**
386
+ > This is a quick reference. See [semantic-colors.md](./semantic-colors.md) for the complete guide — mirror inversion math, Titanium semantic color spec, class mapping conventions, and strategies for purpose-based design systems.
387
+
388
+ ### Palette mode (no `--single`)
389
+
390
+ One base hex, 11-shade tonal palette with mirror-by-index Light/Dark inversion anchored at shade `500`. Writes both files in one step: the JSON gets 11 entries, and `config.cjs` gets the family mapped to those semantic keys.
391
+
392
+ ```bash
393
+ purgetss semantic <hex> <name>
394
+ purgetss semantic '#15803d' amazon
395
+ ```
396
+
397
+ Usage produces classes like `bg-amazon-50`, `text-amazon-500`, `border-amazon-950` that flip tonal contrast automatically with the system appearance.
398
+
399
+ ### Single mode (`--single`)
400
+
401
+ Explicit per-mode hex values for purpose-based semantic colors (`surfaceColor`, `textColor`, `borderColor`, `overlayColor`, etc.). Writes the JSON entry AND auto-maps it to a class in `config.cjs` by stripping the conventional `Color` suffix (e.g. `surfaceColor` → class `surface`).
402
+
403
+ ```bash
404
+ purgetss semantic --single <hex> <name> [--dark <hex>] [--alpha <0-100>]
405
+
406
+ # Examples:
407
+ purgetss semantic --single '#F9FAFB' surfaceColor --dark '#0f172a'
408
+ purgetss semantic --single '#111827' textColor --dark '#f1f5f9'
409
+ purgetss semantic --single '#3B82F6' accentColor --dark '#60a5fa' --alpha 80
410
+ purgetss semantic --single '#000000' overlayColor --alpha 50
411
+ ```
412
+
413
+ When `--dark` is omitted, it defaults to the light hex — useful for overlays/glass surfaces where alpha is the only variation.
414
+
415
+ ### Smart in-place updates
416
+
417
+ If a `--single` name matches an existing palette shade — e.g. `purgetss semantic --single '#000' amazon500` while palette `amazon` exists — PurgeTSS narrows the operation to an in-place JSON value edit. The entry stays in its original position, and `config.cjs` is left untouched (the palette already maps to that key).
418
+
419
+ Re-running on the same palette family fully replaces it: PurgeTSS strips prior keys belonging to that family (bare name + 11 shade keys) before writing the new entries. Unrelated palettes and manually-defined entries survive.
420
+
421
+ ### Flags
422
+
423
+ | Flag | Purpose |
424
+ | --- | --- |
425
+ | `-s, --single` | Generate a single purpose-based semantic color (requires explicit per-mode hex). |
426
+ | `-d, --dark <hex>` | With `--single`, the dark-mode hex (defaults to the light value). |
427
+ | `-a, --alpha <0-100>` | With `--single`, wraps both modes in `{ color, alpha }` per the Titanium spec. |
428
+ | `-n, --name <name>` | Specify the name (alternative to the positional argument). |
429
+ | `-r, --random` | Palette mode — use a random base color. |
430
+ | `-o, --override` | Place the mapping in `theme.colors` instead of `theme.extend.colors`. |
431
+ | `-q, --quotes` | Keep double quotes in `config.cjs`. |
432
+ | `-l, --log` | Preview the JSON without writing any files. |
433
+
146
434
  ## `install-dependencies` Command
147
435
 
148
436
  This command installs dev dependencies and configuration files in existing PurgeTSS projects, and sets up Visual Studio Code support.
@@ -795,3 +1083,16 @@ purgetss sudo-update
795
1083
  # alias:
796
1084
  purgetss su
797
1085
  ```
1086
+
1087
+ ## Community-Discovered Patterns
1088
+
1089
+ ### v7.2.x environment notes
1090
+
1091
+ These items were surfaced in community threads during the v7.2.x rollout and remain relevant operational context for anyone upgrading from pre-v7.2 installs:
1092
+
1093
+ - Node.js 20+ required (due to the `inquirer` v13 upgrade).
1094
+ - Font Awesome 7 support, including the CSS custom properties format.
1095
+ - Titanium SDK 13.1.x support, with new properties from 13.1.0.GA.
1096
+ - Removed deprecated commands: `copy-fonts` and `build-legacy` are no longer available — scripts referencing either will fail.
1097
+ - Install size reduced by ~45MB (non-essential assets moved to dev dependencies).
1098
+ - Improved Unicode extraction for more formats and direct character mappings in `build-fonts`.
@@ -65,9 +65,6 @@ You can customize any of the following properties individually by adding them in
65
65
  - `trackTintColor`
66
66
  - `viewShadowColor`
67
67
 
68
- > **ℹ️ `backgroundGradient`**
69
- > For custom gradient rules, `backgroundGradient.colors` can use arrays of `{ color, offset }` objects. PurgeTSS v7.4.0 fixed serialization for those nested object arrays in `utilities.tss`.
70
-
71
68
  ## Configurable Properties
72
69
 
73
70
  - `activeTab`
@@ -152,12 +149,19 @@ You can customize any of the following properties individually by adding them in
152
149
  - `zIndex`
153
150
  - `zoomScale`
154
151
 
152
+ ## Custom Rules and Ti Elements
153
+
154
+ Create your own custom rules and include Ti Elements with any number of attributes or conditional statements. See [Custom Rules](./custom-rules.md) for rule syntax and examples.
155
+
156
+ ## Community-Discovered Patterns
157
+
158
+ The following notes come from community experience applying PurgeTSS configurable properties against Titanium's native layout constraints. They are not part of the official reference but prevent common mistakes.
159
+
160
+ > **ℹ️ `backgroundGradient`**
161
+ > For custom gradient rules, `backgroundGradient.colors` can use arrays of `{ color, offset }` objects. PurgeTSS v7.4.0 fixed serialization for those nested object arrays in `utilities.tss`.
162
+
155
163
  > **WARNING: Titanium Padding Constraint**
156
164
  > Titanium does not support native `padding` on `View`, `Window`, `ScrollView`, or `TableView`. Even if `padding*` is configurable, use margins on children for those elements.
157
165
 
158
166
  > **WARNING: Width Fill Constraint**
159
167
  > For full-width Titanium layouts, prefer `w-screen` (`Ti.UI.FILL`) instead of `w-full` (`100%`).
160
-
161
- ## Custom Rules and Ti Elements
162
-
163
- Create your own custom rules and include Ti Elements with any number of attributes or conditional statements. See [Custom Rules](./custom-rules.md) for rule syntax and examples.
@@ -31,9 +31,6 @@ Whether you want to style a Ti Element (also known as a markup element), a custo
31
31
  - `em` or `rem` values are converted with this formula: `value * 16`.
32
32
  - `dp` removes the unit and keeps the value as-is.
33
33
 
34
- > **Platform-Specific Constants**
35
- > If a rule uses `Ti.UI.iOS.*` or `Ti.UI.Android.*` constants, keep that property inside the matching `ios` or `android` block to avoid cross-platform compilation failures.
36
-
37
34
  ## `config.cjs` File Example
38
35
 
39
36
  `./purgetss/config.cjs`
@@ -102,3 +99,10 @@ module.exports = {
102
99
  '.gallery[formFactor=handheld]': { width: '250px' }
103
100
  '.gallery[formFactor=tablet]': { width: '500px' }
104
101
  ```
102
+
103
+ ## Community-Discovered Patterns
104
+
105
+ The following guidance comes from community experience using PurgeTSS custom rules in real projects. It is not part of the official reference but addresses common pitfalls.
106
+
107
+ > **Platform-Specific Constants**
108
+ > If a rule uses `Ti.UI.iOS.*` or `Ti.UI.Android.*` constants, keep that property inside the matching `ios` or `android` block to avoid cross-platform compilation failures.
@@ -18,7 +18,7 @@ If you want a clean `config.cjs`, delete the existing one and run:
18
18
  purgetss init
19
19
  ```
20
20
 
21
- This creates a minimal `./purgetss/config.cjs` file:
21
+ This creates a `./purgetss/config.cjs` file with the default sections:
22
22
 
23
23
  ```javascript
24
24
  module.exports = {
@@ -34,17 +34,56 @@ module.exports = {
34
34
  plugins: [] // Array of properties to ignore
35
35
  }
36
36
  },
37
+ brand: {
38
+ logos: {
39
+ // Optional overrides. If omitted, PurgeTSS auto-discovers files from purgetss/brand/:
40
+ // primary: './docs/logo.svg',
41
+ // androidLauncher: './docs/app-icon.svg',
42
+ // androidSplash: './docs/splash.svg',
43
+ // monochrome: './docs/logo-mono.svg',
44
+ // iosDark: './docs/logo-dark.svg',
45
+ // iosTinted: './docs/logo-tinted.svg'
46
+ },
47
+ padding: {
48
+ ios: '4%', // iOS aesthetic padding. Range 2-8%.
49
+ androidLegacy: '10%', // legacy ic_launcher.png padding %
50
+ androidAdaptive: '19%' // adaptive icon safe-zone %. Spec floor 19.44%.
51
+ },
52
+ android: {
53
+ splash: false, // also generate splash_icon.png × 5
54
+ notification: false // also generate ic_stat_notify.png × 5
55
+ },
56
+ colors: {
57
+ background: '#FFFFFF' // Android adaptive bg + iOS/marketplace flatten
58
+ },
59
+ // Optional iOS overrides:
60
+ // ios: {
61
+ // dark: false, // skip DefaultIcon-Dark.png
62
+ // tinted: false, // skip DefaultIcon-Tinted.png
63
+ // darkBackground: '#111' // opaque dark bg for DefaultIcon-Dark.png (null = transparent per Apple HIG)
64
+ // },
65
+ confirmOverwrites: true // prompt before overwriting files (set false to skip)
66
+ },
67
+ images: {
68
+ quality: 85, // JPEG/WebP/AVIF quality (0-100)
69
+ format: null, // null = keep original; 'webp' | 'jpeg' | 'png' to convert every image
70
+ confirmOverwrites: true // prompt before overwriting files (set false to skip)
71
+ },
37
72
  theme: {
38
73
  extend: {}
39
74
  }
40
75
  };
41
76
  ```
42
77
 
78
+ `init` also creates empty `purgetss/fonts/`, `purgetss/brand/`, and `purgetss/images/` folders on first run, so you can see where each kind of asset goes.
79
+
43
80
  Every section is optional. Only add what you want to change. Anything missing falls back to the defaults.
44
81
 
45
82
  ## Structure
46
83
 
47
- The config file has two main sections: `purge` and `theme`.
84
+ The config file has four main sections: `purge`, `brand`, `images`, and `theme`.
85
+
86
+ `brand:` and `images:` configure the matching CLI commands — see [CLI Commands: `brand`](./cli-commands.md#brand-command) and [CLI Commands: `images`](./cli-commands.md#images-command) for the full option lists. The rest of this page covers `purge` and `theme`.
48
87
 
49
88
  ### `purge` Section
50
89
 
@@ -177,6 +216,31 @@ module.exports = {
177
216
  };
178
217
  ```
179
218
 
219
+ ### Default `font-sans`, `font-serif`, `font-mono`
220
+
221
+ PurgeTSS generates three `fontFamily` classes by default, even when `theme.fontFamily` is not set in `config.cjs`. iOS and Android get different values on purpose so each platform picks its native system font:
222
+
223
+ | Class | iOS | Android |
224
+ | ------------ | ---------------- | ------------ |
225
+ | `font-sans` | `Helvetica Neue` | `sans-serif` |
226
+ | `font-serif` | `Georgia` | `serif` |
227
+ | `font-mono` | `monospace` | `monospace` |
228
+
229
+ If you define a value for `sans`, `serif`, or `mono` in `theme.fontFamily` (or `theme.extend.fontFamily`), your value replaces the default on both platforms — no per-platform fork needed:
230
+
231
+ `./purgetss/config.cjs`
232
+ ```javascript
233
+ module.exports = {
234
+ theme: {
235
+ extend: {
236
+ fontFamily: {
237
+ sans: 'Inter-Regular' // replaces Helvetica Neue / sans-serif on both platforms
238
+ }
239
+ }
240
+ }
241
+ };
242
+ ```
243
+
180
244
  ## Overriding and Extending Properties
181
245
 
182
246
  By default, your project inherits values from the default theme. You have two options depending on your goal.
@@ -462,8 +526,13 @@ module.exports = {
462
526
 
463
527
  This generates classes like `p-72`, `m-84`, and `h-96` in addition to all of the default spacing and sizing utilities.
464
528
 
465
- > **WARNING: Titanium Layout Constraint**
466
- > Titanium does not support native `padding` on `View`, `Window`, `ScrollView`, or `TableView`. Even if PurgeTSS can generate spacing-related utilities, prefer margins on children for those elements.
529
+ ## Community-Discovered Patterns
530
+
531
+ ### Titanium Layout Constraint: `padding` on View / Window / ScrollView / TableView
532
+
533
+ Titanium does not support native `padding` on `View`, `Window`, `ScrollView`, or `TableView`. Even if PurgeTSS generates spacing-related utilities (`p-*`, `px-*`, `py-*`), applying them to those elements is silently ignored at runtime. Prefer margins on the children of those containers instead — `m-*`, `mt-*`, `mb-*`, etc. — which Titanium honors correctly.
534
+
535
+ This is a Titanium platform constraint, not a PurgeTSS bug. `Button`, `Label`, and `TextField` do accept `padding` natively.
467
536
 
468
537
  ## List of Customizable Properties
469
538
 
@@ -1,5 +1,15 @@
1
1
  # Dynamic Component Creation with PurgeTSS
2
2
 
3
+ > **SCOPE NOTE**
4
+ >
5
+ > This reference covers dynamic component creation using **Alloy's `$.UI.create()` helper** and **`Alloy.createStyle()` + `applyProperties()`**, both combined with PurgeTSS utility classes. It is an Alloy + PurgeTSS integration guide, **not** documentation for the `purgetss.ui` native module (see [animation-system.md](./animation-system.md) and [animation-advanced.md](./animation-advanced.md) for that module).
6
+ >
7
+ > For general Alloy controller and view patterns, refer to the `alloy-guides` and `alloy-howtos` skills.
8
+
9
+ ## Community-Discovered Patterns
10
+
11
+ The guidance in this file reflects patterns that PurgeTSS users have converged on when building components imperatively from Alloy controllers. It complements — but is not a substitute for — official Alloy documentation.
12
+
3
13
  ## Overview
4
14
 
5
15
  When creating components dynamically in Controllers (not declaratively in XML), PurgeTSS provides two methods to apply utility classes:
@@ -7,8 +17,9 @@ When creating components dynamically in Controllers (not declaratively in XML),
7
17
  1. **`$.UI.create()`** - Create components with PurgeTSS classes (Recommended)
8
18
  2. **`Alloy.createStyle()` + `applyProperties()`** - Apply PurgeTSS styles to existing components
9
19
 
10
- > **💡 BEST PRACTICE**
11
- > **Always prefer `$.UI.create()` for dynamic components** - it's cleaner, more readable, and PurgeTSS will process the classes automatically during build.
20
+ > **BEST PRACTICE**
21
+ >
22
+ > Always prefer `$.UI.create()` for dynamic components — it's cleaner, more readable, and PurgeTSS will process the classes automatically during build.
12
23
 
13
24
  ---
14
25
 
@@ -333,24 +344,25 @@ function createIconGrid(items) {
333
344
 
334
345
  ### PurgeTSS Processes Classes During Build
335
346
 
336
- > **️ℹ️ HOW IT WORKS**
347
+ > **NOTE HOW IT WORKS**
348
+ >
337
349
  > When you use `$.UI.create()` or `Alloy.createStyle()` with classes:
338
350
  >
339
351
  > 1. PurgeTSS scans your controllers for these class references
340
352
  > 2. It adds the classes to the generated `app.tss`
341
353
  > 3. At runtime, Alloy applies the styles to your components
342
354
  >
343
- > This means you get **full PurgeTSS power** even with dynamic components!
355
+ > This means you get the full PurgeTSS utility surface even with dynamic components.
344
356
 
345
357
  ### Class Verification
346
358
 
347
- Just like with XML views, **always verify classes exist** before using them:
359
+ Just like with XML views, always verify classes exist before using them:
348
360
 
349
361
  ```javascript
350
- // CORRECT - Verified classes
362
+ // CORRECT - Verified classes
351
363
  classes: ['w-screen', 'h-auto', 'bg-white', 'rounded-lg']
352
364
 
353
- // WRONG - These classes don't exist
365
+ // WRONG - These classes don't exist
354
366
  classes: ['flex-row', 'justify-center', 'p-4'] // No flexbox, no p-* on View
355
367
  ```
356
368
 
@@ -425,7 +437,8 @@ function setState(state) {
425
437
  }
426
438
  ```
427
439
 
428
- > **💡 When to Use `classes` vs `applyProperties`**
440
+ > **NOTE When to use `classes` vs `applyProperties`**
441
+ >
429
442
  > - Use `classes` when you want to swap entire style sets (e.g., active/inactive states)
430
443
  > - Use `applyProperties` with direct values when changing individual properties (e.g., text, enabled)
431
444
  > - Combine both for complex state changes
@@ -434,7 +447,7 @@ function setState(state) {
434
447
 
435
448
  ## Anti-Patterns to Avoid
436
449
 
437
- ### Don't Use `Ti.UI.create()` with Manual Styles
450
+ ### Don't use `Ti.UI.create()` with Manual Styles
438
451
 
439
452
  ```javascript
440
453
  // WRONG - Manual styling, no PurgeTSS benefits
@@ -446,7 +459,7 @@ const view = Ti.UI.createView({
446
459
  })
447
460
  ```
448
461
 
449
- ### Use `$.UI.create()` with PurgeTSS Classes
462
+ ### Use `$.UI.create()` with PurgeTSS classes
450
463
 
451
464
  ```javascript
452
465
  // CORRECT - Full PurgeTSS power
@@ -455,7 +468,7 @@ const view = $.UI.create('View', {
455
468
  })
456
469
  ```
457
470
 
458
- ### Don't Mix Styles and Classes
471
+ ### Don't mix inline styles and classes
459
472
 
460
473
  ```javascript
461
474
  // CONFUSING - Mix of styles and classes
@@ -465,7 +478,7 @@ const view = $.UI.create('View', {
465
478
  })
466
479
  ```
467
480
 
468
- ### Use Only Classes (or Only Styles)
481
+ ### Use only classes (or only styles)
469
482
 
470
483
  ```javascript
471
484
  // CORRECT - Pure PurgeTSS
@@ -494,8 +507,10 @@ view.applyProperties(Alloy.createStyle('index', {
494
507
  | **`Alloy.createStyle()`** | Styling existing components | `Alloy.createStyle('view', { classes: 'bg-white' })` |
495
508
  | **`applyProperties()`** | Apply style to component | `component.applyProperties(style)` |
496
509
 
497
- > **💡 REMEMBER**
498
- > Both methods give you **full access to PurgeTSS utilities**:
510
+ > **NOTE REMEMBER**
511
+ >
512
+ > Both methods give you full access to PurgeTSS utilities:
513
+ >
499
514
  > - All color classes (`bg-*`, `text-*`, `border-*`)
500
515
  > - All spacing classes (`m-*`, `gap-*`, and `p-*` where the Titanium component supports padding)
501
516
  > - All layout classes (`horizontal`, `vertical`)