@maccesar/titools 2.7.2 → 2.9.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 (51) hide show
  1. package/README.md +6 -13
  2. package/lib/config.js +1 -1
  3. package/package.json +1 -1
  4. package/skills/purgetss/SKILL.md +25 -0
  5. package/skills/purgetss/references/EXAMPLES.md +86 -24
  6. package/skills/purgetss/references/app-branding.md +412 -0
  7. package/skills/purgetss/references/appearance-module.md +161 -0
  8. package/skills/purgetss/references/apply-directive.md +87 -31
  9. package/skills/purgetss/references/arbitrary-values.md +4 -0
  10. package/skills/purgetss/references/class-categories.md +10 -7
  11. package/skills/purgetss/references/class-index.md +25 -18
  12. package/skills/purgetss/references/cli-commands.md +219 -8
  13. package/skills/purgetss/references/configurable-properties.md +11 -7
  14. package/skills/purgetss/references/custom-rules.md +7 -3
  15. package/skills/purgetss/references/customization-deep-dive.md +52 -4
  16. package/skills/purgetss/references/dynamic-component-creation.md +29 -14
  17. package/skills/purgetss/references/grid-layout.md +20 -8
  18. package/skills/purgetss/references/icon-fonts.md +4 -0
  19. package/skills/purgetss/references/installation-setup.md +3 -8
  20. package/skills/purgetss/references/ios-large-titles.md +141 -0
  21. package/skills/purgetss/references/migration-guide.md +162 -25
  22. package/skills/purgetss/references/multi-density-images.md +363 -0
  23. package/skills/purgetss/references/opacity-modifier.md +4 -0
  24. package/skills/purgetss/references/performance-tips.md +5 -0
  25. package/skills/purgetss/references/platform-modifiers.md +4 -0
  26. package/skills/purgetss/references/semantic-colors.md +386 -0
  27. package/skills/purgetss/references/smart-mappings.md +50 -28
  28. package/skills/purgetss/references/tikit-components.md +3 -1
  29. package/skills/purgetss/references/titanium-resets.md +46 -15
  30. package/skills/purgetss/references/ui-ux-design.md +32 -6
  31. package/skills/ti-branding/SKILL.md +0 -230
  32. package/skills/ti-branding/assets/ic_launcher.xml +0 -6
  33. package/skills/ti-branding/references/android-adaptive-icons.md +0 -85
  34. package/skills/ti-branding/references/cleanup-legacy.md +0 -112
  35. package/skills/ti-branding/references/ios-appiconset.md +0 -62
  36. package/skills/ti-branding/references/master-input-guidelines.md +0 -84
  37. package/skills/ti-branding/references/notification-icons.md +0 -63
  38. package/skills/ti-branding/references/splash-screen-api.md +0 -81
  39. package/skills/ti-branding/references/ti-icon-paths.md +0 -84
  40. package/skills/ti-branding/references/tiapp-xml-snippets.md +0 -92
  41. package/skills/ti-branding/scripts/lib/cleanup-legacy.sh +0 -230
  42. package/skills/ti-branding/scripts/lib/deps.sh +0 -58
  43. package/skills/ti-branding/scripts/lib/gen-android-adaptive.sh +0 -64
  44. package/skills/ti-branding/scripts/lib/gen-android-legacy.sh +0 -36
  45. package/skills/ti-branding/scripts/lib/gen-ios.sh +0 -46
  46. package/skills/ti-branding/scripts/lib/gen-marketplace.sh +0 -55
  47. package/skills/ti-branding/scripts/lib/gen-notification.sh +0 -46
  48. package/skills/ti-branding/scripts/lib/gen-splash-icon.sh +0 -31
  49. package/skills/ti-branding/scripts/lib/prepare-master.sh +0 -48
  50. package/skills/ti-branding/scripts/lib/validate.sh +0 -67
  51. package/skills/ti-branding/scripts/ti-branding +0 -546
