@maccesar/titools 2.2.12 → 2.3.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 +255 -713
- package/bin/titools.js +1 -1
- package/lib/commands/update.js +5 -6
- package/lib/config.js +1 -0
- package/lib/downloader.js +10 -0
- package/package.json +1 -1
- package/skills/alloy-guides/SKILL.md +46 -48
- package/skills/alloy-guides/references/CONTROLLERS.md +4 -6
- package/skills/alloy-guides/references/MODELS.md +340 -184
- package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +3 -4
- package/skills/alloy-guides/references/VIEWS_STYLES.md +44 -46
- package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +4 -5
- package/skills/alloy-guides/references/VIEWS_XML.md +51 -17
- package/skills/alloy-guides/references/WIDGETS.md +1 -1
- package/skills/alloy-howtos/SKILL.md +12 -13
- package/skills/alloy-howtos/references/cli_reference.md +40 -41
- package/skills/alloy-howtos/references/samples.md +3 -4
- package/skills/purgetss/SKILL.md +369 -356
- package/skills/purgetss/references/EXAMPLES.md +24 -25
- package/skills/purgetss/references/animation-advanced.md +555 -0
- package/skills/purgetss/references/animation-system.md +395 -995
- package/skills/purgetss/references/apply-directive.md +111 -141
- package/skills/purgetss/references/arbitrary-values.md +206 -480
- package/skills/purgetss/references/class-categories.md +277 -0
- package/skills/purgetss/references/class-index.md +1 -420
- package/skills/purgetss/references/cli-commands.md +446 -556
- package/skills/purgetss/references/configurable-properties.md +163 -599
- package/skills/purgetss/references/custom-rules.md +33 -76
- package/skills/purgetss/references/customization-deep-dive.md +319 -518
- package/skills/purgetss/references/dynamic-component-creation.md +33 -37
- package/skills/purgetss/references/grid-layout.md +42 -371
- package/skills/purgetss/references/icon-fonts.md +82 -475
- package/skills/purgetss/references/installation-setup.md +159 -331
- package/skills/purgetss/references/migration-guide.md +54 -109
- package/skills/purgetss/references/opacity-modifier.md +25 -222
- package/skills/purgetss/references/performance-tips.md +2 -2
- package/skills/purgetss/references/platform-modifiers.md +21 -407
- package/skills/purgetss/references/tikit-components.md +237 -104
- package/skills/purgetss/references/titanium-resets.md +20 -21
- package/skills/purgetss/references/ui-ux-design.md +171 -1702
- package/skills/ti-api/SKILL.md +109 -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-expert/SKILL.md +46 -45
- package/skills/ti-expert/references/adaptive-layouts.md +414 -0
- package/skills/ti-expert/references/alloy-builtins.md +16 -20
- package/skills/ti-expert/references/alloy-structure.md +40 -42
- package/skills/ti-expert/references/anti-patterns.md +34 -0
- package/skills/ti-expert/references/code-conventions.md +5 -3
- package/skills/ti-expert/references/error-handling.md +14 -7
- package/skills/ti-expert/references/examples.md +4 -2
- package/skills/ti-expert/references/performance-optimization.md +26 -24
- package/skills/ti-expert/references/security-device.md +17 -14
- package/skills/ti-expert/references/security-fundamentals.md +60 -101
- package/skills/ti-expert/references/state-management.md +15 -14
- package/skills/ti-expert/references/testing-e2e-ci.md +30 -21
- package/skills/ti-expert/references/theming.md +12 -20
- package/skills/ti-guides/SKILL.md +13 -17
- package/skills/ti-guides/references/advanced-data-and-images.md +30 -10
- package/skills/ti-guides/references/application-frameworks.md +3 -3
- package/skills/ti-guides/references/coding-best-practices.md +31 -2
- package/skills/ti-guides/references/commonjs-advanced.md +46 -4
- package/skills/ti-guides/references/hello-world.md +9 -13
- package/skills/ti-guides/references/hyperloop-native-access.md +4 -1
- package/skills/ti-guides/references/javascript-primer.md +13 -5
- package/skills/ti-guides/references/resources.md +0 -2
- package/skills/ti-guides/references/style-and-conventions.md +1 -0
- package/skills/ti-guides/references/tiapp-config.md +0 -32
- package/skills/ti-howtos/SKILL.md +43 -45
- package/skills/ti-howtos/references/buffer-codec-streams.md +25 -3
- package/skills/ti-howtos/references/debugging-profiling.md +14 -25
- package/skills/ti-howtos/references/google-maps-v2.md +3 -3
- package/skills/ti-howtos/references/ios-map-kit.md +8 -1
- package/skills/ti-howtos/references/notification-services.md +0 -1
- package/skills/ti-howtos/references/webpack-build-pipeline.md +3 -0
- package/skills/ti-ui/SKILL.md +47 -49
- package/skills/ti-ui/references/application-structures.md +3 -2
- package/skills/ti-ui/references/orientation.md +17 -9
- package/skills/ti-ui/references/platform-ui-ios.md +63 -0
- package/skills/ti-ui/references/scrolling-views.md +39 -0
package/skills/purgetss/SKILL.md
CHANGED
|
@@ -11,21 +11,20 @@ Utility-first styling toolkit for Titanium/Alloy mobile apps.
|
|
|
11
11
|
|
|
12
12
|
## Project Detection
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
This skill automatically detects PurgeTSS usage when invoked and provides utility-first styling guidance.
|
|
16
|
-
|
|
17
|
-
**Detection occurs automatically** - no manual command needed.
|
|
18
|
-
|
|
19
|
-
**PurgeTSS project indicators:**
|
|
20
|
-
- `purgetss/` folder
|
|
21
|
-
- `purgetss/config.cjs` configuration file
|
|
22
|
-
- `purgetss/styles/utilities.tss` utility classes
|
|
23
|
-
- `app/styles/app.tss` (auto-generated)
|
|
24
|
-
|
|
25
|
-
**Behavior based on detection:**
|
|
26
|
-
- **PurgeTSS detected** → Provides PurgeTSS-specific guidance, recommends utility classes, suggests `$.UI.create()` for dynamic components
|
|
27
|
-
- **Not detected** → Does NOT suggest PurgeTSS utility classes, does NOT recommend `$.UI.create()`, does NOT reference PurgeTSS-specific patterns
|
|
28
|
-
:::
|
|
14
|
+
> **️ℹ️ AUTO-DETECTS PURGETSS PROJECTS**
|
|
15
|
+
> This skill automatically detects PurgeTSS usage when invoked and provides utility-first styling guidance.
|
|
16
|
+
>
|
|
17
|
+
> **Detection occurs automatically** - no manual command needed.
|
|
18
|
+
>
|
|
19
|
+
> **PurgeTSS project indicators:**
|
|
20
|
+
> - `purgetss/` folder
|
|
21
|
+
> - `purgetss/config.cjs` configuration file
|
|
22
|
+
> - `purgetss/styles/utilities.tss` utility classes
|
|
23
|
+
> - `app/styles/app.tss` (auto-generated)
|
|
24
|
+
>
|
|
25
|
+
> **Behavior based on detection:**
|
|
26
|
+
> - **PurgeTSS detected** → Provides PurgeTSS-specific guidance, recommends utility classes, suggests `$.UI.create()` for dynamic components
|
|
27
|
+
> - **Not detected** → Does NOT suggest PurgeTSS utility classes, does NOT recommend `$.UI.create()`, does NOT reference PurgeTSS-specific patterns
|
|
29
28
|
|
|
30
29
|
## Core Workflow
|
|
31
30
|
|
|
@@ -40,7 +39,7 @@ This skill automatically detects PurgeTSS usage when invoked and provides utilit
|
|
|
40
39
|
├─ fonts/ # Custom font files (.ttf, .otf)
|
|
41
40
|
├─ styles/
|
|
42
41
|
│ ├─ definitions.css # For VS Code IntelliSense
|
|
43
|
-
│ └─ utilities.tss # All PurgeTSS utility classes
|
|
42
|
+
│ └─ utilities.tss # All PurgeTSS utility classes
|
|
44
43
|
└─ config.cjs # Theme configuration
|
|
45
44
|
|
|
46
45
|
./app/styles/
|
|
@@ -50,64 +49,60 @@ This skill automatically detects PurgeTSS usage when invoked and provides utilit
|
|
|
50
49
|
|
|
51
50
|
### Understanding `app.tss` vs `_app.tss`
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
**`app.tss` is ALWAYS regenerated** every time the app compiles.
|
|
55
|
-
|
|
56
|
-
PurgeTSS scans ALL XMLs and Controllers for utility classes, then generates a fresh `app.tss` containing only the classes actually used.
|
|
57
|
-
|
|
58
|
-
**NEVER edit `app.tss` directly** - your changes WILL be overwritten on the next build.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
Better approach: define custom classes in `config.cjs` instead of `_app.tss`.
|
|
72
|
-
:::
|
|
52
|
+
> **⚠️ CRITICAL: app.tss IS AUTO-GENERATED**
|
|
53
|
+
> **`app.tss` is ALWAYS regenerated** every time the app compiles.
|
|
54
|
+
>
|
|
55
|
+
> PurgeTSS scans ALL XMLs and Controllers for utility classes, then generates a fresh `app.tss` containing only the classes actually used.
|
|
56
|
+
>
|
|
57
|
+
> **NEVER edit `app.tss` directly** - your changes WILL be overwritten on the next build.
|
|
58
|
+
|
|
59
|
+
> **️ℹ️ THE `_app.tss` BACKUP FILE**
|
|
60
|
+
> On **first run**, PurgeTSS backs up your original `app.tss` to `_app.tss`.
|
|
61
|
+
>
|
|
62
|
+
> **`_app.tss` is your custom styles file** - it persists across all PurgeTSS runs.
|
|
63
|
+
>
|
|
64
|
+
> Every build, PurgeTSS:
|
|
65
|
+
> 1. Scans XMLs and Controllers for used classes
|
|
66
|
+
> 2. Regenerates `app.tss` from scratch
|
|
67
|
+
> 3. Copies `_app.tss` content into the generated `app.tss`
|
|
68
|
+
>
|
|
69
|
+
> Better approach: define custom classes in `config.cjs` instead of `_app.tss`.
|
|
73
70
|
|
|
74
71
|
### Checking for Unused/Unsupported Classes
|
|
75
72
|
|
|
76
|
-
|
|
77
|
-
At the **end of every generated `app.tss`**, look for this section:
|
|
78
|
-
|
|
79
|
-
```tss
|
|
80
|
-
// Unused or unsupported classes
|
|
81
|
-
// .my-typo-class
|
|
82
|
-
// .non-existent-utility
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
**These are classes used in your XMLs or Controllers that have NO definition anywhere:**
|
|
86
|
-
- Not in `utilities.tss` (generated from PurgeTSS utilities)
|
|
87
|
-
- Not in `_app.tss` (your custom styles)
|
|
88
|
-
- Not in any other `.tss` file in the `styles/` folder
|
|
89
|
-
|
|
90
|
-
**This means:**
|
|
91
|
-
1. You have a **typo** in your class name
|
|
92
|
-
2. You're using a class that **doesn't exist** in PurgeTSS
|
|
93
|
-
3. You need to **define the class** in `_app.tss` or `config.cjs`
|
|
94
|
-
|
|
95
|
-
**As part of any analysis, ALWAYS check the end of `app.tss` and report any unused/unsupported classes to the user!**
|
|
96
|
-
:::
|
|
73
|
+
> **🚨 ALWAYS CHECK `app.tss` FOR ERRORS**
|
|
74
|
+
> At the **end of every generated `app.tss`**, look for this section:
|
|
75
|
+
>
|
|
76
|
+
> ```tss
|
|
77
|
+
> // Unused or unsupported classes
|
|
78
|
+
> // .my-typo-class
|
|
79
|
+
> // .non-existent-utility
|
|
80
|
+
> ```
|
|
81
|
+
>
|
|
82
|
+
> **These are classes used in your XMLs or Controllers that have NO definition anywhere:**
|
|
83
|
+
> - Not in `utilities.tss` (generated from PurgeTSS utilities)
|
|
84
|
+
> - Not in `_app.tss` (your custom styles)
|
|
85
|
+
> - Not in any other `.tss` file in the `styles/` folder
|
|
86
|
+
>
|
|
87
|
+
> **This means:**
|
|
88
|
+
> 1. You have a **typo** in your class name
|
|
89
|
+
> 2. You're using a class that **doesn't exist** in PurgeTSS
|
|
90
|
+
> 3. You need to **define the class** in `_app.tss` or `config.cjs`
|
|
91
|
+
>
|
|
92
|
+
> **As part of any analysis, ALWAYS check the end of `app.tss` and report any unused/unsupported classes to the user!**
|
|
97
93
|
|
|
98
94
|
### How `utilities.tss` Works
|
|
99
95
|
|
|
100
|
-
|
|
101
|
-
`./purgetss/styles/utilities.tss` contains ALL available PurgeTSS utility classes.
|
|
102
|
-
|
|
103
|
-
**It regenerates when `./purgetss/config.cjs` changes** - this is where you define:
|
|
104
|
-
- Custom colors
|
|
105
|
-
- Custom spacing scales
|
|
106
|
-
- Ti Element styles
|
|
107
|
-
- Any project-specific utilities
|
|
108
|
-
|
|
109
|
-
If a class appears in "Unused or unsupported classes" in `app.tss`, it means it's truly not defined anywhere - not even in your `config.cjs` customizations.
|
|
110
|
-
:::
|
|
96
|
+
> **️ℹ️ UTILITIES.TSS REGENERATION**
|
|
97
|
+
> `./purgetss/styles/utilities.tss` contains ALL available PurgeTSS utility classes.
|
|
98
|
+
>
|
|
99
|
+
> **It regenerates when `./purgetss/config.cjs` changes** - this is where you define:
|
|
100
|
+
> - Custom colors
|
|
101
|
+
> - Custom spacing scales
|
|
102
|
+
> - Ti Element styles
|
|
103
|
+
> - Any project-specific utilities
|
|
104
|
+
>
|
|
105
|
+
> If a class appears in "Unused or unsupported classes" in `app.tss`, it means it's truly not defined anywhere - not even in your `config.cjs` customizations.
|
|
111
106
|
|
|
112
107
|
## Quick Start
|
|
113
108
|
|
|
@@ -117,48 +112,56 @@ purgetss create 'MyApp' -d -v fa
|
|
|
117
112
|
# -v: Copy icon fonts (fa, mi, ms, f7)
|
|
118
113
|
```
|
|
119
114
|
|
|
120
|
-
## What's New in v7.
|
|
121
|
-
|
|
122
|
-
- `
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
- Font Awesome 7
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
115
|
+
## What's New in v7.5.0
|
|
116
|
+
|
|
117
|
+
- `extend` support for Window, View, and ImageView in `config.cjs`
|
|
118
|
+
- Shorthand `apply` directive normalization
|
|
119
|
+
- Apply directive property deduplication
|
|
120
|
+
- Automatic platform resolution in apply directives
|
|
121
|
+
- Updated Font Awesome to 7.2.0
|
|
122
|
+
- Fixed: `extend.Window` was silently ignored
|
|
123
|
+
- Fixed: Array-type properties (`extendEdges`, `mediaTypes`) bracket notation
|
|
124
|
+
|
|
125
|
+
## What's New in v7.4.0
|
|
126
|
+
|
|
127
|
+
- 9 new Animation methods: `transition`, `pulse`, `sequence`, `swap`, `shake`, `snapTo`, `reorder`, `undraggable`, `detectCollisions` (module now has 15 methods total)
|
|
128
|
+
- Snap behavior classes: `snap-back`, `snap-center`, `snap-magnet`
|
|
129
|
+
- `keep-z-index` utility class
|
|
130
|
+
- Enriched callback event object with `action`, `state`, `id`, `targetId`, `index`, `total`, `getTarget()`
|
|
131
|
+
- Delta-based drag for views with rotate/scale transforms
|
|
132
|
+
- Position normalization for draggable views
|
|
133
|
+
- Property inheritance from Animation object for all new methods
|
|
134
|
+
|
|
135
|
+
> **💡 NEW PROJECT: Clean Up Default app.tss**
|
|
136
|
+
> For new projects created with `purgetss create`, the default `app/styles/app.tss` contains a large commented template.
|
|
137
|
+
>
|
|
138
|
+
> **You can safely DELETE this file** - PurgeTSS will regenerate it on the first build with only the classes you actually use, and create a clean `_app.tss` backup.
|
|
139
|
+
>
|
|
140
|
+
> This prevents carrying around unnecessary commented code and ensures a fresh start.
|
|
137
141
|
|
|
138
142
|
## Critical Rules (Low Freedom)
|
|
139
143
|
|
|
140
144
|
### ⭐ PREFER `$.UI.create()` for Dynamic Components
|
|
141
145
|
|
|
142
|
-
|
|
143
|
-
When creating components dynamically in Controllers, **use `$.UI.create()` instead of `Ti.UI.create()`** to get full PurgeTSS utility class support:
|
|
144
|
-
|
|
145
|
-
```javascript
|
|
146
|
-
// ✅ RECOMMENDED - Full PurgeTSS support
|
|
147
|
-
const view = $.UI.create('View', {
|
|
148
|
-
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
// ❌ AVOID - No PurgeTSS classes
|
|
152
|
-
const view = Ti.UI.createView({
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
})
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
See [Dynamic Component Creation](references/dynamic-component-creation.md) for complete guide.
|
|
161
|
-
:::
|
|
146
|
+
> **💡 RECOMMENDED FOR DYNAMIC COMPONENTS**
|
|
147
|
+
> When creating components dynamically in Controllers, **use `$.UI.create()` instead of `Ti.UI.create()`** to get full PurgeTSS utility class support:
|
|
148
|
+
>
|
|
149
|
+
> ```javascript
|
|
150
|
+
> // ✅ RECOMMENDED - Full PurgeTSS support
|
|
151
|
+
> const view = $.UI.create('View', {
|
|
152
|
+
> classes: ['w-screen', 'h-auto', 'bg-white', 'rounded-lg']
|
|
153
|
+
> })
|
|
154
|
+
>
|
|
155
|
+
> // ❌ AVOID - No PurgeTSS classes
|
|
156
|
+
> const view = Ti.UI.createView({
|
|
157
|
+
> width: Ti.UI.FILL,
|
|
158
|
+
> height: Ti.UI.SIZE,
|
|
159
|
+
> backgroundColor: '#ffffff',
|
|
160
|
+
> borderRadius: 8
|
|
161
|
+
> })
|
|
162
|
+
> ```
|
|
163
|
+
>
|
|
164
|
+
> See [Dynamic Component Creation](references/dynamic-component-creation.md) for complete guide.
|
|
162
165
|
|
|
163
166
|
### 🚨 RESPECT USER FILES
|
|
164
167
|
**NEVER delete any existing `.tss` files** (like `index.tss`, `detail.tss`) or other project files without explicit user consent.
|
|
@@ -173,254 +176,264 @@ See [Dynamic Component Creation](references/dynamic-component-creation.md) for c
|
|
|
173
176
|
|
|
174
177
|
### 🚨 NO FLEXBOX - Titanium Doesn't Support It
|
|
175
178
|
|
|
176
|
-
|
|
177
|
-
The following are **NOT supported**:
|
|
178
|
-
- ❌ `flex`, `flex-row`, `flex-col`
|
|
179
|
-
- ❌ `justify-between`, `justify-center`, `justify-start`, `justify-end`
|
|
180
|
-
- ❌ `items-center` for alignment (exists but sets `width/height: FILL`)
|
|
181
|
-
|
|
182
|
-
**Use Titanium layouts instead:**
|
|
183
|
-
- ✅ `horizontal` - Children left to right
|
|
184
|
-
- ✅ `vertical` - Children top to bottom
|
|
185
|
-
- ✅ Omit layout class - Defaults to `composite` (absolute positioning)
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
When building complex UIs, carefully choose the layout mode for each container:
|
|
189
|
-
|
|
190
|
-
**`vertical`** - Stack elements top to bottom (most common):
|
|
191
|
-
```xml
|
|
192
|
-
<ScrollView class="vertical">
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
</ScrollView>
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
**`horizontal`** - Arrange elements left to right:
|
|
200
|
-
```xml
|
|
201
|
-
<View class="horizontal w-screen">
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
</View>
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
**`composite`** (default) - Absolute positioning with `top`, `left`, etc.:
|
|
209
|
-
```xml
|
|
210
|
-
<View class="h-screen w-screen">
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
</View>
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
**Common Issue:** If you see elements appearing in unexpected positions (e.g., a header bar "behind" content), check if parent containers have conflicting layout modes. Each container's layout affects its direct children only.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
-
|
|
248
|
-
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
-
|
|
262
|
-
-
|
|
263
|
-
- **`
|
|
264
|
-
- **`
|
|
265
|
-
|
|
266
|
-
-
|
|
267
|
-
- **
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
**
|
|
309
|
-
```javascript
|
|
310
|
-
//
|
|
311
|
-
const view =
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
- [
|
|
379
|
-
- [
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
- [
|
|
388
|
-
- [
|
|
389
|
-
- [
|
|
390
|
-
- [
|
|
391
|
-
|
|
392
|
-
###
|
|
393
|
-
- [
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
- [
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
- [
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
-
|
|
410
|
-
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
179
|
+
> **🚨 FLEXBOX CLASSES DO NOT EXIST**
|
|
180
|
+
> The following are **NOT supported**:
|
|
181
|
+
> - ❌ `flex`, `flex-row`, `flex-col`
|
|
182
|
+
> - ❌ `justify-between`, `justify-center`, `justify-start`, `justify-end`
|
|
183
|
+
> - ❌ `items-center` for alignment (exists but sets `width/height: FILL`)
|
|
184
|
+
>
|
|
185
|
+
> **Use Titanium layouts instead:**
|
|
186
|
+
> - ✅ `horizontal` - Children left to right
|
|
187
|
+
> - ✅ `vertical` - Children top to bottom
|
|
188
|
+
> - ✅ Omit layout class - Defaults to `composite` (absolute positioning)
|
|
189
|
+
>
|
|
190
|
+
> **💡 CRITICAL: Understanding Layout Composition**
|
|
191
|
+
> When building complex UIs, carefully choose the layout mode for each container:
|
|
192
|
+
>
|
|
193
|
+
> **`vertical`** - Stack elements top to bottom (most common):
|
|
194
|
+
> ```xml
|
|
195
|
+
> <ScrollView class="vertical">
|
|
196
|
+
> <View class="mb-4">Item 1</View>
|
|
197
|
+
> <View class="mb-4">Item 2</View>
|
|
198
|
+
> <View>Item 3</View>
|
|
199
|
+
> </ScrollView>
|
|
200
|
+
> ```
|
|
201
|
+
>
|
|
202
|
+
> **`horizontal`** - Arrange elements left to right:
|
|
203
|
+
> ```xml
|
|
204
|
+
> <View class="horizontal w-screen">
|
|
205
|
+
> <Label text="Left" />
|
|
206
|
+
> <View class="w-screen" /> <!-- Spacer -->
|
|
207
|
+
> <Label text="Right" />
|
|
208
|
+
> </View>
|
|
209
|
+
> ```
|
|
210
|
+
>
|
|
211
|
+
> **`composite`** (default) - Absolute positioning with `top`, `left`, etc.:
|
|
212
|
+
> ```xml
|
|
213
|
+
> <View class="h-screen w-screen">
|
|
214
|
+
> <View class="wh-12 absolute left-0 top-0 bg-red-500" />
|
|
215
|
+
> <View class="wh-12 absolute bottom-0 right-0 bg-blue-500" />
|
|
216
|
+
> </View>
|
|
217
|
+
> ```
|
|
218
|
+
>
|
|
219
|
+
> **Common Issue:** If you see elements appearing in unexpected positions (e.g., a header bar "behind" content), check if parent containers have conflicting layout modes. Each container's layout affects its direct children only.
|
|
220
|
+
>
|
|
221
|
+
> ### 🚨 PLATFORM-SPECIFIC PROPERTIES REQUIRE MODIFIERS
|
|
222
|
+
>
|
|
223
|
+
> **🚨 CRITICAL: Platform-Specific Properties Require Modifiers**
|
|
224
|
+
> Using `Ti.UI.iOS.*` or `Ti.UI.Android.*` properties WITHOUT platform modifiers causes cross-platform compilation failures.
|
|
225
|
+
>
|
|
226
|
+
> **WRONG - Adds iOS code to Android (causes failure):**
|
|
227
|
+
> ```tss
|
|
228
|
+
> // ❌ BAD - Adds Ti.UI.iOS to Android project
|
|
229
|
+
> "#mainWindow": {
|
|
230
|
+
> statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT
|
|
231
|
+
> }
|
|
232
|
+
> ```
|
|
233
|
+
>
|
|
234
|
+
> **CORRECT - Use platform modifiers in TSS:**
|
|
235
|
+
> ```tss
|
|
236
|
+
> // ✅ GOOD - Only adds to iOS
|
|
237
|
+
> "#mainWindow[platform=ios]": {
|
|
238
|
+
> statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT
|
|
239
|
+
> }
|
|
240
|
+
> ```
|
|
241
|
+
>
|
|
242
|
+
> **OR use PurgeTSS platform modifier classes:**
|
|
243
|
+
> ```xml
|
|
244
|
+
> <!-- ✅ GOOD - Platform-specific classes -->
|
|
245
|
+
> <Window class="ios:status-bar-light android:status-bar-dark">
|
|
246
|
+
> ```
|
|
247
|
+
>
|
|
248
|
+
> **Properties that ALWAYS require platform modifiers:**
|
|
249
|
+
> - iOS: `statusBarStyle`, `modalStyle`, `modalTransitionStyle`, `systemButton`
|
|
250
|
+
> - Android: `actionBar` configuration
|
|
251
|
+
> - ANY `Ti.UI.iOS.*`, `Ti.UI.Android.*` constant
|
|
252
|
+
>
|
|
253
|
+
> **When suggesting platform-specific code:**
|
|
254
|
+
> 1. Check if user's project supports that platform
|
|
255
|
+
> 2. ALWAYS use `[platform=ios]` or `[platform=android]` TSS modifier
|
|
256
|
+
> 3. OR use PurgeTSS platform classes like `ios:bg-blue-500`
|
|
257
|
+
>
|
|
258
|
+
> **For complete reference on platform modifiers, see** [Platform Modifiers](references/platform-modifiers.md).
|
|
259
|
+
>
|
|
260
|
+
> ### Other Mandatory Rules
|
|
261
|
+
>
|
|
262
|
+
> - **NO `p-` padding classes**: Titanium does NOT support a native `padding` property on `View`, `Window`, `ScrollView`, or `TableView`. Always use **margins on children** (`m-`) to simulate internal spacing.
|
|
263
|
+
> - **View defaults to `SIZE`**: Use `w-screen`/`h-screen` to fill space when needed.
|
|
264
|
+
> - **`rounded-full`**: To get a perfect circle, use `rounded-full-XX` (where XX is the width/height of the square element).
|
|
265
|
+
> - **`rounded-full-XX` includes size**: These classes already set `width`, `height`, and `borderRadius`. Do **not** add `w-XX h-XX`/`wh-XX` unless you need to override.
|
|
266
|
+
> - **`m-xx` on FILL elements**: Adding `m-4` to a `w-screen` element pins it to all four edges (top, bottom, left, right). This will **stretch the component vertically** to fill the parent unless you explicitly add `h-auto` (`Ti.UI.SIZE`) to constrain it to its content.
|
|
267
|
+
> - **`w-XX` + `h-XX` → `wh-XX`**: If both width and height use the same scale value, prefer a single `wh-XX` (order doesn't matter: `w-10 h-10` and `h-10 w-10` are equivalent).
|
|
268
|
+
> - **Use `wh-` shortcuts**: PurgeTSS provides a complete scale of combined width/height utilities:
|
|
269
|
+
> - **Numeric Scale**: `wh-0` to `wh-96` (e.g., `wh-16` sets both to 64px).
|
|
270
|
+
> - **Fractions**: `wh-1/2`, `wh-3/4`, up to `wh-11/12` for proportional sizing.
|
|
271
|
+
> - **Special Values**: `wh-auto` (explicit `SIZE`), `wh-full` (`100%`), and `wh-screen` (`FILL`).
|
|
272
|
+
> - Using these instead of separate `w-` and `h-` classes improves XML readability and reduces generated TSS size.
|
|
273
|
+
>
|
|
274
|
+
> **💡 LAYOUT TIP: EDGE PINNING**
|
|
275
|
+
> If opposite margins cause a `Label`, `Button`, or `Switch` to stretch unexpectedly, it is due to Titanium's **Edge Pinning** rule (2 opposite pins = computed dimension). This applies to **any component whose default size is `Ti.UI.SIZE`**.
|
|
276
|
+
>
|
|
277
|
+
> - `mt-*` + `mb-*` or `my-*` can stretch the component vertically. Add `h-auto`.
|
|
278
|
+
> - `ml-*` + `mr-*` or `mx-*` can stretch the component horizontally. Add `w-auto`.
|
|
279
|
+
> - If margins affect both axes, use `wh-auto` to force `SIZE` for both width and height.
|
|
280
|
+
>
|
|
281
|
+
> ```xml
|
|
282
|
+
> <!-- WRONG: my-1 creates vertical pins → Switch stretches to fill parent height -->
|
|
283
|
+
> <Switch class="my-1 mr-2" />
|
|
284
|
+
>
|
|
285
|
+
> <!-- CORRECT: h-auto prevents vertical stretch -->
|
|
286
|
+
> <Switch class="my-1 mr-2 h-auto" />
|
|
287
|
+
> <Label class="my-1 ml-2 h-auto" text="Option" />
|
|
288
|
+
> ```
|
|
289
|
+
>
|
|
290
|
+
> - **NEVER add `composite` class explicitly** - That's the default, use `horizontal`/`vertical` when needed
|
|
291
|
+
> - **Arbitrary values use parentheses**: `w-(100px)`, `bg-(#ff0000)` - NO square brackets
|
|
292
|
+
> - **`mode: 'all'` required** in `config.cjs` for Ti Elements styling
|
|
293
|
+
> - **Classes use `kebab-case`**: `.my-class`, IDs use `camelCase`: `#myId`
|
|
294
|
+
>
|
|
295
|
+
> ## Common Anti-Patterns
|
|
296
|
+
>
|
|
297
|
+
> **WRONG:**
|
|
298
|
+
> ```xml
|
|
299
|
+
> <View class="flex-row justify-between"> <!-- Flexbox doesn't exist -->
|
|
300
|
+
> <View class="p-4"> <!-- No padding on Views -->
|
|
301
|
+
> <View class="composite"> <!-- Never add composite explicitly -->
|
|
302
|
+
> ```
|
|
303
|
+
>
|
|
304
|
+
> **CORRECT:**
|
|
305
|
+
> ```xml
|
|
306
|
+
> <View class="horizontal">
|
|
307
|
+
> <View class="m-4"> <!-- Use margins on children -->
|
|
308
|
+
> <View> <!-- Omit layout = composite by default -->
|
|
309
|
+
> ```
|
|
310
|
+
>
|
|
311
|
+
> **WRONG (Dynamic Components):**
|
|
312
|
+
> ```javascript
|
|
313
|
+
> // Manual styling with Ti.UI.create()
|
|
314
|
+
> const view = Ti.UI.createView({
|
|
315
|
+
> width: Ti.UI.FILL,
|
|
316
|
+
> backgroundColor: '#fff',
|
|
317
|
+
> borderRadius: 8
|
|
318
|
+
> })
|
|
319
|
+
> ```
|
|
320
|
+
>
|
|
321
|
+
> **CORRECT (Dynamic Components):**
|
|
322
|
+
> ```javascript
|
|
323
|
+
> // PurgeTSS classes with $.UI.create()
|
|
324
|
+
> const view = $.UI.create('View', {
|
|
325
|
+
> classes: ['w-screen', 'bg-white', 'rounded-lg']
|
|
326
|
+
> })
|
|
327
|
+
> ```
|
|
328
|
+
>
|
|
329
|
+
> ## Class Verification Workflow
|
|
330
|
+
>
|
|
331
|
+
> **🚨 CRITICAL: VERIFY CLASSES BEFORE SUGGESTING**
|
|
332
|
+
> **NEVER guess or hallucinate classes based on other CSS Frameworks knowledge!**
|
|
333
|
+
>
|
|
334
|
+
> PurgeTSS shares naming with some CSS Frameworks but has DIFFERENT classes for Titanium.
|
|
335
|
+
> Always verify a class exists before suggesting it.
|
|
336
|
+
>
|
|
337
|
+
> ### Verification Steps
|
|
338
|
+
>
|
|
339
|
+
> 1. **Check if it's a KNOWN anti-pattern**
|
|
340
|
+
> - See [PROHIBITED Classes](references/class-index.md#prohibited-tailwind-classes-that-do-not-exist)
|
|
341
|
+
> - Common mistakes: `flex-row`, `justify-between`, `p-4` on Views (p-* not supported on Views)
|
|
342
|
+
>
|
|
343
|
+
> 2. **Check the Class Index**
|
|
344
|
+
> - See [Class Index](references/class-index.md) for available patterns
|
|
345
|
+
> - Constant properties like `keyboard-type-*`, `return-key-type-*` have dedicated classes
|
|
346
|
+
>
|
|
347
|
+
> 3. **Search the project when unsure**
|
|
348
|
+
> ```bash
|
|
349
|
+
> # Search for a class pattern in the project's utilities.tss
|
|
350
|
+
> grep -E "keyboard-type-" ./purgetss/styles/utilities.tss
|
|
351
|
+
> grep -E "return-key-type-" ./purgetss/styles/utilities.tss
|
|
352
|
+
> grep -E "^'bg-" ./purgetss/styles/utilities.tss
|
|
353
|
+
> ```
|
|
354
|
+
>
|
|
355
|
+
> 4. **After making changes**
|
|
356
|
+
> - Check `app.tss` for "Unused or unsupported classes" section at the end
|
|
357
|
+
> - Report any typos or non-existent classes to the user
|
|
358
|
+
>
|
|
359
|
+
> ### What HAS Classes vs What DOESN'T
|
|
360
|
+
>
|
|
361
|
+
> | Has Classes in PurgeTSS | Does NOT Have Classes |
|
|
362
|
+
> | ----------------------- | ------------------------------------- |
|
|
363
|
+
> | `keyboard-type-email` | `hintText` (use attribute) |
|
|
364
|
+
> | `return-key-type-next` | `passwordMask` (use attribute) |
|
|
365
|
+
> | `text-center` | `autocorrect` (use attribute) |
|
|
366
|
+
> | `bg-blue-500` | `autocapitalization` (use attribute) |
|
|
367
|
+
> | `w-screen` | `flex-row` → use `horizontal` |
|
|
368
|
+
> | `wh-16` | `justify-between` → use margins |
|
|
369
|
+
> | `rounded-lg` | `w-full` → use `w-screen` |
|
|
370
|
+
> | `m-4`, `gap-4` | `p-4` on View → use `m-4` on children |
|
|
371
|
+
>
|
|
372
|
+
> **💡 TIP**
|
|
373
|
+
> When in doubt, prefer using the search command above to verify. It's better to spend 5 seconds verifying than suggesting a class that doesn't exist and will appear in the "unused classes" warning.
|
|
374
|
+
>
|
|
375
|
+
> ## Reference Guides
|
|
376
|
+
>
|
|
377
|
+
> Load these only when needed:
|
|
378
|
+
>
|
|
379
|
+
> ### Essential References
|
|
380
|
+
> - **[Class Index](references/class-index.md)** - Naming conventions, 416-property table, prohibited classes, verification commands (LOAD FIRST when unsure about a class)
|
|
381
|
+
> - **[Class Categories](references/class-categories.md)** - Complete prefix inventory by category (layout, colors, typography, states, etc.)
|
|
382
|
+
> - **[Dynamic Component Creation](references/dynamic-component-creation.md)** - `$.UI.create()` and `Alloy.createStyle()` for creating components in Controllers (READ FIRST for dynamic components)
|
|
383
|
+
>
|
|
384
|
+
> ### Setup & Configuration
|
|
385
|
+
> - [Installation & Setup](references/installation-setup.md) - First run, VS Code, LiveView
|
|
386
|
+
> - [CLI Commands](references/cli-commands.md) - All `purgetss` commands
|
|
387
|
+
> - [Migration Guide](references/migration-guide.md) - Migrating existing apps from manual TSS to PurgeTSS
|
|
388
|
+
>
|
|
389
|
+
> ### Customization
|
|
390
|
+
> - [Deep Customization](references/customization-deep-dive.md) - config.cjs, colors, spacing, Ti Elements
|
|
391
|
+
> - [Custom Rules](references/custom-rules.md) - Styling Ti Elements, IDs, classes
|
|
392
|
+
> - [Apply Directive](references/apply-directive.md) - Extracting utility combinations
|
|
393
|
+
> - [Configurable Properties](references/configurable-properties.md) - All 80+ customizable properties
|
|
394
|
+
>
|
|
395
|
+
> ### Layout & Styling
|
|
396
|
+
> - **[UI/UX Design Patterns](references/ui-ux-design.md)** - Complete guide to mobile UI components with PurgeTSS (cards, lists, forms, buttons, navigation, modals, accessibility)
|
|
397
|
+
> - [Grid Layout System](references/grid-layout.md) - 12-column grid, responsive layouts
|
|
398
|
+
> - [Smart Mappings](references/smart-mappings.md) - How gap, shadows, and grid work under the hood
|
|
399
|
+
> - [Arbitrary Values](references/arbitrary-values.md) - Parentheses notation for custom values
|
|
400
|
+
> - [Platform Modifiers](references/platform-modifiers.md) - ios:, android:, tablet:, handheld:
|
|
401
|
+
> - [Opacity Modifier](references/opacity-modifier.md) - Color transparency with /50 syntax
|
|
402
|
+
> - [Titanium Resets](references/titanium-resets.md) - Default styles for Ti elements
|
|
403
|
+
>
|
|
404
|
+
> ### Performance
|
|
405
|
+
> - [Performance Tips](references/performance-tips.md) - Optimizing PurgeTSS apps (bridge crossings, ListView, animations)
|
|
406
|
+
>
|
|
407
|
+
> ### Components
|
|
408
|
+
> - [TiKit UI Components](references/tikit-components.md) - Ready-to-use Alerts, Avatars, Buttons, Cards, Tabs built with PurgeTSS
|
|
409
|
+
>
|
|
410
|
+
> ### Fonts & Animations
|
|
411
|
+
> - [Icon Fonts](references/icon-fonts.md) - Font Awesome 7, Material Icons, custom icon libraries
|
|
412
|
+
> - [Animation System](references/animation-system.md) - 15 methods including collision detection, transitions, and sequential animations
|
|
413
|
+
> - [Animation Advanced](references/animation-advanced.md) - Property inheritance, utility classes, implementation rules, complex UI example
|
|
414
|
+
>
|
|
415
|
+
> **💡 TEXT FONTS (Google Fonts, Roboto, etc.)**
|
|
416
|
+
> For text fonts, see [CLI Commands → build-fonts](references/cli-commands.md#purgetss-build-fonts-alias-bf).
|
|
417
|
+
>
|
|
418
|
+
> ## Examples
|
|
419
|
+
>
|
|
420
|
+
> For complete WRONG vs CORRECT examples including:
|
|
421
|
+
> - Titanium layout patterns (horizontal, vertical, composite)
|
|
422
|
+
> - Grid with percentages
|
|
423
|
+
> - Gap usage
|
|
424
|
+
> - Manual .tss anti-patterns
|
|
425
|
+
> - Dynamic component creation with `$.UI.create()` and `Alloy.createStyle()`
|
|
426
|
+
>
|
|
427
|
+
> See [EXAMPLES.md](references/EXAMPLES.md) and [Dynamic Component Creation](references/dynamic-component-creation.md)
|
|
428
|
+
>
|
|
429
|
+
> ## Related Skills
|
|
430
|
+
>
|
|
431
|
+
> For tasks beyond styling, use these complementary skills:
|
|
432
|
+
>
|
|
433
|
+
> | Task | Use This Skill |
|
|
434
|
+
> | -------------------------------------------- | -------------- |
|
|
435
|
+
> | Project architecture, services, controllers | `ti-expert` |
|
|
436
|
+
> | Complex UI components, ListViews, gestures | `ti-ui` |
|
|
437
|
+
> | Alloy MVC concepts, data binding, TSS syntax | `alloy-guides` |
|
|
438
|
+
> | Native features (camera, location, push) | `ti-howtos` |
|
|
439
|
+
>
|