@maccesar/titools 2.2.12 → 2.4.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 (104) hide show
  1. package/README.md +255 -713
  2. package/bin/titools.js +9 -1
  3. package/lib/cache.js +49 -0
  4. package/lib/commands/auto-update.js +138 -0
  5. package/lib/commands/skills.js +11 -0
  6. package/lib/commands/uninstall.js +17 -1
  7. package/lib/commands/update.js +5 -6
  8. package/lib/config.js +3 -0
  9. package/lib/downloader.js +10 -0
  10. package/lib/hooks.js +59 -0
  11. package/lib/utils.js +1 -0
  12. package/package.json +1 -1
  13. package/skills/alloy-guides/SKILL.md +46 -48
  14. package/skills/alloy-guides/references/CONTROLLERS.md +4 -6
  15. package/skills/alloy-guides/references/MODELS.md +340 -184
  16. package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +3 -4
  17. package/skills/alloy-guides/references/VIEWS_STYLES.md +44 -46
  18. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +4 -5
  19. package/skills/alloy-guides/references/VIEWS_XML.md +51 -17
  20. package/skills/alloy-guides/references/WIDGETS.md +1 -1
  21. package/skills/alloy-howtos/SKILL.md +12 -13
  22. package/skills/alloy-howtos/references/cli_reference.md +40 -41
  23. package/skills/alloy-howtos/references/samples.md +3 -4
  24. package/skills/purgetss/SKILL.md +369 -356
  25. package/skills/purgetss/references/EXAMPLES.md +24 -25
  26. package/skills/purgetss/references/animation-advanced.md +555 -0
  27. package/skills/purgetss/references/animation-system.md +395 -995
  28. package/skills/purgetss/references/apply-directive.md +111 -141
  29. package/skills/purgetss/references/arbitrary-values.md +206 -480
  30. package/skills/purgetss/references/class-categories.md +277 -0
  31. package/skills/purgetss/references/class-index.md +1 -420
  32. package/skills/purgetss/references/cli-commands.md +446 -556
  33. package/skills/purgetss/references/configurable-properties.md +163 -599
  34. package/skills/purgetss/references/custom-rules.md +33 -76
  35. package/skills/purgetss/references/customization-deep-dive.md +319 -518
  36. package/skills/purgetss/references/dynamic-component-creation.md +33 -37
  37. package/skills/purgetss/references/grid-layout.md +42 -371
  38. package/skills/purgetss/references/icon-fonts.md +82 -475
  39. package/skills/purgetss/references/installation-setup.md +159 -331
  40. package/skills/purgetss/references/migration-guide.md +54 -109
  41. package/skills/purgetss/references/opacity-modifier.md +25 -222
  42. package/skills/purgetss/references/performance-tips.md +2 -2
  43. package/skills/purgetss/references/platform-modifiers.md +21 -407
  44. package/skills/purgetss/references/tikit-components.md +237 -104
  45. package/skills/purgetss/references/titanium-resets.md +20 -21
  46. package/skills/purgetss/references/ui-ux-design.md +171 -1702
  47. package/skills/ti-api/SKILL.md +109 -0
  48. package/skills/ti-api/references/api-android.md +675 -0
  49. package/skills/ti-api/references/api-app-platform.md +636 -0
  50. package/skills/ti-api/references/api-core.md +764 -0
  51. package/skills/ti-api/references/api-data-network.md +641 -0
  52. package/skills/ti-api/references/api-media.md +655 -0
  53. package/skills/ti-api/references/api-modules-ble-bluetooth.md +657 -0
  54. package/skills/ti-api/references/api-modules-coremotion-urlsession.md +411 -0
  55. package/skills/ti-api/references/api-modules-map.md +632 -0
  56. package/skills/ti-api/references/api-modules-nfc.md +725 -0
  57. package/skills/ti-api/references/api-modules-social-misc.md +526 -0
  58. package/skills/ti-api/references/api-services.md +700 -0
  59. package/skills/ti-api/references/api-ui-android.md +499 -0
  60. package/skills/ti-api/references/api-ui-extras.md +702 -0
  61. package/skills/ti-api/references/api-ui-ios-animator.md +378 -0
  62. package/skills/ti-api/references/api-ui-ios.md +756 -0
  63. package/skills/ti-api/references/api-ui-lists.md +581 -0
  64. package/skills/ti-api/references/api-ui-text-input.md +607 -0
  65. package/skills/ti-api/references/api-ui-views.md +572 -0
  66. package/skills/ti-api/references/api-ui-windows-navigation.md +676 -0
  67. package/skills/ti-api/references/api-xml-global.md +743 -0
  68. package/skills/ti-expert/SKILL.md +46 -45
  69. package/skills/ti-expert/references/adaptive-layouts.md +414 -0
  70. package/skills/ti-expert/references/alloy-builtins.md +16 -20
  71. package/skills/ti-expert/references/alloy-structure.md +40 -42
  72. package/skills/ti-expert/references/anti-patterns.md +34 -0
  73. package/skills/ti-expert/references/code-conventions.md +5 -3
  74. package/skills/ti-expert/references/error-handling.md +14 -7
  75. package/skills/ti-expert/references/examples.md +4 -2
  76. package/skills/ti-expert/references/performance-optimization.md +26 -24
  77. package/skills/ti-expert/references/security-device.md +17 -14
  78. package/skills/ti-expert/references/security-fundamentals.md +60 -101
  79. package/skills/ti-expert/references/state-management.md +15 -14
  80. package/skills/ti-expert/references/testing-e2e-ci.md +30 -21
  81. package/skills/ti-expert/references/theming.md +12 -20
  82. package/skills/ti-guides/SKILL.md +13 -17
  83. package/skills/ti-guides/references/advanced-data-and-images.md +30 -10
  84. package/skills/ti-guides/references/application-frameworks.md +3 -3
  85. package/skills/ti-guides/references/coding-best-practices.md +31 -2
  86. package/skills/ti-guides/references/commonjs-advanced.md +46 -4
  87. package/skills/ti-guides/references/hello-world.md +9 -13
  88. package/skills/ti-guides/references/hyperloop-native-access.md +4 -1
  89. package/skills/ti-guides/references/javascript-primer.md +13 -5
  90. package/skills/ti-guides/references/resources.md +0 -2
  91. package/skills/ti-guides/references/style-and-conventions.md +1 -0
  92. package/skills/ti-guides/references/tiapp-config.md +0 -32
  93. package/skills/ti-howtos/SKILL.md +43 -45
  94. package/skills/ti-howtos/references/buffer-codec-streams.md +25 -3
  95. package/skills/ti-howtos/references/debugging-profiling.md +14 -25
  96. package/skills/ti-howtos/references/google-maps-v2.md +3 -3
  97. package/skills/ti-howtos/references/ios-map-kit.md +8 -1
  98. package/skills/ti-howtos/references/notification-services.md +0 -1
  99. package/skills/ti-howtos/references/webpack-build-pipeline.md +3 -0
  100. package/skills/ti-ui/SKILL.md +47 -49
  101. package/skills/ti-ui/references/application-structures.md +3 -2
  102. package/skills/ti-ui/references/orientation.md +17 -9
  103. package/skills/ti-ui/references/platform-ui-ios.md +63 -0
  104. package/skills/ti-ui/references/scrolling-views.md +39 -0
