@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.
Files changed (98) hide show
  1. package/README.md +255 -713
  2. package/bin/titools.js +1 -1
  3. package/lib/commands/update.js +5 -6
  4. package/lib/config.js +1 -0
  5. package/lib/downloader.js +10 -0
  6. package/package.json +1 -1
  7. package/skills/alloy-guides/SKILL.md +46 -48
  8. package/skills/alloy-guides/references/CONTROLLERS.md +4 -6
  9. package/skills/alloy-guides/references/MODELS.md +340 -184
  10. package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +3 -4
  11. package/skills/alloy-guides/references/VIEWS_STYLES.md +44 -46
  12. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +4 -5
  13. package/skills/alloy-guides/references/VIEWS_XML.md +51 -17
  14. package/skills/alloy-guides/references/WIDGETS.md +1 -1
  15. package/skills/alloy-howtos/SKILL.md +12 -13
  16. package/skills/alloy-howtos/references/cli_reference.md +40 -41
  17. package/skills/alloy-howtos/references/samples.md +3 -4
  18. package/skills/purgetss/SKILL.md +369 -356
  19. package/skills/purgetss/references/EXAMPLES.md +24 -25
  20. package/skills/purgetss/references/animation-advanced.md +555 -0
  21. package/skills/purgetss/references/animation-system.md +395 -995
  22. package/skills/purgetss/references/apply-directive.md +111 -141
  23. package/skills/purgetss/references/arbitrary-values.md +206 -480
  24. package/skills/purgetss/references/class-categories.md +277 -0
  25. package/skills/purgetss/references/class-index.md +1 -420
  26. package/skills/purgetss/references/cli-commands.md +446 -556
  27. package/skills/purgetss/references/configurable-properties.md +163 -599
  28. package/skills/purgetss/references/custom-rules.md +33 -76
  29. package/skills/purgetss/references/customization-deep-dive.md +319 -518
  30. package/skills/purgetss/references/dynamic-component-creation.md +33 -37
  31. package/skills/purgetss/references/grid-layout.md +42 -371
  32. package/skills/purgetss/references/icon-fonts.md +82 -475
  33. package/skills/purgetss/references/installation-setup.md +159 -331
  34. package/skills/purgetss/references/migration-guide.md +54 -109
  35. package/skills/purgetss/references/opacity-modifier.md +25 -222
  36. package/skills/purgetss/references/performance-tips.md +2 -2
  37. package/skills/purgetss/references/platform-modifiers.md +21 -407
  38. package/skills/purgetss/references/tikit-components.md +237 -104
  39. package/skills/purgetss/references/titanium-resets.md +20 -21
  40. package/skills/purgetss/references/ui-ux-design.md +171 -1702
  41. package/skills/ti-api/SKILL.md +109 -0
  42. package/skills/ti-api/references/api-android.md +675 -0
  43. package/skills/ti-api/references/api-app-platform.md +636 -0
  44. package/skills/ti-api/references/api-core.md +764 -0
  45. package/skills/ti-api/references/api-data-network.md +641 -0
  46. package/skills/ti-api/references/api-media.md +655 -0
  47. package/skills/ti-api/references/api-modules-ble-bluetooth.md +657 -0
  48. package/skills/ti-api/references/api-modules-coremotion-urlsession.md +411 -0
  49. package/skills/ti-api/references/api-modules-map.md +632 -0
  50. package/skills/ti-api/references/api-modules-nfc.md +725 -0
  51. package/skills/ti-api/references/api-modules-social-misc.md +526 -0
  52. package/skills/ti-api/references/api-services.md +700 -0
  53. package/skills/ti-api/references/api-ui-android.md +499 -0
  54. package/skills/ti-api/references/api-ui-extras.md +702 -0
  55. package/skills/ti-api/references/api-ui-ios-animator.md +378 -0
  56. package/skills/ti-api/references/api-ui-ios.md +756 -0
  57. package/skills/ti-api/references/api-ui-lists.md +581 -0
  58. package/skills/ti-api/references/api-ui-text-input.md +607 -0
  59. package/skills/ti-api/references/api-ui-views.md +572 -0
  60. package/skills/ti-api/references/api-ui-windows-navigation.md +676 -0
  61. package/skills/ti-api/references/api-xml-global.md +743 -0
  62. package/skills/ti-expert/SKILL.md +46 -45
  63. package/skills/ti-expert/references/adaptive-layouts.md +414 -0
  64. package/skills/ti-expert/references/alloy-builtins.md +16 -20
  65. package/skills/ti-expert/references/alloy-structure.md +40 -42
  66. package/skills/ti-expert/references/anti-patterns.md +34 -0
  67. package/skills/ti-expert/references/code-conventions.md +5 -3
  68. package/skills/ti-expert/references/error-handling.md +14 -7
  69. package/skills/ti-expert/references/examples.md +4 -2
  70. package/skills/ti-expert/references/performance-optimization.md +26 -24
  71. package/skills/ti-expert/references/security-device.md +17 -14
  72. package/skills/ti-expert/references/security-fundamentals.md +60 -101
  73. package/skills/ti-expert/references/state-management.md +15 -14
  74. package/skills/ti-expert/references/testing-e2e-ci.md +30 -21
  75. package/skills/ti-expert/references/theming.md +12 -20
  76. package/skills/ti-guides/SKILL.md +13 -17
  77. package/skills/ti-guides/references/advanced-data-and-images.md +30 -10
  78. package/skills/ti-guides/references/application-frameworks.md +3 -3
  79. package/skills/ti-guides/references/coding-best-practices.md +31 -2
  80. package/skills/ti-guides/references/commonjs-advanced.md +46 -4
  81. package/skills/ti-guides/references/hello-world.md +9 -13
  82. package/skills/ti-guides/references/hyperloop-native-access.md +4 -1
  83. package/skills/ti-guides/references/javascript-primer.md +13 -5
  84. package/skills/ti-guides/references/resources.md +0 -2
  85. package/skills/ti-guides/references/style-and-conventions.md +1 -0
  86. package/skills/ti-guides/references/tiapp-config.md +0 -32
  87. package/skills/ti-howtos/SKILL.md +43 -45
  88. package/skills/ti-howtos/references/buffer-codec-streams.md +25 -3
  89. package/skills/ti-howtos/references/debugging-profiling.md +14 -25
  90. package/skills/ti-howtos/references/google-maps-v2.md +3 -3
  91. package/skills/ti-howtos/references/ios-map-kit.md +8 -1
  92. package/skills/ti-howtos/references/notification-services.md +0 -1
  93. package/skills/ti-howtos/references/webpack-build-pipeline.md +3 -0
  94. package/skills/ti-ui/SKILL.md +47 -49
  95. package/skills/ti-ui/references/application-structures.md +3 -2
  96. package/skills/ti-ui/references/orientation.md +17 -9
  97. package/skills/ti-ui/references/platform-ui-ios.md +63 -0
  98. package/skills/ti-ui/references/scrolling-views.md +39 -0