@@ -203,6 +203,81 @@ theme: {
203
203
  '.btn[if=Alloy.Globals.iPhoneX]': { bottom: 48 }
204
204
  ```
205
205
 
206
+ ## Customizing Window, View, and ImageView
207
+
208
+ `Window`, `View`, and `ImageView` have built-in defaults (white Window background, `Ti.UI.SIZE` on View, `hires: true` on ImageView for iOS). To change those defaults globally, put the customization under `theme.extend` — the same place you would extend `colors` or `spacing`:
209
+
210
+ `./purgetss/config.cjs`
211
+ ```javascript
212
+ module.exports = {
213
+ theme: {
214
+ extend: {
215
+ Window: {
216
+ apply: 'exit-on-close-false bg-blue-500'
217
+ }
218
+ }
219
+ }
220
+ };
221
+ ```
222
+
223
+ Now every `<Window>` in the project picks up `backgroundColor: '#3b82f6'` and `exitOnClose: false`.
224
+
225
+ The same pattern works for `View` and `ImageView`. For example, to make all `ImageView` elements use `hires: true` on iOS (which PurgeTSS already does by default on iOS), or to set a different default for `View`:
226
+
227
+ `./purgetss/config.cjs`
228
+ ```javascript
229
+ module.exports = {
230
+ theme: {
231
+ extend: {
232
+ ImageView: {
233
+ ios: {
234
+ apply: 'hires-true'
235
+ }
236
+ },
237
+ View: {
238
+ apply: 'wh-auto'
239
+ }
240
+ }
241
+ }
242
+ };
243
+ ```
244
+
245
+ ### Shorthand: no `default:` wrapper needed
246
+
247
+ The examples above use `{ apply: '...' }` directly. Internally that gets normalized to `{ default: { apply: '...' } }`, so both forms produce the same TSS:
248
+
249
+ ```javascript
250
+ // Both of these work
251
+ Window: { apply: 'exit-on-close-false bg-blue-500' }
252
+ Window: { default: { apply: 'exit-on-close-false bg-blue-500' } }
253
+ ```
254
+
255
+ Use the explicit `default:` wrapper when you also need platform blocks (`ios:`, `android:`) next to it. For the common case of one bundle of defaults, the shorthand reads better.
256
+
257
+ ### Apply Wins Over Static Defaults
258
+
259
+ If `apply` sets a property that the component already has as a built-in default, the applied value replaces the original instead of both ending up in the final TSS:
260
+
261
+ `./purgetss/config.cjs`
262
+ ```javascript
263
+ module.exports = {
264
+ theme: {
265
+ extend: {
266
+ Window: { apply: 'bg-blue-500' }
267
+ }
268
+ }
269
+ };
270
+ ```
271
+
272
+ `./purgetss/styles/utilities.tss`
273
+ ```tss
274
+ /* Before dedup: { backgroundColor: '#FFFFFF', backgroundColor: '#3b82f6' } */
275
+ /* After dedup: */
276
+ 'Window': { backgroundColor: '#3b82f6' }
277
+ ```
278
+
279
+ Without the dedup, both `backgroundColor` entries would land in the file; the last one would win at runtime anyway, but reading the TSS with two copies of the same property is confusing. The builder keeps only the applied value.
280
+
206
281
  ## Platform-Specific Classes
207
282
 
208
283
  Several classes in `utilities.tss` are platform-specific (e.g., `clip-enabled`, `status-bar-style-light-content`). These only exist with a `[platform=ios]` or `[platform=android]` suffix.
@@ -276,16 +351,21 @@ module.exports = {
276
351
  '.my-view': { backgroundColor: '#22c55e', width: 128, height: 128 }
277
352
  ```
278
353
 
279
- > **Titanium Fill Rule**
280
- > When composing layout utilities inside `apply`, prefer `w-screen` for fill behavior. `w-full` maps to `100%`, not `Ti.UI.FILL`.
281
-
282
354
  ## Community-Discovered Patterns
283
355
 
356
+ ### Titanium Fill Rule
357
+
358
+ When composing layout utilities inside `apply`, prefer `w-screen` for fill behavior. `w-full` maps to `100%`, not `Ti.UI.FILL`. In Titanium, `Ti.UI.FILL` is the layout primitive that makes a view fill its parent; a literal `100%` can behave unexpectedly inside nested containers.
359
+
360
+ ### Platform-Specific Constants in `apply`
361
+
362
+ Constants like `Ti.UI.iOS.CLIP_MODE_ENABLED` or `Ti.UI.iOS.StatusBar.LIGHT_CONTENT` only exist on the platform that defines them. PurgeTSS utility classes such as `clip-enabled` or `status-bar-style-light-content` therefore only exist with a `[platform=ios]` or `[platform=android]` suffix in `utilities.tss`. When you reference them from `apply`, put them inside the correct platform block (`ios:` / `android:`) so PurgeTSS resolves them — otherwise the class silently drops on the wrong platform and can throw a runtime error if it reaches it. See the "Platform-Specific Classes" section above for the resolution rules.
363
+
284
364
  ### Global Window defaults for Large Titles + ScrollView (iOS)
285
365
 
286
- When using `largeTitleEnabled` with a ScrollView inside NavigationWindow or TabGroup, three Window properties must work together: `auto-adjust-scroll-view-insets`, `extend-edges-all`, and `large-title-enabled`. Without all three, the ScrollView content overlaps behind the navigation bar or the large title renders with a visible delay.
366
+ **See the dedicated reference: [`ios-large-titles.md`](./ios-large-titles.md)** it covers the full pattern (three-property pairing, global-defaults recipe, TabGroup implicit NavigationWindow behavior, detail-window opt-out, and the ScrollView `content-w-screen` / `content-h-auto` pairing).
287
367
 
288
- Instead of repeating these classes on every Window XML, use `apply` in `config.cjs` to set the base properties as global defaults:
368
+ Minimal recap when Large Titles are in use, set the base iOS Window defaults once via `apply` in `config.cjs` rather than repeating them in every XML view:
289
369
 
290
370
  `./purgetss/config.cjs`
291
371
  ```javascript
@@ -293,35 +373,11 @@ module.exports = {
293
373
  theme: {
294
374
  Window: {
295
375
  ios: {
296
- apply: 'auto-adjust-scroll-view-insets extend-edges-all status-bar-style-light-content'
376
+ apply: 'auto-adjust-scroll-view-insets extend-edges-all large-title-enabled'
297
377
  }
298
378
  }
299
379
  }
300
380
  };
301
381
  ```
302
382
 
303
- `./purgetss/styles/utilities.tss`
304
- ```tss
305
- 'Window[platform=ios]': { autoAdjustScrollViewInsets: true, extendEdges: [ Ti.UI.EXTEND_EDGE_ALL ], statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT }
306
- ```
307
-
308
- Then in each view XML, only add `largeTitleEnabled` and `largeTitleDisplayMode` as needed:
309
-
310
- ```xml
311
- <Window title="Home" class="large-title-enabled">
312
- <ScrollView class="vertical w-screen" contentHeight="Ti.UI.SIZE">
313
- <!-- Content starts below the nav bar automatically -->
314
- </ScrollView>
315
- </Window>
316
- ```
317
-
318
- This works for both NavigationWindow and TabGroup — on iOS, TabGroup wraps each Tab in an implicit NavigationWindow.
319
-
320
- | Class | Property | Value |
321
- |---|---|---|
322
- | `auto-adjust-scroll-view-insets` | `autoAdjustScrollViewInsets` | `true` |
323
- | `extend-edges-all` | `extendEdges` | `[ Ti.UI.EXTEND_EDGE_ALL ]` |
324
- | `large-title-enabled` | `largeTitleEnabled` | `true` |
325
- | `large-title-display-mode` | `largeTitleDisplayMode` | Uses `LARGE_TITLE_DISPLAY_MODE_*` constants |
326
-
327
- > **Why `ios:` block instead of inline `ios:` prefix?** The three classes (`auto-adjust-scroll-view-insets`, `extend-edges-all`, `status-bar-style-light-content`) are platform-specific — they only exist with `[platform=ios]` suffix in `utilities.tss`. Using the `ios:` block in `config.cjs` ensures PurgeTSS resolves them correctly. See "Platform-Specific Classes" above.
383
+ The `ios:` block (not an inline `ios:` prefix) is required because these classes only exist with a `[platform=ios]` suffix — see "Platform-Specific Classes" above. The *why* (rendering delay vs content-behind-nav-bar), the display-mode constants, and per-window overrides live in [`ios-large-titles.md`](./ios-large-titles.md) and in the official PurgeTSS docs at [Best Practices → Large Titles on iOS](https://purgetss.com/docs/best-practices/3-large-titles-on-ios).
@@ -306,6 +306,10 @@ Try this example on an iPad or tablet.
306
306
  </Alloy>
307
307
  ```
308
308
 
309
+ ## Community-Discovered Patterns
310
+
311
+ These constraints reflect community experience using arbitrary values against the realities of the Titanium layout engine. They are not part of the official reference but prevent common mistakes.
312
+
309
313
  > **Titanium Layout Constraint**
310
314
  > Prefer `w-screen` instead of `w-full` when you need fill behavior. `w-full` maps to `100%`, not `Ti.UI.FILL`.
311
315
 
@@ -21,12 +21,13 @@ Complete inventory of all class prefixes organized by functional category. For n
21
21
  | `content-*` | ~20 | `content-h-*`, `content-w-*` |
22
22
  | `aspect-*` | 2 | `aspect-ratio-16-9`, `aspect-ratio-4-3` |
23
23
 
24
- **Important: `w-full` vs `w-screen`**
25
- - `w-full` → `width: '100%'` — 100% of parent container
26
- - `w-screen` → `width: Ti.UI.FILL` — Fills all available space in parent
27
- - `h-full` → `height: '100%'` — 100% of parent container
28
- - `h-screen` → `height: Ti.UI.FILL` — Fills all available space in parent
29
- - `wh-full` → Both `'100%'`
24
+ > **Community-Discovered Pattern: `w-full` vs `w-screen`**
25
+ >
26
+ > - `w-full` → `width: '100%'` — 100% of parent container
27
+ > - `w-screen` → `width: Ti.UI.FILL` — Fills all available space in parent
28
+ > - `h-full` → `height: '100%'` — 100% of parent container
29
+ > - `h-screen` → `height: Ti.UI.FILL` — Fills all available space in parent
30
+ > - `wh-full` → Both `'100%'`
30
31
 
31
32
  ### Spacing (Margins & Padding)
32
33
 
@@ -108,7 +109,7 @@ Complete inventory of all class prefixes organized by functional category. For n
108
109
  | Prefix | Count | Examples |
109
110
  | --- | --- | --- |
110
111
  | `text-*` | 273 | Text colors, sizes, alignment |
111
- | `font-*` | 9 | `font-thin`, `font-light`, `font-normal`, `font-medium`, `font-semibold`, `font-bold`, `font-extrabold`, `font-black` |
112
+ | `font-*` | 12 | Weights: `font-thin`, `font-light`, `font-normal`, `font-medium`, `font-semibold`, `font-bold`, `font-extrabold`, `font-black`. Families (v7.5.3+): `font-sans`, `font-serif`, `font-mono` |
112
113
  | `line-h-multiple-*` | ~85 | Line height as multiple |
113
114
  | `line-spacing-*` | ~85 | Line spacing |
114
115
  | `line-break-mode-*` | 7 | `line-break-mode-attribute-by-word-wrapping`, etc. |
@@ -192,6 +193,8 @@ Complete inventory of all class prefixes organized by functional category. For n
192
193
  | `duration-*` | 22 | `duration-0`, `duration-50` to `duration-5000` |
193
194
  | `delay-*` | 22 | `delay-0`, `delay-50` to `delay-5000` |
194
195
  | `repeat-*` | ~31 | `repeat-*` variants |
196
+ | `snap-*` (v7.4.0+) | 6 | `snap-back`, `snap-back-false`, `snap-center`, `snap-center-false`, `snap-magnet`, `snap-magnet-false` — drop behaviors for draggable views |
197
+ | `keep-z-index` (v7.4.0+) | 2 | `keep-z-index`, `keep-z-index-false` — preserves z-order during drag when using `transition` layouts |
195
198
 
196
199
  ### Shadows & Elevation
197
200
 
@@ -120,10 +120,11 @@ Some PurgeTSS classes combine multiple Titanium properties under a single class
120
120
  | `dragging-*` | `draggingType` | Animation module dragging |
121
121
  | `filter-attribute-*` | `filterAttribute` | ListView filtering |
122
122
  | `flip-*` | `flip` | Animation flipping |
123
- | `font-*` | `fontFamily`, `fontSize`, `fontStyle`, `fontWeight` | Typography |
123
+ | `font-*` | `fontFamily`, `fontSize`, `fontStyle`, `fontWeight` | Typography (v7.5.3+: `font-sans`, `font-serif`, `font-mono` family classes) |
124
124
  | `grid-*` | Various | Grid layout system |
125
125
  | `h-*` | `height` | All components |
126
126
  | `hint-*` | `hintTextColor` | TextField placeholder |
127
+ | `keep-z-index` | `animationProperties.keepZIndex` (v7.4.0+) | Preserves z-order during drag when used with `transition` |
127
128
  | `layout-*` | `layout` | View layout modes |
128
129
  | `minimum-font-size-*` | `minimumFontSize` | Label auto-shrink |
129
130
  | `navigation-*` | `navigationMode` | Navigation modes |
@@ -135,6 +136,7 @@ Some PurgeTSS classes combine multiple Titanium properties under a single class
135
136
  | `scroll-type-*` | `scrollType` | Android scroll type |
136
137
  | `shadow-*` | `shadowOffset`, `shadowRadius`, `shadowColor` | Box shadows |
137
138
  | `show-*scroll-indicator` | `showHorizontalScrollIndicator`, `showVerticalScrollIndicator` | ScrollView |
139
+ | `snap-*` | `animationProperties.snap.{back, center, magnet}` (v7.4.0+) | Draggable drop behaviors |
138
140
  | `status-bar-style-*` | `statusBarStyle` | iOS status bar |
139
141
  | `tint-*` | `tintColor` | View/Button tinting |
140
142
  | `title-*` | `titleAttributes: color/shadow` | iOS title styling |
@@ -759,7 +761,11 @@ For the complete prefix inventory organized by category (Layout, Spacing, Colors
759
761
 
760
762
  ---
761
763
 
762
- ## PROHIBITED: CSS Classes (DO NOT EXIST)
764
+ ## Community-Discovered Patterns
765
+
766
+ The rest of this document collects conventions, prohibitions, and insights surfaced by PurgeTSS users in real Titanium projects. They reflect how the utility system is actually used, not just how it is defined.
767
+
768
+ ### PROHIBITED: CSS Classes (DO NOT EXIST)
763
769
 
764
770
  | CSS Class | Issue | PurgeTSS Alternative |
765
771
  | ----------------- | --------------------------------- | ------------------------------------------- |
@@ -779,10 +785,26 @@ For the complete prefix inventory organized by category (Layout, Spacing, Colors
779
785
  | `leading-*` | Uses different prefix | Use `line-h-multiple-*` or `line-spacing-*` |
780
786
  | `tracking-*` | Uses different prefix | Use `letter-spacing-*` |
781
787
 
788
+ ### Key Insights from Real Data
789
+
790
+ 1. **21,236 unique classes** across **364 unique prefixes** - Far more than initially documented
791
+ 2. **Extensive state management** - Hundreds of `*enabled`, `*-false` classes for UI states
792
+ 3. **Platform-specific classes** - Many iOS/Android specific variants (like `[platform=ios]`)
793
+ 4. **Complete color coverage** - All 22 Tailwind v3 colors with 11 shades each (50-950) = 242 color variants per prefix
794
+ 5. **Boolean class pattern** - For properties like `editable`, `enabled`, `visible` → `class` and `class-false`
795
+ 6. **UI component state variants** - `selected-*`, `badge-*`, `title-*`, `disabled-*` with full color coverage
796
+ 7. **Keyboard toolbar styling** - Extensive `keyboard-toolbar-*` classes for custom keyboard accessories
797
+ 8. **Status bar & navigation** - `status-bar-*`, `tabs-*`, `nav-*` for system UI customization
798
+ 9. **Accessibility support** - `accessibility-*` classes for a11y properties
799
+ 10. **Animation system** - `duration-*`, `delay-*`, `rotate-*`, `scale-*` for PurgeTSS Animation component
800
+
782
801
  ---
783
802
 
784
803
  ## All 364 Unique Prefixes (Alphabetical)
785
804
 
805
+ > **NOTE**: Recent additions — v7.4.0 introduced `snap-back`, `snap-back-false`, `snap-center`, `snap-center-false`, `snap-magnet`, `snap-magnet-false`, `keep-z-index`, and `keep-z-index-false` for the Animation module drop/drag system. v7.5.3 introduced font-family classes `font-sans`, `font-serif`, `font-mono` alongside the existing weight classes.
806
+
807
+
786
808
  ```
787
809
  accessibility, accessory, accuracy, action, active, activity, alignment, all, allow, allows,
788
810
  amber, anchor, animated, app, arrow, aspect, audio, authentication, auto, autocapitalization,
@@ -809,7 +831,7 @@ pl, placeholder, platform, playback, pointer, portrait, position, pr, prevent, p
809
831
  prune, pt, pull, purple, px, py, ready, recording, red, remote, repeat, requires, results,
810
832
  return, reverse, right, role, rose, rotate, rounded, row, running, save, scale, scales,
811
833
  scaling, scroll, scrollable, scrolling, scrolls, search, section, secure, selected, selection,
812
- sentences, separator, shadow, shift, show, shows, shuffle, size, sky, slate, smooth, sorted,
834
+ sentences, separator, shadow, shift, show, shows, shuffle, size, sky, slate, smooth, snap, sorted,
813
835
  source, split, state, status, stone, stopped, style, submit, subtitle, success, suppress,
814
836
  suppresses, sustained, swipe, swipeable, tab, tabs, target, teal, text, theme, throw, thumb,
815
837
  timeout, tint, title, tls, to, toggle, toolbar, top, torch, touch, trace, track, translucent,
@@ -868,18 +890,3 @@ These properties are NOT styled with classes in PurgeTSS - use as XML attributes
868
890
  | `bindId` | `bindId="myData"` | ListView data binding |
869
891
 
870
892
  **Note:** For `autocapitalization`, `editable`, `enabled`, `visible`, `autocorrect` - PurgeTSS DOES have classes (see above), so you CAN use either the class or the attribute depending on your preference.
871
-
872
- ---
873
-
874
- ## Key Insights from Real Data
875
-
876
- 1. **21,236 unique classes** across **364 unique prefixes** - Far more than initially documented
877
- 2. **Extensive state management** - Hundreds of `*enabled`, `*-false` classes for UI states
878
- 3. **Platform-specific classes** - Many iOS/Android specific variants (like `[platform=ios]`)
879
- 4. **Complete color coverage** - All 22 Tailwind v3 colors with 11 shades each (50-950) = 242 color variants per prefix
880
- 5. **Boolean class pattern** - For properties like `editable`, `enabled`, `visible` → `class` and `class-false`
881
- 6. **UI component state variants** - `selected-*`, `badge-*`, `title-*`, `disabled-*` with full color coverage
882
- 7. **Keyboard toolbar styling** - Extensive `keyboard-toolbar-*` classes for custom keyboard accessories
883
- 8. **Status bar & navigation** - `status-bar-*`, `tabs-*`, `nav-*` for system UI customization
884
- 9. **Accessibility support** - `accessibility-*` classes for a11y properties
885
- 10. **Animation system** - `duration-*`, `delay-*`, `rotate-*`, `scale-*` for PurgeTSS Animation component
@@ -1,12 +1,12 @@
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.0**
4
+ > - **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).
5
+ > - **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).
6
+ > - **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).
7
+ > - **`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.
8
+ > - **Default font family classes (v7.5.3)** — `font-sans`, `font-serif`, and `font-mono` generated automatically with platform-appropriate values.
9
+ > - **XML validation (v7.5.3)** detects illegal `--` sequences inside XML comments during pre-validation.
10
10
 
11
11
  This page lists the commands available in PurgeTSS.
12
12
 
@@ -14,6 +14,8 @@ This page lists the commands available in PurgeTSS.
14
14
 
15
15
  - `init`: Initializes PurgeTSS on an existing Alloy project.
16
16
  - `create`: Creates a new Alloy project with PurgeTSS already set up.
17
+ - `brand`: Generates the Titanium branding set from a single logo. See [`brand` Command](#brand-command).
18
+ - `images`: Generates multi-density UI images from sources in `./purgetss/images/`. See [`images` Command](#images-command).
17
19
 
18
20
  ## Development Commands
19
21
 
@@ -28,6 +30,7 @@ This page lists the commands available in PurgeTSS.
28
30
  ## Utility Commands
29
31
 
30
32
  - `shades`: Generates shades and tints for a color and writes the palette to `config.cjs`.
33
+ - `semantic`: Generates Titanium semantic colors (Light/Dark) into `app/assets/semantic.colors.json`. See [`semantic` Command](#semantic-command).
31
34
  - `color-module`: Creates `./app/lib/purgetss.colors.js` with the colors defined in `config.cjs`.
32
35
  - `module`: Installs `purgetss.ui.js` in the `lib` folder.
33
36
 
@@ -64,14 +67,30 @@ module.exports = {
64
67
  plugins: [] // Array of properties to ignore
65
68
  }
66
69
  },
70
+ brand: {
71
+ splash: false, // also generate splash_icon.png × 5
72
+ padding: '15%', // Android safe-zone. Range: 12% tight (mature logos) — 20% conservative. Spec floor 19.44%.
73
+ iosPadding: '4%', // iOS aesthetic. Range: 2% bold — 8% conservative. No launcher mask.
74
+ darkBgColor: null, // opaque dark bg for DefaultIcon-Dark.png (null = transparent per Apple HIG)
75
+ bgColor: '#FFFFFF', // Android adaptive bg + iOS/marketplace flatten
76
+ notification: false, // also generate ic_stat_notify.png × 5
77
+ confirmOverwrites: true // prompt before overwriting files (set false to skip)
78
+ },
79
+ images: {
80
+ quality: 85, // JPEG/WebP/AVIF quality (0-100)
81
+ format: null, // null = keep original; 'webp' | 'jpeg' | 'png' to convert every image
82
+ confirmOverwrites: true // prompt before overwriting files (set false to skip)
83
+ },
67
84
  theme: {
68
85
  extend: {}
69
86
  }
70
87
  };
71
88
  ```