@@ -1,131 +1,76 @@
1
- # Migrating to PurgeTSS
1
+ # Migration Guide
2
2
 
3
- Guide for migrating existing Titanium Alloy apps from manual TSS styling to PurgeTSS utility-first workflow.
3
+ This guide is based on the PurgeTSS changelog sections in the official `README.md`. It covers the documented upgrade changes for recent versions.
4
4
 
5
- ## Assessment Checklist
5
+ ## Upgrade to v7.4.0
6
6
 
7
- Before migrating, evaluate styling in the current codebase:
7
+ PurgeTSS v7.4.0 includes a bug fix and documentation improvements.
8
8
 
9
- | Current State | Target State |
10
- | -------------------------------------------- | ----------------------------------------- |
11
- | Manual `.tss` files per controller | PurgeTSS utility classes in XML |
12
- | Inline attributes (`backgroundColor="#fff"`) | PurgeTSS classes (`bg-white`) |
13
- | `id`-based styles in `app.tss` | Class-based utility styling |
14
- | Manual 2D Matrix animations | PurgeTSS Animation component |
15
- | Platform conditionals in controllers | PurgeTSS platform modifiers (`ios:mt-10`) |
9
+ ### Fixed
16
10
 
17
- :::info v7.3 Upgrade Note
18
- If your project or scripts reference `tailwind.tss`, update them to `utilities.tss` (the file was renamed in v7.3).
19
- :::
11
+ - `backgroundGradient.colors` serialization now correctly handles arrays of objects in custom rules.
20
12
 