@@ -1,159 +1,65 @@
1
- # Icon Fonts Libraries
1
+ # Icon Font Libraries
2
2
 
3
- PurgeTSS supports several icon font libraries for use in your Titanium Alloy applications.
3
+ > **Official Icon Fonts for PurgeTSS**
4
+ > Previous versions of PurgeTSS included several icon font libraries such as Bootstrap Icons, Boxicons, LineIcons, and Tabler Icons. The list was reduced to keep maintenance manageable.
5
+ >
6
+ > These are the official icon fonts supported by PurgeTSS:
7
+ >
8
+ > - [Font Awesome 7 Free](https://fontawesome.com) (upgrade with `purgetss il -v=fa`)
9
+ > - [Framework7](https://framework7.io/icons/)
10
+ > - [Material Icons](https://fonts.google.com/icons?icon.set=Material+Icons)
11
+ > - [Material Symbols](https://fonts.google.com/icons?icon.set=Material+Symbols)
4
12
 
5
- :::tip Looking for Text Fonts?
6
- For **text fonts** (Google Fonts, Roboto, Inter, etc.), see [CLI Commands → build-fonts](cli-commands.md#purgetss-build-fonts-alias-bf).
7
- :::
13
+ For the official install flow for those vendors, see [CLI Commands](./cli-commands.md#icon-library-command).
8
14
 
9
- :::info Official Icon Fonts for PurgeTSS
15
+ ## Recreate Removed Libraries
10
16
 
11
- Previous versions of PurgeTSS included several icon font libraries such as Bootstrap Icons, Boxicons, LineIcons, and Tabler Icons. **However, adding more icon fonts was getting out of control**.
17
+ You can recreate removed libraries using the `build-fonts` command.
12
18
 
13
- **As a result, we have decided to leave the following fonts as the official icon fonts for PurgeTSS:**
19
+ ### 1. Download the Libraries
14
20
 
15
- - [Font Awesome 7 Free (Highly recommended to upgrade using `purgetss il -v=fa`)](https://fontawesome.com)
16
- - [Framework 7](https://framework7.io/icons/)
17
- - [Material Icons](https://fonts.google.com/icons?icon.set=Material+Icons)
18
- - [Material Symbols](https://fonts.google.com/icons?icon.set=Material+Symbols)
19
-
20
- :::
21
-
22
- ## Installing Official Icon Fonts
23
-
24
- Use the `icon-library` command to download and install official icon fonts:
25
-
26
- ```bash
27
- purgetss icon-library --vendor=[fa,mi,ms,f7] [options]
28
- # or
29
- purgetss il -v=[fa,mi,ms,f7] [options]
30
- ```
31
-
32
- **Vendors:**
33
- - `fa` - Font Awesome (Free version)
34
- - `mi` - Material Icons
35
- - `ms` - Material Symbols
36
- - `f7` - Framework7 Icons
37
-
38
- **Options:**
39
- - `-m, --module` - Generates CommonJS module with Unicode mappings in `app/lib/`
40
- - `-s, --styles` - Generates TSS file with class definitions
41
-
42
- **Examples:**
43
- ```bash
44
- # Install Font Awesome only
45
- purgetss icon-library --vendor=fa
46
-
47
- # Install multiple vendors with module
48
- purgetss il -v=fa,mi,ms -m
49
-
50
- # Install all available vendors
51
- purgetss icon-library -v=fa,mi,ms,f7 -m -s
52
- ```
53
-
54
- :::tip
55
- After running `icon-library`, the font files are automatically placed in `app/assets/fonts/` and the necessary TSS classes are generated.
56
- :::
57
-
58
- ## Using Icon Fonts in XML
59
-
60
- Once installed, icon fonts work on both Labels and Buttons:
61
-
62
- ```xml
63
- <!-- Works on Labels -->
64
- <Label class="fas fa-home" />
65
- <Label class="fab fa-twitter text-blue-400" />
66
-
67
- <!-- Works on Buttons too! -->
68
- <Button class="fas fa-search" />
69
- <Button class="fas fa-arrow-right" />
70
- ```
71
-
72
- ### Font Awesome 7
73
-
74
- Font Awesome 7 uses different style prefixes:
75
-
76
- ```xml
77
- <!-- Solid icons (free) -->
78
- <Label class="fas fa-home fa-user fa-envelope" />
79
-
80
- <!-- Regular icons (free) -->
81
- <Label class="far fa-heart fa-star" />
82
-
83
- <!-- Brand icons (free) -->
84
- <Label class="fab fa-twitter fa-facebook fa-github" />
85
- ```
86
-
87
- :::tip
88
- PurgeTSS handles Font Awesome 7 CSS custom properties automatically (the `--fa:` format), so you do not need to edit icon CSS by hand.
89
- :::
90
-
91
- ### Material Icons
92
-
93
- ```xml
94
- <Label class="material-icons md-home md-settings" />
95
- ```
96
-
97
- ### Material Symbols
98
-
99
- ```xml
100
- <Label class="material-symbols ms-check ms-add ms-close" />
101
- ```
102
-
103
- ### Framework7 Icons
104
-
105
- ```xml
106
- <Label class="f7-icons f7-home f7-search" />
107
- ```
108
-
109
- ## Recreating Deleted Libraries
110
-
111
- If you need to use icon fonts that are no longer officially supported (Bootstrap Icons, Boxicons, LineIcons, Tabler Icons), you can recreate them using the `build-fonts` command.
112
-
113
- ### Step 1: Download the Libraries
114
-
115
- Download the libraries from their official websites:
21
+ Start by downloading the libraries from their official websites:
116
22
 
117
23
  - [Bootstrap Icons](https://icons.getbootstrap.com)
118
24
  - [Boxicons](https://boxicons.com)
119
25
  - [LineIcons](https://lineicons.com/icons/?type=free)
120
26
  - [Tabler Icons](https://tabler-icons.io)
121
27
 
122
- ### Step 2: Place in fonts Folder
28
+ ### 2. The `fonts` Folder
123
29
 
124
30
  Put the desired libraries in the `./purgetss/fonts` folder.
125
31
 
126
- :::info
127
- You just need to copy the **TrueType** or **OpenType** font files and the `.css` file.
128
- :::
32
+ > **INFO**
33
+ > Copy the TrueType or OpenType font files and the `.css` file.
129
34
 
130
35
  ```bash
131
- ./purgetss/fonts/
132
- ├─ boxicons
133
- │ ├─ boxicons.css
134
- │ └─ boxicons.ttf
135
- └─ lineicons
136
- ├─ lineicons.css
137
- └─ lineicons.ttf
36
+ purgetss
37
+ └─ fonts
38
+ └─ boxicons
39
+ ├─ boxicons.css
40
+ └─ boxicons.ttf
41
+ └─ lineicons
42
+ ├─ lineicons.css
43
+ └─ lineicons.ttf
138
44
  ```
139
45
 
140
- ### Step 3: Run build-fonts Command
46
+ ### 3. The `build-fonts` Command
47
+
48
+ Run the `build-fonts` command to create a custom `fonts.tss` file.
141
49
 
142
50
  ```bash
143
- $ purgetss build-fonts [--module]
51
+ purgetss build-fonts [--modules]
52
+
144
53
  # alias:
145
- $ purgetss bf [-m]
54
+ purgetss bf [-m]
146
55
  ```
147
56
 
148
- **What happens:**
149
- 1. Generates `./purgetss/styles/fonts.tss` with all Unicode characters and style rules
150
- 2. Copies font files to `./app/assets/fonts/` and renames them to PostScript names (cross-platform compatibility)
151
- 3. Optionally generates `./app/lib/purgetss.fonts.js` CommonJS module with `--module` option
57
+ ### The `fonts.tss` File
152
58
 
153
- #### Generated fonts.tss Example
59
+ The `build-fonts` command generates `./purgetss/styles/fonts.tss` with Unicode characters and style rules.
154
60
 
61
+ `./purgetss/styles/fonts.tss`
155
62
  ```tss
156
- /* ./purgetss/styles/fonts.tss */
157
63
  '.boxicons': { font: { fontFamily: 'boxicons' } }
158
64
  '.lineicons': { font: { fontFamily: 'LineIcons' } }
159
65
 
@@ -171,393 +77,94 @@ $ purgetss bf [-m]
171
77
  '.lni-adobe': { text: '\uea06', title: '\uea06' }
172
78
  ```
173
79
 
174
- ### Renaming the Style Rule Name
80
+ ### Rename the Style Rule Name
175
81
 
176
- **PurgeTSS** uses the font's file name as the style rule name. **You can change it by renaming the font file**.
82
+ PurgeTSS uses the font file name as the style rule name. You can change it by renaming the font file.
177
83
 
84
+ `./purgetss/fonts/`
178
85
  ```bash
179
- ./purgetss/fonts/
180
- └─ boxicons
181
- └─ bx.ttf # Renamed from boxicons.ttf
86
+ purgetss
87
+ └─ fonts
88
+ └─ boxicons
89
+ └─ bx.ttf
182
90
  ```
183
91
 
184
92
  New style rule name: `'.bx'`
185
93
 
186
94
  ```tss
187
- /* ./purgetss/styles/fonts.tss */
188
95
  '.bx': { font: { fontFamily: 'boxicons' } }
189
96
  ```
190
97
 
191
- ## Using Custom Font Modules
98
+ ### The `assets/fonts` Folder
99
+
100
+ The `build-fonts` command copies the font files to `./app/assets/fonts` and renames them to their PostScript names so they work on both iOS and Android.
101
+
102
+ ```bash
103
+ app
104
+ └─ assets
105
+ └─ fonts
106
+ ├─ boxicons.ttf
107
+ └─ LineIcons.ttf
108
+ ```
192
109
 
193
- When using the `--module` option with `build-fonts` or `icon-library`, a CommonJS module is generated at `./app/lib/purgetss.fonts.js`.
110
+ ### The `--modules` Option
194
111
 
195
- ### Generated Module Structure
112
+ When you use the `--modules` option, it generates a `./app/lib/purgetss.fonts.js` CommonJS module file.
196
113
 
114
+ `./app/lib/purgetss.fonts.js`
197
115
  ```javascript
198
- // ./app/lib/purgetss.fonts.js
199
116
  const icons = {
200
- 'boxicons': {
201
- 'bxlMeta': '\uef27',
202
- 'bxLemon': '\uef28',
203
- 'bxsLemon': '\uef29',
204
- /* ... */
117
+ /* boxicons */
118
+ boxicons: {
119
+ bxlMeta: '\uef27',
120
+ bxLemon: '\uef28',
121
+ bxsLemon: '\uef29'
205
122
  },
206
- 'lineicons': {
123
+ /* lineicons */
124
+ lni: {
207
125
  '500px': '\uea03',
208
- 'addFiles': '\uea01',
209
- 'adobe': '\uea06',
210
- /* ... */
126
+ addFiles: '\uea01',
127
+ adobe: '\uea06'
211
128
  }
212
129
  };
213
130
  exports.icons = icons;
214
131
  ```
215
132
 
216
- ### Usage in Controllers
217
-
218
- ```javascript
219
- var icons = require('purgetss.fonts');
220
-
221
- // Get icon unicode
222
- var homeIcon = icons.fontAwesome.fasHome; // '\uf015'
223
-
224
- // Use in Label
225
- $.myLabel.text = homeIcon;
226
-
227
- // Use in Button
228
- $.myButton.title = icons.fontAwesome.fabTwitter;
229
- ```
230
-
231
- :::tip
232
- Using the module is useful when you need to dynamically set icons based on data or user actions.
233
- :::
234
-
235
- ## The --prefix Option
133
+ ### The `--prefix` Option
236
134
 
237
- **PurgeTSS** automatically determines the group's prefix for each icon family and class name. However, you can use the `--prefix` option to apply the style's filename as the prefix for class names in `fonts.tss` and property names in `purgetss.fonts.js`.
238
-
239
- ### Example with Custom Prefix
135
+ PurgeTSS determines the group's prefix for each icon family and class name. Use `--prefix` to apply the style's filename as the prefix for class names in `fonts.tss` and property names in `purgetss.fonts.js`.
240
136
 
137
+ `./purgetss/fonts/`
241
138
  ```bash
242
- ./purgetss/fonts/
243
- └─ lineicons
244
- └─ li.css # Renamed to use custom prefix
139
+ purgetss
140
+ └─ fonts
141
+ └─ lineicons
142
+ └─ li.css
245
143
  ```
246
144
 
247
- **New group prefix: `li`**
145
+ New group prefix: `li`
248
146
 
147
+ `./purgetss/styles/fonts.tss`
249
148
  ```tss
250
- /* ./purgetss/styles/fonts.tss */
251
149
  /* lineicons/li.css */
252
150
  '.li-zoom-out': { text: '\uea02', title: '\uea02' }
253
151
  '.li-zoom-in': { text: '\uea03', title: '\uea03' }
254
152
  '.li-zip': { text: '\uea04', title: '\uea04' }
255
153
  ```
256
154
 
155
+ `./app/lib/purgetss.fonts.js`
257
156
  ```javascript
258
- /* ./app/lib/purgetss.fonts.js */
259
157
  const icons = {
260
- 'li': {
158
+ /* lineicons/li.css */
159
+ li: {
261
160
  /* ... */
262
161
  }
263
162
  };
163
+ exports.icons = icons;
264
164
  ```
265
165
 
266
- :::danger WARNING
267
- **Make sure that the new prefix remains unique to avoid conflicts with other class prefixes.**
268
- :::
269
-
270
- ## Icon Font Best Practices
271
-
272
- ### 1. Use Semantic Icon Names
273
-
274
- ```xml
275
- <!-- Good -->
276
- <Label class="fas fa-home" />
277
- <Label class="fas fa-envelope" />
278
-
279
- <!-- Avoid - unclear what the icon is -->
280
- <Label class="fas fa-icon1" />
281
- ```
282
-
283
- ### 2. Combine with Styling Classes
284
-
285
- ```xml
286
- <!-- Styled icon button -->
287
- <Label class="fas fa-arrow-right text-brand-600 text-xl" />
288
- <Label class="fas fa-search rounded-full bg-gray-100 p-2 text-gray-600" />
289
- ```
290
-
291
- ### 3. Use in Navigation
292
-
293
- ```xml
294
- <!-- Tab bar icons -->
295
- <Button class="fas fa-home text-gray-400" id="homeBtn" />
296
- <Button class="fas fa-user text-gray-400" id="profileBtn" />
297
- <Button class="fas fa-cog text-gray-400" id="settingsBtn" />
298
- ```
299
-
300
- ### 4. Dynamic Icons in Controllers
301
-
302
- ```javascript
303
- function setIconBasedOnStatus(status) {
304
- var icons = require('purgetss.fonts').fontAwesome;
305
-
306
- switch(status) {
307
- case 'success':
308
- $.statusIcon.text = icons.fasCheckCircle;
309
- $.statusIcon.classes = ['text-green-500'];
310
- break;
311
- case 'error':
312
- $.statusIcon.text = icons.fasExclamationCircle;
313
- $.statusIcon.classes = ['text-red-500'];
314
- break;
315
- case 'warning':
316
- $.statusIcon.text = icons.fasExclamationTriangle;
317
- $.statusIcon.classes = ['text-yellow-500'];
318
- break;
319
- }
320
- }
321
- ```
322
-
323
- ## Font Assets Folder
324
-
325
- After running `build-fonts` or `icon-library`, fonts are automatically placed in:
326
-
327
- ```bash
328
- ./app/assets/fonts/
329
- ├─ FontAwesome7Free-Solid.ttf
330
- ├─ FontAwesome7Brands-Regular.ttf
331
- ├─ MaterialIcons-Regular.ttf
332
- └─ Framework7Icons.ttf
333
- ```
334
-
335
- These fonts are renamed to their **PostScript** names to ensure cross-platform compatibility between iOS and Android.
336
-
337
- :::info
338
- PurgeTSS automatically handles the PostScript name conversion. You don't need to manually rename font files.
339
- :::
340
-
341
- ## Icon Sizing and Styling
342
-
343
- Icon fonts can be sized and styled just like any text element:
344
-
345
- ```xml
346
- <!-- Size utilities -->
347
- <Label class="fas fa-home text-xs" /> <!-- 12px -->
348
- <Label class="fas fa-home text-sm" /> <!-- 14px -->
349
- <Label class="fas fa-home text-base" /> <!-- 16px -->
350
- <Label class="fas fa-home text-lg" /> <!-- 18px -->
351
- <Label class="fas fa-home text-xl" /> <!-- 20px -->
352
- <Label class="fas fa-home text-2xl" /> <!-- 24px -->
353
- <Label class="fas fa-home text-3xl" /> <!-- 30px -->
354
- <Label class="fas fa-home text-(32px)" /> <!-- Arbitrary size -->
355
-
356
- <!-- Color utilities -->
357
- <Label class="fas fa-home text-gray-500" />
358
- <Label class="fas fa-home text-brand-600" />
359
- <Label class="fas fa-home text-(#FF5733)" />
360
-
361
- <!-- Background utilities -->
362
- <Label class="fas fa-home rounded-full bg-white p-4 text-center" />
363
-
364
- <!-- Transform utilities -->
365
- <Label class="fas fa-arrow-right rotate-45" />
366
- <Label class="fas fa-heart scale-125" />
367
- ```
368
-
369
- ## Common Patterns
370
-
371
- ### Icon with Text
372
-
373
- ```xml
374
- <View class="horizontal">
375
- <Label class="fas fa-envelope mr-2 text-gray-600" />
376
- <Label class="text-gray-800" text="Email" />
377
- </View>
378
- ```
379
-
380
- ### Circular Icon Button
381
-
382
- ```xml
383
- <Label class="fas fa-plus bg-brand-500 h-12 w-12 rounded-full text-center text-xl text-white" />
384
- ```
385
-
386
- ### Icon Badge
387
-
388
- ```xml
389
- <View class="relative">
390
- <Label class="fas fa-bell text-xl" />
391
- <Label class="fas fa-circle -right-(4) -top-(4) text-xs text-red-500" />
392
- </View>
393
- ```
394
-
395
- ### Social Media Icons
396
-
397
- ```xml
398
- <View class="horizontal w-screen">
399
- <Label class="fab fa-twitter mr-4 text-2xl text-blue-400" />
400
- <Label class="fab fa-facebook mr-4 text-2xl text-blue-600" />
401
- <Label class="fab fa-instagram mr-4 text-2xl text-pink-500" />
402
- <Label class="fab fa-github text-2xl text-gray-800" />
403
- </View>
404
- ```
405
-
406
- ## Troubleshooting
407
-
408
- ### Icons Not Displaying
409
-
410
- **Problem**: Icon fonts not showing in app
411
-
412
- **Solutions:**
413
- 1. Ensure font files are in `app/assets/fonts/`
414
- 2. Check that `fonts.tss` is in `purgetss/styles/`
415
- 3. Verify class names match the CSS file (case-sensitive)
416
- 4. Run `purgetss build` to regenerate styles
417
-
418
- ### Wrong Icon Character
419
-
420
- **Problem**: Icon displays wrong character
421
-
422
- **Solutions:**
423
- 1. Check icon prefix (fas/far/fab for Font Awesome)
424
- 2. Verify icon name matches CSS file exactly
425
- 3. Ensure you're using the correct font family
426
-
427
- ### Icons Different on iOS vs Android
428
-
429
- **Problem**: Icons look different on each platform
430
-
431
- **Solutions:**
432
- 1. Ensure PostScript name conversion happened (run `build-fonts` again)
433
- 2. Check that font files were copied to `app/assets/fonts/`
434
- 3. Verify both platforms use the same font file version
435
-
436
- ## Vendor-Specific Notes
437
-
438
- ### Font Awesome 7
439
-
440
- Font Awesome 7 introduced new CSS custom properties format. PurgeTSS v7.2+ supports this format automatically.
441
-
442
- ```xml
443
- <!-- Style prefix is required -->
444
- <Label class="fas fa-home" /> <!-- Solid -->
445
- <Label class="far fa-heart" /> <!-- Regular -->
446
- <Label class="fab fa-twitter" /> <!-- Brands -->
447
- ```
448
-
449
- ### Font Awesome Pro
450
-
451
- If you have a **[Font Awesome Pro Account](https://fontawesome.com/pro)**, you can generate a customized `purgetss/styles/fontawesome.tss` file containing all the extra classes that the Pro version provides ***(except duotone icons; see note below)***.
452
-
453
- :::caution
454
- Titanium cannot use FontAwesome's duotone icons because they have two separate glyphs for each individual icon.
455
- :::
456
-
457
- #### Setting Up Font Awesome Pro
458
-
459
- **Step 1: Set up @fortawesome scope**
460
-
461
- After setting the [@fortawesome scope](https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers#installing-pro) with your token, install it in your project's root folder:
462
-
463
- ```bash
464
- npm init
465
- npm install --save-dev @fortawesome/fontawesome-pro
466
- ```
467
-
468
- **Step 2: Run purgetss build**
469
-
470
- To generate a new `purgetss/styles/fontawesome.tss` file with Pro icons:
471
-
472
- ```bash
473
- purgetss build
474
- ```
475
-
476
- This will also automatically copy the Pro font files into `./app/assets/fonts/` if necessary.
477
-
478
- #### Pro Icon Styles
479
-
480
- Font Awesome Pro includes additional style prefixes beyond the free version:
481
-
482
- ```xml
483
- <!-- Free styles -->
484
- <Label class="fas fa-home" /> <!-- Solid (free) -->
485
- <Label class="far fa-heart" /> <!-- Regular (free) -->
486
- <Label class="fab fa-twitter" /> <!-- Brands (free) -->
487
-
488
- <!-- Pro-only styles -->
489
- <Label class="fal fa-camera" /> <!-- Light (Pro) -->
490
- <Label class="fad fa-user" /> <!-- Duotone (Pro) - NOT SUPPORTED in Titanium -->
491
- <Label class="fass fa-star" /> <!-- Sharp Solid (Pro) -->
492
- <Label class="fasr fa-check" /> <!-- Sharp Regular (Pro) -->
493
- <Label class="fasl fa-arrow" /> <!-- Sharp Light (Pro) -->
494
- ```
495
-
496
- :::danger
497
- **Duotone icons are NOT supported** in Titanium because they require two separate glyphs per icon. Using `fad` classes will not render correctly.
498
- :::
499
-
500
- ### Font Awesome 7 Beta
501
-
502
- You can generate a customized `fontawesome.tss` file from **[Font Awesome 7 Beta](https://fontawesome.com/download)** for testing purposes.
503
-
504
- #### Setting Up Font Awesome 7 Beta
505
-
506
- **Step 1: Copy beta assets**
507
-
508
- Move the `css` and `webfonts` folders from the beta download:
509
-
510
- ```bash
511
- # From beta download
512
- fontawesome-pro-7.0.0-beta3-web/
513
- └─ css
514
- └─ webfonts
515
-
516
- # To your project
517
- purgetss/
518
- └─ fontawesome-beta/
519
- ├─ css
520
- └─ webfonts
521
- ```
522
-
523
- **Step 2: Run purgetss build**
524
-
525
- ```bash
526
- purgetss build
527
- ```
528
-
529
- This generates your customized `fontawesome.tss` file with beta icons.
530
-
531
- #### Testing Beta Icons
532
-
533
- ```xml
534
- <!-- Test beta-specific icons -->
535
- <Label class="fas fa-new-beta-icon" />
536
- ```
537
-
538
- ### Material Icons vs Material Symbols
539
-
540
- - **Material Icons**: Older Google icon set
541
- - **Material Symbols**: Newer, more customizable icon set
542
-
543
- Both use similar syntax but have different icon names and font files.
544
-
545
- ```xml
546
- <!-- Material Icons -->
547
- <Label class="material-icons md-home" />
548
-
549
- <!-- Material Symbols -->
550
- <Label class="material-symbols ms-home" />
551
- ```
166
+ > **DANGER**
167
+ > Make sure the new prefix remains unique to avoid conflicts with other class prefixes.
552
168
 
553
- ## Complete Command Reference
554
-
555
- | Command | Purpose |
556
- | ----------------------------------- | ----------------------------------------- |
557
- | `purgetss icon-library -v=fa` | Install Font Awesome 7 |
558
- | `purgetss icon-library -v=mi` | Install Material Icons |
559
- | `purgetss icon-library -v=ms` | Install Material Symbols |
560
- | `purgetss icon-library -v=f7` | Install Framework7 Icons |
561
- | `purgetss icon-library -v=fa,mi -m` | Install multiple with module |
562
- | `purgetss build-fonts` | Build custom fonts from `purgetss/fonts/` |
563
- | `purgetss build-fonts -m` | Build with CommonJS module |
169
+ > **Font Awesome Duotone**
170
+ > Titanium cannot render Font Awesome duotone icons correctly because each icon uses two glyphs. If you work with Font Awesome Pro, avoid documenting duotone as supported.