72
89
 
90
+ `init` also creates empty `purgetss/fonts/`, `purgetss/brand/`, and `purgetss/images/` folders so you can see where each kind of asset goes.
91
+
73
92
  > **Tip**
74
- > PurgeTSS looks for `./purgetss/config.cjs`. Each section is optional and can be customized. Missing sections use the default configuration.
93
+ > 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
94
 
76
95
  ## `create` Command
77
96
 
@@ -143,6 +162,185 @@ Recommended VSCode extensions:
143
162
 
144
163
  `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
164
 
165
+ ## `brand` Command
166
+
167
+ Introduced in v7.6.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. Alloy and Classic projects are auto-detected.
168
+
169
+ > **Tip**
170
+ > 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.
171
+
172
+ ```bash
173
+ purgetss brand # uses purgetss/brand/logo.{svg,png} + config
174
+ purgetss brand path/to/logo.svg # positional logo path override
175
+ ```
176
+
177
+ ### Flags
178
+
179
+ | Flag | Purpose |
180
+ | --- | --- |
181
+ | `--project <path>` | Project root (defaults to cwd). |
182
+ | `--dry-run` | Preview what would be generated without writing any files. |
183
+ | `--output <dir>` | Stage into `<dir>` instead of writing in place. |
184
+ | `-y, --yes` | Skip the overwrite confirmation prompt for this invocation. |
185
+ | `--bg-color <hex>` | Background color for Android adaptive + iOS/marketplace flatten. |
186
+ | `--padding <n>` | Android safe-zone percentage (range `12-20`, default `15`). |
187
+ | `--ios-padding <n>` | iOS aesthetic padding percentage (range `2-8`, default `4`). |
188
+ | `--notification` | Also emit `ic_stat_notify.png × 5`. |
189
+ | `--splash` | Also emit `splash_icon.png × 5`. |
190
+ | `--monochrome-logo <path>` | Override `purgetss/brand/logo-mono.{svg,png}`. |
191
+ | `--dark-logo <path>` | Override `purgetss/brand/logo-dark.{svg,png}`. |
192
+ | `--dark-bg-color <hex>` | Opaque dark bg for `DefaultIcon-Dark.png` (default: transparent per Apple HIG). |
193
+ | `--tinted-logo <path>` | Override `purgetss/brand/logo-tinted.{svg,png}`. |
194
+ | `--no-dark` | Skip `DefaultIcon-Dark.png`. |
195
+ | `--no-tinted` | Skip `DefaultIcon-Tinted.png`. |
196
+ | `--cleanup-legacy` | Remove obsolete branding artifacts (reads `tiapp.xml` for safety rules). |
197
+ | `--aggressive` | With `--cleanup-legacy`, also remove `ldpi` density folders. |
198
+ | `--notes` | Print full `tiapp.xml` snippets + padding tuning guide. |
199
+ | `--debug` | Print extra diagnostics. |
200
+
201
+ ### Positional argument
202
+
203
+ - `[logo-path]` (optional) — overrides auto-discovery of `purgetss/brand/logo.{svg,png}`.
204
+
205
+ ### Config block
206
+
207
+ Defaults live under `brand:` in `purgetss/config.cjs` and are injected automatically:
208
+
209
+ ```javascript
210
+ brand: {
211
+ splash: false, // also generate splash_icon.png × 5
212
+ padding: '15%', // Android safe-zone. Range 12-20%.
213
+ iosPadding: '4%', // iOS aesthetic padding. Range 2-8%.
214
+ darkBgColor: null, // opaque dark bg for DefaultIcon-Dark.png (null = transparent per Apple HIG)
215
+ bgColor: '#FFFFFF', // Android adaptive bg + iOS/marketplace flatten
216
+ notification: false, // also generate ic_stat_notify.png × 5
217
+ confirmOverwrites: true // prompt before overwriting files
218
+ }
219
+ ```
220
+
221
+ ### Confirmation prompt
222
+
223
+ `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.
224
+
225
+ ### Examples
226
+
227
+ ```bash
228
+ purgetss brand # uses purgetss/brand/logo.svg + config
229
+ purgetss brand --bg-color "#0B1326" # override bg color
230
+ purgetss brand --notification --splash # add notification + splash
231
+ purgetss brand --no-tinted # skip iOS 18+ tinted variant
232
+ purgetss brand --dry-run # preview without writing
233
+ purgetss brand --cleanup-legacy --dry-run # preview legacy cleanup
234
+ ```
235
+
236
+ ## `images` Command
237
+
238
+ 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.
239
+
240
+ > **Tip**
241
+ > 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.
242
+
243
+ ```bash
244
+ purgetss images # uses purgetss/images/ + config
245
+ purgetss images background/pink-texture.png # re-process one file (short path)
246
+ purgetss images background/ # re-process one subfolder
247
+ ```
248
+
249
+ ### Flags
250
+
251
+ | Flag | Purpose |
252
+ | --- | --- |
253
+ | `--android` | Only emit Android density variants. Mutually exclusive with `--ios`. |
254
+ | `--ios` | Only emit iPhone scale variants. Mutually exclusive with `--android`. |
255
+ | `--format <ext>` | Convert all outputs to `webp`, `jpeg`, `png`, `avif`, `gif`, or `tiff`. Default: keep source format. |
256
+ | `--quality <n>` | Quality `0-100` for lossy formats. Default `85`. |
257
+ | `--dry-run` | Preview without writing any files. |
258
+ | `--project <path>` | Project root (defaults to cwd). |
259
+ | `-y, --yes` | Skip the overwrite confirmation prompt. |
260
+ | `--debug` | Print extra diagnostics. |
261
+
262
+ ### Positional argument
263
+
264
+ - `[source]` (optional) — path to override auto-discovery. Resolves first against `purgetss/images/` (short paths like `buttons/btn.png`), then against cwd.
265
+
266
+ ### Config block
267
+
268
+ Defaults live under `images:` in `purgetss/config.cjs`:
269
+
270
+ ```javascript
271
+ images: {
272
+ quality: 85, // JPEG/WebP/AVIF quality (0-100)
273
+ format: null, // null = keep original; 'webp' | 'jpeg' | 'png' | 'avif' | 'gif' | 'tiff'
274
+ confirmOverwrites: true // prompt before overwriting files
275
+ }
276
+ ```
277
+
278
+ 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.
279
+
280
+ ### Examples
281
+
282
+ ```bash
283
+ purgetss images # uses purgetss/images/ + config
284
+ purgetss images background/pink-texture.png # re-process one file (short path)
285
+ purgetss images background/ # re-process one subfolder
286
+ purgetss images --android # only Android densities
287
+ purgetss images --format webp --quality 90 # convert all outputs to WebP
288
+ purgetss images --dry-run # preview
289
+ ```
290
+
291
+ ## `semantic` Command
292
+
293
+ 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.
294
+
295
+ > **Tip**
296
+ > 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.
297
+
298
+ ### Palette mode (no `--single`)
299
+
300
+ 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.
301
+
302
+ ```bash
303
+ purgetss semantic <hex> <name>
304
+ purgetss semantic '#15803d' amazon
305
+ ```
306
+
307
+ Usage produces classes like `bg-amazon-50`, `text-amazon-500`, `border-amazon-950` that flip tonal contrast automatically with the system appearance.
308
+
309
+ ### Single mode (`--single`)
310
+
311
+ 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`).
312
+
313
+ ```bash
314
+ purgetss semantic --single <hex> <name> [--dark <hex>] [--alpha <0-100>]
315
+
316
+ # Examples:
317
+ purgetss semantic --single '#F9FAFB' surfaceColor --dark '#0f172a'
318
+ purgetss semantic --single '#111827' textColor --dark '#f1f5f9'
319
+ purgetss semantic --single '#3B82F6' accentColor --dark '#60a5fa' --alpha 80
320
+ purgetss semantic --single '#000000' overlayColor --alpha 50
321
+ ```
322
+
323
+ When `--dark` is omitted, it defaults to the light hex — useful for overlays/glass surfaces where alpha is the only variation.
324
+
325
+ ### Smart in-place updates
326
+
327
+ 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).
328
+
329
+ 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.
330
+
331
+ ### Flags
332
+
333
+ | Flag | Purpose |
334
+ | --- | --- |
335
+ | `-s, --single` | Generate a single purpose-based semantic color (requires explicit per-mode hex). |
336
+ | `-d, --dark <hex>` | With `--single`, the dark-mode hex (defaults to the light value). |
337
+ | `-a, --alpha <0-100>` | With `--single`, wraps both modes in `{ color, alpha }` per the Titanium spec. |
338
+ | `-n, --name <name>` | Specify the name (alternative to the positional argument). |
339
+ | `-r, --random` | Palette mode — use a random base color. |
340
+ | `-o, --override` | Place the mapping in `theme.colors` instead of `theme.extend.colors`. |
341
+ | `-q, --quotes` | Keep double quotes in `config.cjs`. |
342
+ | `-l, --log` | Preview the JSON without writing any files. |
343
+
146
344
  ## `install-dependencies` Command
147
345
 
148
346
  This command installs dev dependencies and configuration files in existing PurgeTSS projects, and sets up Visual Studio Code support.
@@ -795,3 +993,16 @@ purgetss sudo-update
795
993
  # alias:
796
994
  purgetss su
797
995
  ```
996
+
997
+ ## Community-Discovered Patterns
998
+
999
+ ### v7.2.x environment notes
1000
+
1001
+ 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:
1002
+
1003
+ - Node.js 20+ required (due to the `inquirer` v13 upgrade).
1004
+ - Font Awesome 7 support, including the CSS custom properties format.
1005
+ - Titanium SDK 13.1.x support, with new properties from 13.1.0.GA.
1006
+ - Removed deprecated commands: `copy-fonts` and `build-legacy` are no longer available — scripts referencing either will fail.
1007
+ - Install size reduced by ~45MB (non-essential assets moved to dev dependencies).
1008
+ - 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.