21
- ## Step 1: Initialize PurgeTSS
13
+ Before the fix, a config such as:
22
14
 
23
- ```bash
24
- cd your-app
25
- purgetss init
15
+ ```javascript
16
+ colors: [
17
+ { color: '#132C50', offset: 0 },
18
+ { color: '#0A1529', offset: 1 }
19
+ ]
26
20
  ```
27
21
 
28
- This creates the `./purgetss/` folder with `config.cjs` and sets up the auto-run hook.
22
+ could produce broken output in `utilities.tss`.
23
+
24
+ Now it serializes correctly.
25
+
26
+ ### What to Review
27
+
28
+ - Re-test any custom classes that define `backgroundGradient.colors` with `{ color, offset }` objects.
29
+ - Rebuild and inspect `utilities.tss` if you previously worked around this bug manually.
30
+
31
+ ## Upgrade to v7.3.x
32
+
33
+ PurgeTSS v7.3 introduced a file rename and improved error handling.
29
34
 
30
- ## Step 2: Backup Existing Styles
35
+ ### Breaking Changes
31
36
 
32
- PurgeTSS automatically backs up your existing `app.tss` to `_app.tss`. Your custom styles are preserved and will be merged during compilation.
37
+ - The generated utilities output is now `utilities.tss`.
38
+ - Generated file: `purgetss/styles/utilities.tss`
39
+ - Distribution file: `dist/utilities.tss`
33
40
 
34
- ## Step 3: Migrate Views Incrementally
41
+ ### Major Improvements
35
42
 
36
- Migrate one view at a time. Don't try to convert everything at once.
43
+ - XML syntax validation now catches malformed Alloy XML before processing.
44
+ - `deviceInfo()` now works in both Alloy and Classic Titanium projects.
45
+ - The dependency on `Alloy.isTablet` and `Alloy.isHandheld` was removed.
37
46
 
38
- ### Before (Manual TSS)
47
+ ### Required Actions
39
48
 
40
- ```xml
41
- <!-- views/index.xml -->
42
- <View id="header">
43
- <Label id="title" text="Welcome" />
44
- </View>
49
+ 1. Update any scripts, docs, or project references that still point to the previous output filename.
50
+ 2. Ensure your environment is running Node.js 20 or higher.
51
+ 3. If you use Font Awesome 7, verify the project after upgrade so PurgeTSS can handle the new `--fa:` properties.
52
+
53
+ ```bash
54
+ # Current path
55
+ purgetss/styles/utilities.tss
45
56
  ```
46
57
 
47
- ```tss
48
- /* styles/index.tss */
49
- "#header": { backgroundColor: "#fff", height: 60, top: 0 }
50
- "#title": { color: "#333", font: { fontSize: 18, fontWeight: "bold" } }
58
+ ### Recommended Upgrade Command
59
+
60
+ ```bash
61
+ npm install -g purgetss@latest
51
62
  ```
52
63
 
53
- ### After (PurgeTSS)
64
+ If you run into issues after upgrading:
54
65
 
55
- ```xml
56
- <!-- views/index.xml -->
57
- <View class="top-0 h-16 bg-white">
58
- <Label class="text-lg font-bold text-gray-800" text="Welcome" />
59
- </View>
66
+ ```bash
67
+ npm uninstall -g purgetss
68
+ npm install -g purgetss
60
69
  ```
61
70
 
62
- No manual TSS needed — delete the `#header` and `#title` styles.
63
-
64
- ## Step 4: Remove Manual TSS Files
65
-
66
- Once a view is fully migrated to utility classes:
67
-
68
- 1. Remove corresponding entries from `_app.tss`
69
- 2. Delete any controller-specific `.tss` files (e.g., `styles/login.tss`)
70
- 3. Run `purgetss` to regenerate `app.tss`
71
-
72
- ## Common Style Translations
73
-
74
- | Manual TSS | PurgeTSS Class |
75
- | ------------------------------ | ----------------------- |
76
- | `backgroundColor: "#ffffff"` | `bg-white` |
77
- | `backgroundColor: "#f3f4f6"` | `bg-gray-100` |
78
- | `color: "#1f2937"` | `text-gray-800` |
79
- | `font: { fontSize: 18 }` | `text-lg` |
80
- | `font: { fontWeight: "bold" }` | `font-bold` |
81
- | `width: Ti.UI.FILL` | `w-screen` |
82
- | `height: Ti.UI.SIZE` | `h-auto` |
83
- | `height: 60` | `h-16` (64) or `h-(60)` |
84
- | `top: 0` | `top-0` |
85
- | `left: 16, right: 16` | `mx-4` |
86
- | `top: 16` | `mt-4` |
87
- | `borderRadius: 8` | `rounded-lg` |
88
- | `opacity: 0.5` | `opacity-50` |
89
- | `layout: "horizontal"` | `horizontal` |
90
- | `layout: "vertical"` | `vertical` |
91
-
92
- ### Platform-Specific Translations
93
-
94
- | Manual Code | PurgeTSS |
95
- | ---------------------------------------- | -------------------------------- |
96
- | `if (OS_IOS) { view.top = 40 }` | `class="ios:mt-10 mt-5"` |
97
- | `if (OS_ANDROID) { view.elevation = 4 }` | `class="android:elevation-4"` |
98
- | Tablet conditional in controller | `class="tablet:w-6/12 w-screen"` |
99
-
100
- ### Animation Translations
101
-
102
- | Manual Animation | PurgeTSS Animation |
103
- | -------------------------------------- | ------------------------------------------------------- |
104
- | `Ti.UI.create2DMatrix()` + `animate()` | `<Animation module="purgetss.ui" class="..." />` |
105
- | Manual opacity animation | `class="close:opacity-0 open:opacity-100 duration-300"` |
106
- | Manual scale animation | `class="close:scale-100 open:scale-95 duration-150"` |
107
-
108
- ## Migration Pitfalls
109
-
110
- | Pitfall | Consequence | Prevention |
111
- | -------------------------------- | --------------------------------- | -------------------------------- |
112
- | Editing `app.tss` directly | Changes overwritten on next build | Use `_app.tss` for custom styles |
113
- | Migrating styles without testing | Broken layouts | Test each view on both platforms |
114
- | Using `flex-row`/`justify-*` | Classes don't exist | Use `horizontal`/`vertical` |
115
- | Using `p-*` on container Views | No padding on containers | Use `m-*` on children |
116
- | Forgetting `autoStyle: false` | Style conflicts | Set in `config.json` |
117
- | Using `w-[100px]` syntax | Wrong bracket style | Use `w-(100px)` with parentheses |
118
-
119
- ## Rollback Strategy
120
-
121
- For each view migration:
122
-
123
- 1. **Create a branch** before starting
124
- 2. **Migrate one view** completely
125
- 3. **Test thoroughly** on both iOS and Android
126
- 4. **Keep legacy styles** in `_app.tss` until stable
127
- 5. **Delete legacy styles** only after confirming utility classes work
128
-
129
- :::tip Migration Order
130
- Start with simple views (static content, few elements) and progress to complex ones (forms, lists). This builds familiarity with PurgeTSS classes before tackling harder views.
131
- :::
71
+ ## Quick Checklist
72
+
73
+ - Replace every legacy utilities filename reference with `utilities.tss`.
74
+ - Verify Node.js 20+ before upgrading.
75
+ - Rebuild after updating `config.cjs` or custom gradient rules.
76
+ - Re-test any Classic Titanium code that depends on `deviceInfo()`.
@@ -1,64 +1,31 @@
1
- # Opacity Modifier
1
+ # The `opacity` Modifier
2
2
 
3
- The opacity modifier allows you to add transparency to **ANY color property** by appending an opacity value between 0 and 100, separated by a slash (`/`).
3
+ > **INFO**
4
+ > Add an opacity modifier to any available color property by appending a value between 0 and 100 after a slash (`/`).
4
5
 
5
- :::info
6
- You can add an **opacity modifier to ANY of the available color properties** by adding an **opacity value** between 0 and 100 to the end of the color name separated by a slash ( / ).
7
- :::
8
-
9
- ## Basic Syntax
10
-
11
- ```xml
12
- <Label class="bg-blue-500/50 text-purple-900/75" />
13
- ```
14
-
15
- The opacity value (0-100) is converted to a decimal (0.0-1.0) and applied as an 8-digit hex color with alpha channel.
16
-
17
- ## How It Works
18
-
19
- Given `bg-blue-500/50`:
20
- - `blue-500` = `#3b82f6` (RGB: 59, 130, 246)
21
- - Opacity 50% = `0x80` (hex) = `128` (decimal)
22
- - Result: `#803b82f6` (80% of the way to transparent)
23
-
24
- ## Usage in XML
25
-
26
- ### Background Colors
6
+ ## In Your XML Files
27
7
 
28
8
  ```xml
29
- <!-- Semi-transparent backgrounds -->
30
- <View class="bg-red-500/25" /> <!-- 25% opacity -->
31
- <View class="bg-green-500/50" /> <!-- 50% opacity -->
32
- <View class="bg-blue-500/75" /> <!-- 75% opacity -->
9
+ <Label class="w-11/12 h-8 text-center bg-sky-500/50 text-purple-900/75">My Button</Label>
33
10
  ```
34
11
 
35
- ### Text Colors
36
-
37
- ```xml
38
- <Label class="text-gray-900/50" text="Faded text" />
39
- <Label class="text-brand-600/80" text="Mostly opaque" />
40
- ```
41
-
42
- ### Border Colors
43
-
44
- ```xml
45
- <View class="border-2 border-purple-500/30" />
46
- ```
47
-
48
- ### All Color Properties
12
+ ```tss
13
+ /* Main styles */
14
+ 'Window': { backgroundColor: '#ffffff' }
15
+ '.h-8': { height: 32 }
16
+ '.text-center': { textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER }
17
+ '.w-11/12': { width: '91.666667%' }
49
18
 
50
- ```xml
51
- <Window class="bg-indigo-500/20">
52
- <View class="border-(#ff0000)/50 shadow-(#000)/30">
53
- <Label class="text-white/90 placeholder-gray-400/50" />
54
- </View>
55
- </Window>
19
+ /* Styles with color opacity modifiers */
20
+ '.bg-sky-500/50': { backgroundColor: '#800ea5e9' }
21
+ '.text-purple-900/75': { color: '#bf581c87', textColor: '#bf581c87' }
56
22
  ```
57
23
 
58
- ## Usage with `@apply` Directive
24
+ ## In the `apply` Directive
59
25
 
60
- You can also use color opacity modifiers in the `apply` directive in `config.cjs`:
26
+ You can also use color opacity modifiers in the `apply` directive in the `config.cjs` file.
61
27
 
28
+ `./purgetss/config.cjs`
62
29
  ```javascript
63
30
  module.exports = {
64
31
  theme: {
@@ -74,184 +41,20 @@ module.exports = {
74
41
  ]
75
42
  }
76
43
  }
77
- }
44
+ };
78
45
  ```
79
46
 
80
- **Generated classes:**
47
+ `Generated classes`
81
48
  ```tss
82
- /* Custom Styles */
49
+ /* Custom Styles and Resets */
83
50
  '.main-banner': { backgroundColor: '#59ce10cc', borderColor: '#bfce10cc' }
84
51
 
85
- /* Color Properties */
52
+ /* backgroundColor Property */
86
53
  '.bg-primary': { backgroundColor: '#ce10cc' }
87
- '.bg-primary/35': { backgroundColor: '#59ce10cc' }
88
- '.border-primary': { borderColor: '#ce10cc' }
89
- '.border-primary/75': { borderColor: '#bfce10cc' }
90
- ```
91
-
92
- ## Complete List of Supported Color Properties
93
-
94
- The opacity modifier works with **ALL** color properties:
95
-
96
- ### Background Properties
97
- - `bg-*` - backgroundColor
98
- - `bg-focused-*` - backgroundFocusedColor
99
- - `bg-selected-*` - backgroundSelectedColor
100
- - `from-*` - backgroundGradient (start)
101
- - `to-*` - backgroundGradient (end)
102
-
103
- ### Text Properties
104
- - `text-*` - color / textColor
105
- - `title-*` - titleColor / titleTextColor
106
- - `subtitle-*` - subtitleColor / subtitleTextColor
107
- - `placeholder-*` - hintTextColor
108
-
109
- ### Border Properties
110
- - `border-*` - borderColor
111
- - `separator-*` - separatorColor
112
- - `bar-*` - barColor
113
-
114
- ### UI Element Properties
115
- - `badge-*` - badgeColor
116
- - `disabled-*` - disabledColor
117
- - `highlighted-*` - highlightedColor
118
- - `selected-*` - selectedColor
119
- - `selected-button-*` - selectedButtonColor
120
- - `selected-subtitle-*` - selectedSubtitleColor
121
- - `selected-text-*` - selectedTextColor
122
-
123
- ### Navigation Properties
124
- - `nav-tint-*` - navTintColor
125
- - `active-tint-*` - activeTintColor
126
- - `on-tint-*` - onTintColor
127
- - `thumb-tint-*` - thumbTintColor
128
- - `track-tint-*` - trackTintColor
129
-
130
- ### Indicator Properties
131
- - `indicator-*` - indicatorColor
132
- - `current-page-indicator-*` - currentPageIndicatorColor
133
- - `page-indicator-*` - pageIndicatorColor
134
- - `paging-control-*` - pagingControlColor
135
-
136
- ### Tint Properties
137
- - `tint-*` - tintColor
138
- - `shadow-*` - shadowColor / viewShadowColor
139
- - `drop-shadow-*` - dropShadow color
140
-
141
- ### Miscellaneous Properties
142
- - `active-title-*` - activeTitleColor
143
- - `date-time-*` - dateTimeColor
144
- - `image-touch-feedback-*` - imageTouchFeedbackColor
145
- - `keyboard-toolbar-*` - keyboardToolbarColor
146
- - `light-*` - lightColor
147
- - `navigation-icon-*` - navigationIconColor
148
- - `pull-bg-*` - pullBackgroundColor
149
- - `results-bg-*` - resultsBackgroundColor
150
- - `results-separator-*` - resultsSeparatorColor
151
- - `tabs-bg-*` - tabsBackgroundColor
152
- - `tabs-bg-selected-*` - tabsBackgroundSelectedColor
153
- - `title-attributes-*` - titleAttributes color
154
- - `title-attributes-shadow-*` - titleAttributes shadow color
155
- - `touch-feedback-*` - touchFeedbackColor
156
-
157
- ## Opacity Value Reference
158
-
159
- | Opacity Value | Decimal | Hex Alpha | Result |
160
- | ------------- | ------- | --------- | ----------------- |
161
- | `/0` | 0.00 | `00` | Fully transparent |
162
- | `/10` | 0.10 | `1A` | 10% visible |
163
- | `/20` | 0.20 | `33` | 20% visible |
164
- | `/25` | 0.25 | `40` | 25% visible |
165
- | `/30` | 0.30 | `4D` | 30% visible |
166
- | `/40` | 0.40 | `66` | 40% visible |
167
- | `/50` | 0.50 | `80` | 50% visible |
168
- | `/60` | 0.60 | `99` | 60% visible |
169
- | `/70` | 0.70 | `B3` | 70% visible |
170
- | `/75` | 0.75 | `BF` | 75% visible |
171
- | `/80` | 0.80 | `CC` | 80% visible |
172
- | `/90` | 0.90 | `E6` | 90% visible |
173
- | `/95` | 0.95 | `F2` | 95% visible |
174
- | `/100` | 1.00 | `FF` | Fully opaque |
175
-
176
- ## Common Patterns
177
-
178
- ### Hover/Active States
179
-
180
- ```xml
181
- <Button class="bg-brand-500 active:bg-brand-600/80" />
182
- ```
183
-
184
- ### Disabled Appearance
185
-
186
- ```xml
187
- <Label class="text-gray-800 disabled:text-gray-400/50" />
188
- ```
189
-
190
- ### Overlay/Backdrop
191
-
192
- ```xml
193
- <!-- Semi-transparent overlay -->
194
- <View class="absolute inset-0 bg-black/50" />
195
54
  ```
196
55
 
197
- ### Glassmorphism Effect
198
-
199
- ```xml
200
- <View class="border-white/30 bg-white/20 backdrop-blur-md" />
201
- ```
202
-
203
- ### Gradient Fades
204
-
205
- ```xml
206
- <View class="from-brand-500/100 to-brand-500/0" />
207
- ```
208
-
209
- ## Limitations
210
-
211
- :::caution Semantic Colors Cannot Use Opacity Modifier
212
-
213
- Semantic colors (defined as objects with light/dark values) cannot be modified with the opacity modifier because they are defined as an object with light and dark values, not as a single color value.
214
-
215
- **This won't work:**
216
- ```javascript
217
- // In config.cjs
218
- colors: {
219
- semantic: {
220
- light: '#ffffff',
221
- dark: '#000000'
222
- }
223
- }
224
- ```
225
-
226
- ```xml
227
- <!-- This will NOT work -->
228
- <View class="bg-semantic/50" />
229
- ```
230
-
231
- **Solution:** Use standard color scales instead:
232
- ```javascript
233
- colors: {
234
- semantic: '#888888'
235
- }
236
- ```
237
-
238
- ```xml
239
- <!-- This WILL work -->
240
- <View class="bg-semantic/50" />
241
- ```
242
- :::
243
-
244
- ## Performance Considerations
245
-
246
- Using opacity modifiers is as performant as regular color classes since the conversion happens at build time, not runtime. The generated `app.tss` contains the final hex values with alpha channels.
247
-
248
- ## Combining with Arbitrary Colors
249
-
250
- You can combine opacity modifiers with arbitrary color values:
251
-
252
- ```xml
253
- <View class="bg-(#4C61E4)/50" />
254
- <Label class="text-(rgba(255,0,0,0.5))" />
255
- ```
56
+ > **CAUTION -- Semantic Colors**
57
+ > Semantic colors cannot be modified with the opacity modifier because they are defined as an object with light and dark values.
256
58
 
257
- Note: When using `rgba()` directly, the opacity modifier is redundant since `rgba()` already includes alpha.
59
+ > **Gradients**
60
+ > The same modifier logic applies to color-based gradient utilities such as `from-*` and `to-*`. When you define custom `backgroundGradient.colors` arrays of `{ color, offset }` objects in `config.cjs`, PurgeTSS v7.4.0 correctly serializes those nested objects in `utilities.tss`.
@@ -141,14 +141,14 @@ setInterval(() => {
141
141
 
142
142
  ```xml
143
143
  <Animation id="slideIn" module="purgetss.ui"
144
- class="close:translate-x-full duration-300 open:translate-x-0" />
144
+ class="close:opacity-0 open:opacity-100 duration-300" />
145
145
  ```
146
146
 
147
147
  ### Hardware-Accelerated Properties
148
148
 
149
149
  Fast (GPU-accelerated):
150
150
  - `opacity` — use for fade effects
151
- - `transform` (translate, scale, rotate)
151
+ - `transform` (`scale`, `rotate`)
152
152
 
153
153
  Slow (triggers layout recalculation):
154
154
  - `width`, `height`