purgetss 3.0.3 → 3.0.4

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 CHANGED
@@ -22,17 +22,18 @@
22
22
  - Provides more than 6000 [Tailwind-like utility classes](https://tailwindcss.com/) ready to use in your projects.
23
23
  - Creates a clean `app.tss` file with only the classes used in your project by parsing all your XML files.
24
24
  - You can customize any of the default classes through a simple configuration file, or you can create new *just-in-time* classes with arbitrary values within the `Views`.
25
- - You can easily use Font Awesome, Material Design, Lineicons, Boxicons and Framework7-Icons fonts in `Buttons` and `Labels`.
25
+ - You can easily use Font Awesome, Material Design, Lineicons, Boxicons, Tabler Icons and Framework7-Icons fonts in `Buttons` and `Labels`.
26
26
  - Includes an Animation module to apply a 2D Matrix animation or transformation to any element or to an `Array` of elements.
27
27
  - Includes a simple two-dimensional Grid System to align and distribute elements in your views.
28
28
 
29
29
  ## List of available classes
30
30
  - [tailwind.tss](https://github.com/macCesar/purgeTSS/blob/master/dist/tailwind.tss)
31
- - [lineicons.tss](https://github.com/macCesar/purgeTSS/blob/master/dist/lineicons.tss)
32
31
  - [boxicons.tss](https://github.com/macCesar/purgeTSS/blob/master/dist/boxicons.tss)
33
32
  - [fontawesome.tss](https://github.com/macCesar/purgeTSS/blob/master/dist/fontawesome.tss)
34
33
  - [framework7icons.tss](https://github.com/macCesar/purgeTSS/blob/master/dist/framework7icons.tss)
34
+ - [lineicons.tss](https://github.com/macCesar/purgeTSS/blob/master/dist/lineicons.tss)
35
35
  - [materialdesignicons.tss](https://github.com/macCesar/purgeTSS/blob/master/dist/materialdesignicons.tss)
36
+ - [tablericons.tss](https://github.com/macCesar/purgeTSS/blob/master/dist/tablericons.tss)
36
37
  - [Your own custom styles](https://github.com/macCesar/purgeTSS/blob/master/docs/configuring-guide.md)
37
38
 
38
39
  # IMPORTANT NOTICE!!!
@@ -205,6 +206,7 @@ You can customize the following properties:
205
206
  - Opacity
206
207
  - Padding
207
208
  - Placeholder Colors
209
+ - Shadow Colors
208
210
  - Text Colors
209
211
  - Tint Color
210
212
  - Width scale
@@ -268,7 +270,7 @@ Use **`purgetss module`** command to install the `purgetss.ui.js` module in your
268
270
  If you want to create a new Alloy Project with `purgetss` ready to go, use the `create` command.
269
271
 
270
272
  ```bash
271
- > purgetss create 'Name of the Project' [--vendor="fontawesome, materialdesign, lineicons, boxicons, framework7"]
273
+ > purgetss create 'Name of the Project' [--vendor="fontawesome, materialdesign, lineicons, boxicons, framework7, tablericons"]
272
274
 
273
275
  # alias:
274
276
  > purgetss c 'Name of the Project' [-v=fa,md,li,bx,f7]
@@ -309,7 +311,7 @@ When you run `purgetss create 'Name of the Project'` it will execute the followi
309
311
  > purgetss f
310
312
  ```
311
313
 
312
- Use this command to copy the free versions of [Font Awesome](https://github.com/FortAwesome/Font-Awesome/tree/master/js-packages/%40fortawesome/fontawesome-free/webfonts), [Material Design Icons](https://github.com/google/material-design-icons), [LineIcons](https://lineicons.com/icons/?type=free), [Boxicons](https://boxicons.com) and [Framework7 Icons](https://framework7.io/icons/) fonts into your `app/assets/fonts` folder. With their names fixed to work in iOS or Android.
314
+ Use this command to copy the free versions of [Boxicons](https://boxicons.com), [Font Awesome](https://github.com/FortAwesome/Font-Awesome/tree/master/js-packages/%40fortawesome/fontawesome-free/webfonts), [Framework7 Icons](https://framework7.io/icons/), [LineIcons](https://lineicons.com/icons/?type=free), [Material Design Icons](https://github.com/google/material-design-icons) and [Tabler Icons](https://tabler-icons.io) Fonts into your `app/assets/fonts` folder. With their names fixed to work in iOS or Android.
313
315
 
314
316
  > boxicons.ttf
315
317
  >
@@ -323,6 +325,8 @@ Use this command to copy the free versions of [Font Awesome](https://github.com/
323
325
  >
324
326
  > LineIcons.ttf
325
327
  >
328
+ > tablericons.ttf
329
+ >
326
330
  > MaterialIcons-Regular.ttf
327
331
  >
328
332
  > MaterialIconsOutlined-Regular.otf
@@ -373,6 +377,11 @@ After copying the desired fonts, you can use them in Buttons and Labels, just se
373
377
  <Label class="mt-2 text-gray-700" text="Framework7-Icons" />
374
378
  <Label class="text-xl text-blue-500 f7 f7-house" />
375
379
  <Button class="w-10 h-10 my-1 text-xl text-white bg-blue-500 rounded f7 f7-house" />
380
+
381
+ <!-- Tabler-Icons -->
382
+ <Label class="mt-2 text-gray-700" text="Tabler-Icons" />
383
+ <Label class="text-xl text-blue-500 ti ti-home" />
384
+ <Button class="w-10 h-10 my-1 text-xl text-white bg-blue-500 rounded ti ti-home" />
376
385
  </View>
377
386
  </Window>
378
387
  </Alloy>
@@ -418,19 +427,23 @@ After copying the desired fonts, you can use them in Buttons and Labels, just se
418
427
  // Framework7 styles
419
428
  '.f7': { font: { fontFamily: 'Framework7-Icons' } }
420
429
  '.f7-house': { text: 'house', title: 'house' }
430
+
431
+ // Tabler Icons styles
432
+ '.ti': { font: { fontFamily: 'tabler-icons' } }
433
+ '.ti-home': { text: '\ueac1', title: '\ueac1' }
421
434
  ```
422
435
 
423
436
  ## Result
424
- <img src="https://raw.githubusercontent.com/macCesar/purgeTSS/master/assets/images/icon-fonts.png" width="375" alt="iOS Screen - Icon Fonts">
437
+ <img src="https://raw.githubusercontent.com/macCesar/purgeTSS/master/assets/images/icon-fonts-tabler.png" width="375" alt="iOS Screen - Icon Fonts">
425
438
 
426
439
  ### Copying specific font vendors
427
440
  Use any of the following arguments to copy specific vendors:
428
441
 
429
442
  ```bash
430
- > purgetss fonts --vendor="fontawesome, materialdesign, lineicons, boxicons, framework7"
443
+ > purgetss fonts --vendor="fontawesome, materialdesign, lineicons, boxicons, framework7, tablericons"
431
444
 
432
445
  # alias:
433
- > purgetss f -v=fa,md,li,bx,f7
446
+ > purgetss f -v=fa,md,li,bx,f7,ti
434
447
  ```
435
448
 
436
449
  Available aliases:
@@ -439,17 +452,18 @@ Available aliases:
439
452
  - fa, font, fontawesome = Font Awesome Icons
440
453
  - md, material, materialdesign = Material Design Icons
441
454
  - f7, framework, framework7 = Framework7 Icons
455
+ - ti, tablericons, tabler = Tabler Icons
442
456
 
443
457
  ### Copying corresponding CommonJS Modules
444
458
  You can use the `--modules` flag to copy the corresponding CommonJS modules into `./app/lib/` folder.
445
459
 
446
460
  ```bash
447
461
  > purgetss fonts --modules
448
- > purgetss fonts --modules --vendor="fontawesome, materialdesign, lineicons, boxicons, framework7"
462
+ > purgetss fonts --modules --vendor="fontawesome, materialdesign, lineicons, boxicons, framework7, tablericons"
449
463
 
450
464
  # alias:
451
465
  > purgetss f -m
452
- > purgetss f -m -v=fa,md,li,bx,f7
466
+ > purgetss f -m -v=fa,md,li,bx,f7,ti
453
467
  ```
454
468
 
455
469
  Each library contains a CommonJS module exposing the UniCode strings for Font Awesome icons, Material Design Icons, Line Icons Boxicons and Framework7-Icons fonts.
@@ -459,6 +473,7 @@ All prefixes are stripped out from their class names and are camelCased, for exa
459
473
  - **Line Icons**: `lni-flag` becomes `flag`
460
474
  - **Font Awesome**: `fa-flag` becomes `flag`
461
475
  - **Material Design Icons**: `md-flag` becomes `flag`
476
+ - **Tabler Icons** `ti-flag` becomes `flag` or `ti-cloud-download` becomes `cloudDownload`.
462
477
  - **Framework7 Icons** `f7-alarm_fill` becomes `alarmFill` or `f7-clock_fill` becomes `clockFill`.
463
478
  - **boxicons** have three sets of icons in the same font file: Regular, Solid and Logos, so we need to keep their prefixes:
464
479
 
package/bin/purgetss CHANGED
@@ -35,7 +35,7 @@ program
35
35
  .alias('c')
36
36
  .description('Creates a new Alloy Project with `purgetss` already configured.')
37
37
  .help('Creates a new Alloy Project with `purgetss` already configured.')
38
- .option('-v, --vendor <arguments>', 'Use any of the following arguments to copy specific vendors:\n fa = Font Awesome Icons\n md = Material Design Icons\n li = LineIcons\n bx = Boxicons\n f7 = Framework7 Icons')
38
+ .option('-v, --vendor <arguments>', 'Use any of the following arguments to copy specific vendors:\n fa = Font Awesome Icons\n md = Material Design Icons\n li = LineIcons\n bx = Boxicons\n f7 = Framework7 Icons\n ti = Tabler Icons')
39
39
  .argument('<name>', 'The name of the project')
40
40
  .action((args, options, logger) => {
41
41
  purgetss.create(args, options);
@@ -64,8 +64,8 @@ program
64
64
  .command('fonts')
65
65
  .alias('f')
66
66
  .description('Copy Font Awesome icons, Material Design Icons, LineIcons, Boxicons and Framework7-Icons Font files into your project')
67
- .help('Command to copy the Free versions of:\n\n • Font Awesome Icons ( Brands, Regular, Solid )\n • Material Design Icons\n • LineIcons\n • Boxicons\n • Framework7 Icons\n\nInto your projects’s app/assets/fonts/ folder.\n\nWith their names fixed to work with your app whether it is for iOS or for Android.')
68
- .option('-v, --vendor <arguments>', 'Use any of the following arguments to copy specific vendors:\n fa = Font Awesome Icons\n md = Material Design Icons\n li = LineIcons\n bx = Boxicons\n f7 = Framework7 Icons')
67
+ .help('Command to copy the Free versions of:\n\n • Font Awesome Icons ( Brands, Regular, Solid )\n • Material Design Icons\n • LineIcons\n • Boxicons\n • Framework7 Icons\n • Tabler Icons\n\nInto your projects’s app/assets/fonts/ folder.\n\nWith their names fixed to work with your app whether it is for iOS or for Android.')
68
+ .option('-v, --vendor <arguments>', 'Use any of the following arguments to copy specific vendors:\n fa = Font Awesome Icons\n md = Material Design Icons\n li = LineIcons\n bx = Boxicons\n f7 = Framework7 Icons\n ti = Tabler Icons')
69
69
  .option('-m, --modules', 'Use the `--modules` option to also copy the corresponding CommonJS module into `./app/lib/` folder.')
70
70
  .action((args, options, logger) => {
71
71
  purgetss.copyFonts(options);
package/dist/boxicons.tss CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  // Font Families
5
5
  '.bx': { font: { fontFamily: 'boxicons' } }
6
+ '.bxi': { font: { fontFamily: 'boxicons' } }
6
7
  '.boxicons': { font: { fontFamily: 'boxicons' } }
7
8
 
8
9
  // Font Sizes
@@ -3,7 +3,7 @@
3
3
 
4
4
  // Font Families
5
5
  '.f7': { font: { fontFamily: 'Framework7-Icons' } }
6
- '.f7-icons': { font: { fontFamily: 'Framework7-Icons' } }
6
+ '.f7i': { font: { fontFamily: 'Framework7-Icons' } }
7
7
  '.framework7': { font: { fontFamily: 'Framework7-Icons' } }
8
8
 
9
9
  // Font Sizes
@@ -2,6 +2,7 @@
2
2
  // License - https://lineicons.com/license/
3
3
 
4
4
  // Font Families
5
+ '.li': { font: { fontFamily: 'LineIcons' } }
5
6
  '.lni': { font: { fontFamily: 'LineIcons' } }
6
7
  '.lineicons': { font: { fontFamily: 'LineIcons' } }
7
8
 
@@ -3,8 +3,8 @@
3
3
 
4
4
  // Font Families
5
5
  '.ti': { font: { fontFamily: 'tabler-icons' } }
6
+ '.tabler': { font: { fontFamily: 'tabler-icons' } }
6
7
  '.tablericons': { font: { fontFamily: 'tabler-icons' } }
7
- '.tabler-icons': { font: { fontFamily: 'tabler-icons' } }
8
8
 
9
9
  // Font Icons
10
10
  // To use tabler-icons in Buttons AND Labels each class sets 'text' and 'title' properties
package/dist/tailwind.tss CHANGED
@@ -1,4 +1,4 @@
1
- // Tailwind CSS v3.0.0: A utility-first CSS framework for rapidly building custom designs. ( https://tailwindcss.com )
1
+ // Tailwind CSS v3.0.7: A utility-first CSS framework for rapidly building custom designs. ( https://tailwindcss.com )
2
2
  // Created by Adam Wathan ( https://twitter.com/adamwathan ).
3
3
 
4
4
  // Custom Styles and Resets
@@ -1477,6 +1477,18 @@
1477
1477
  '.enable-bounce': { disableBounce: false }
1478
1478
  '.disable-bounce': { disableBounce: true }
1479
1479
 
1480
+ // cacheSize Property
1481
+ '.cache-size-1': { cacheSize: 1 }
1482
+ '.cache-size-2': { cacheSize: 2 }
1483
+ '.cache-size-3': { cacheSize: 3 }
1484
+ '.cache-size-4': { cacheSize: 4 }
1485
+ '.cache-size-5': { cacheSize: 5 }
1486
+ '.cache-size-6': { cacheSize: 6 }
1487
+ '.cache-size-7': { cacheSize: 7 }
1488
+ '.cache-size-8': { cacheSize: 8 }
1489
+ '.cache-size-9': { cacheSize: 9 }
1490
+ '.cache-size-10': { cacheSize: 10 }
1491
+
1480
1492
  // clipMode Property
1481
1493
  '.clip-enabled[platform=ios]': { clipMode: Ti.UI.iOS.CLIP_MODE_ENABLED }
1482
1494
  '.clip-disabled[platform=ios]': { clipMode: Ti.UI.iOS.CLIP_MODE_DISABLED }
@@ -2663,6 +2675,16 @@
2663
2675
  '.bg-linear-to-l': { backgroundGradient: { type: 'linear', startPoint: { x: '0%', y: '0%' }, endPoint: { x: '100%', y: '0%' }, backfillStart: true } }
2664
2676
  '.bg-linear-to-tl': { backgroundGradient: { type: 'linear', startPoint: { x: '0%', y: '0%' }, endPoint: { x: '100%', y: '100%' }, backfillStart: true } }
2665
2677
 
2678
+ '.bg-gradient': { backgroundGradient: { type: 'linear', startPoint: { x: '50%', y: '100%' }, endPoint: { x: '50%', y: '0%' }, backfillStart: true } }
2679
+ '.bg-gradient-to-t': { backgroundGradient: { type: 'linear', startPoint: { x: '0%', y: '0%' }, endPoint: { x: '0%', y: '100%' }, backfillStart: true } }
2680
+ '.bg-gradient-to-tr': { backgroundGradient: { type: 'linear', startPoint: { x: '100%', y: '0%' }, endPoint: { x: '0%', y: '100%' }, backfillStart: true } }
2681
+ '.bg-gradient-to-r': { backgroundGradient: { type: 'linear', startPoint: { x: '100%', y: '0%' }, endPoint: { x: '0%', y: '0%' }, backfillStart: true } }
2682
+ '.bg-gradient-to-br': { backgroundGradient: { type: 'linear', startPoint: { x: '100%', y: '100%' }, endPoint: { x: '0%', y: '0%' }, backfillStart: true } }
2683
+ '.bg-gradient-to-b': { backgroundGradient: { type: 'linear', startPoint: { x: '100%', y: '100%' }, endPoint: { x: '100%', y: '0%' }, backfillStart: true } }
2684
+ '.bg-gradient-to-bl': { backgroundGradient: { type: 'linear', startPoint: { x: '0%', y: '100%' }, endPoint: { x: '100%', y: '0%' }, backfillStart: true } }
2685
+ '.bg-gradient-to-l': { backgroundGradient: { type: 'linear', startPoint: { x: '0%', y: '0%' }, endPoint: { x: '100%', y: '0%' }, backfillStart: true } }
2686
+ '.bg-gradient-to-tl': { backgroundGradient: { type: 'linear', startPoint: { x: '0%', y: '0%' }, endPoint: { x: '100%', y: '100%' }, backfillStart: true } }
2687
+
2666
2688
  // Margin Property
2667
2689
  '.m-0': { top: 0, right: 0, bottom: 0, left: 0 }
2668
2690
  '.m-1': { top: 4, right: 4, bottom: 4, left: 4 }
@@ -1,6 +1,6 @@
1
1
  # What's new in v2.5.0
2
2
  - [What's new in v2.5.0](#whats-new-in-v250)
3
- - [Breaking changes & new utilities](#braking-changes--new-utilities)
3
+ - [Breaking changes & new utilities](#breaking-changes--new-utilities)
4
4
  - [Grid System](#grid-system)
5
5
  - [Column grid](#column-grid)
6
6
  - [Row grid](#row-grid)
@@ -216,10 +216,10 @@ You can create more complex animations by combining properties to different `sta
216
216
  <Window class="keep-screen-on">
217
217
  <View class="vertical">
218
218
  <Button class="w-48 mt-1 bg-purple-500 rounded ios:mt-16 text-purple-50" ios:onSingletap="do3Squares" android:onClick="do3Squares" title="3 Squares"/>
219
- <Button class="w-48 mt-1 mt-2 bg-purple-500 rounded text-purple-50" ios:onSingletap="doChangeColors" android:onClick="doChangeColors" title="Toggle Colors"/>
220
- <Button class="w-48 mt-1 mt-2 bg-purple-500 rounded text-purple-50" ios:onSingletap="doRetweet" android:onClick="doRetweet" title="Toggle Re-Tweet"/>
219
+ <Button class="w-48 mt-2 bg-purple-500 rounded text-purple-50" ios:onSingletap="doChangeColors" android:onClick="doChangeColors" title="Toggle Colors"/>
220
+ <Button class="w-48 mt-2 bg-purple-500 rounded text-purple-50" ios:onSingletap="doRetweet" android:onClick="doRetweet" title="Toggle Re-Tweet"/>
221
221
 
222
- <View id="squares" class="w-screen mt-1 mt-10 vertical">
222
+ <View id="squares" class="w-screen mt-10 vertical">
223
223
  <View id="aquare1" class="bg-blue-700 w-28 h-28 rounded-xl" />
224
224
  <View id="aquare2" class="mt-4 bg-blue-700 w-28 h-28 rounded-xl" />
225
225
  <View id="aquare3" class="mt-4 bg-blue-700 w-28 h-28 rounded-xl" />
@@ -229,15 +229,15 @@ You can create more complex animations by combining properties to different `sta
229
229
  <View id="square3" class="mt-8 bg-blue-500 w-14 h-14 rounded-xl" ios:onSingletap="doTransparency" android:onClick="doTransparency" />
230
230
 
231
231
  <View id="retweetView" class="w-screen h-48 bg-gray-800 vertical -mb-52 rounded-2xl" ios:onSingletap="doRetweet" android:onClick="doRetweet">
232
- <View class="w-8 h-1 mt-4 bg-blueGray-700" />
232
+ <View class="w-8 h-1 mt-4 bg-slate-700" />
233
233
 
234
234
  <View class="mx-4 mt-4 horizontal">
235
- <Label class="text-xl text-blueGray-500 fas fa-retweet w-7" />
235
+ <Label class="text-xl text-slate-500 fas fa-retweet w-7" />
236
236
  <Label class="ml-2 text-xl text-left text-white" text="Re-Tweet" />
237
237
  </View>
238
238
 
239
239
  <View class="mx-4 mt-4 horizontal">
240
- <Label class="text-xl text-blueGray-500 fas fa-pencil-alt w-7" />
240
+ <Label class="text-xl text-slate-500 fas fa-pencil-alt w-7" />
241
241
  <Label class="ml-2 text-xl text-left text-white" text="Quote Tweet" />
242
242
  </View>
243
243
  </View>
@@ -0,0 +1,33 @@
1
+ # What's new in v3.0.0
2
+ - [What's new in v3.0.0](#whats-new-in-v300)
3
+ - [PurgeTSS now uses Tailwind CSS v3.0.0](#purgetss-now-uses-tailwind-css-v300)
4
+ - [tailwindUI plug-in is no longer required](#tailwindui-plug-in-is-no-longer-required)
5
+ - [Future plans](#future-plans)
6
+
7
+ ## PurgeTSS now uses Tailwind CSS v3.0.0
8
+ With the release of [Tailwind CSS v3.0](https://tailwindcss.com/blog/tailwindcss-v3), PurgeTSS now uses the revamped colors like cyan, rose, fuchsia, and lime. Check out the [color palette reference](https://tailwindcss.com/docs/customizing-colors) to learn more.
9
+
10
+ ## tailwindUI plug-in is no longer required
11
+ Because of this, there are some minor breaking changes:
12
+
13
+ - These colors are no longer available: lightBlue, warmGray, trueGray, coolGray and blueGray. They are replaced with: sky, stone, neutral, gray and slate respectively.
14
+ - Two spacing values are removed: `spacing.13` and `spacing.15`, which means styles for Heights, Widths, Margins and Paddings like `w-13` , `h-13`, `m-15` or `p-15` ( and any other variant like `mt-13` or `px-13` ) are no longer generated.
15
+ - You can always extend the `spacing` key in the theme section of your `purgetss/config.js` file to add the missing values:
16
+
17
+ ```js
18
+ module.exports = {
19
+ theme: {
20
+ extend: {
21
+ spacing: {
22
+ '13': '3.25rem',
23
+ '15': '3.75rem',
24
+ }
25
+ }
26
+ }
27
+ }
28
+ ```
29
+
30
+ ## Future plans
31
+ In future updates, we will be adding some of the new styles of TW 3, like [**Box Shadow Color**](https://tailwindcss.com/docs/box-shadow-color).
32
+
33
+ And we will try to match even more Titanium properties.
@@ -8,7 +8,7 @@
8
8
  - [Set arbitrary values to shadow colors](#set-arbitrary-values-to-shadow-colors)
9
9
 
10
10
  ## Even faster purging time
11
- **Up to 2.5 faster than v 2!** On a project with more than 100 XML files, purging time was reduced from 350 ms down to 140 ms.
11
+ **Up to 2.5 faster than [v 2.6.0](https://github.com/macCesar/purgeTSS/blob/master/docs/whats-new/v2.6.0.md#reduced-purge-time)!** On a project with more than 100 XML files, purging time was reduced from 350 ms down to 140 ms.
12
12
 
13
13
  ## Tabler Icons Font
14
14
  A set of over 1400 free MIT-licensed [high-quality icons](https://tabler-icons.io) for you to use in your projects.
@@ -25,7 +25,7 @@ A set of over 1400 free MIT-licensed [high-quality icons](https://tabler-icons.i
25
25
  // ...
26
26
  ```
27
27
 
28
- [<img src="https://raw.githubusercontent.com/tabler/tabler-icons/master/.github/icons.png">](https://github.com/tabler/tabler-icons#preview)
28
+ [<img src="https://raw.githubusercontent.com/tabler/tabler-icons/master/.github/og.png">](https://github.com/tabler/tabler-icons#preview)
29
29
 
30
30
  ## Shadow Color Property
31
31
  Continiuing with the new properties from Tailwind CSS v3.0.0, the shadow color property is now available for all Ti components.
@@ -61,13 +61,13 @@ You can also set arbitrary values to shadow colors, by adding `shadow-(hex-rgb-o
61
61
  ```xml
62
62
  <View class="w-16 h-16 bg-white shadow-lg rounded-2xl shadow-(#ce10cc)" />
63
63
 
64
- <View class="w-16 h-16 bg-white shadow-lg rounded-2xl shadow-(rgba(120,200,250,0.5)" />
64
+ <View class="w-16 h-16 bg-white shadow-lg rounded-2xl shadow-(rgba(120,200,250,0.5))" />
65
65
  ```
66
66
 
67
67
  ```css
68
68
  // ...
69
69
  // Styles with arbitrary values
70
70
  '.shadow-(#ce10cc)': { viewShadowColor: '#ce10cc' }
71
- '.shadow-(rgba(120,200,250,0.5)': { viewShadowColor: 'rgba(120,200,250,0.5' }
71
+ '.shadow-(rgba(120,200,250,0.5))': { viewShadowColor: 'rgba(120,200,250,0.5' }
72
72
  // ...
73
73
  ```
@@ -0,0 +1,243 @@
1
+ # What's new in v3.0.4
2
+ - [What's new in v3.0.4](#whats-new-in-v304)
3
+ - [More properties with arbitrary values](#more-properties-with-arbitrary-values)
4
+ - [List of all Color Properties](#list-of-all-color-properties)
5
+ - [List of Size or Dimension Properties](#list-of-size-or-dimension-properties)
6
+ - [Other Properties](#other-properties)
7
+ - [Color opacity modifiers](#color-opacity-modifiers)
8
+ - [In your XML files](#in-your-xml-files)
9
+ - [In the `apply` directive](#in-the-apply-directive)
10
+ - [List of color properties whose opacity can be adjusted](#list-of-color-properties-whose-opacity-can-be-adjusted)
11
+
12
+ ## More properties with arbitrary values
13
+ Now you can set arbitrary color values **to ALL available color properties**, using `hex`, `rgb` or `rgba` color values.
14
+
15
+ You can set them directly in your `xml` files or in your `config.js` file.
16
+
17
+ ```xml
18
+ <Alloy>
19
+ <Window class="from-(#243c5a) to-(#80243c5a)">
20
+ <Label class="text-center w-11/12 h-16 bg-(rgba(100,200,50,0.5)) text-(rgb(100,200,50))" text="Green Label" />
21
+ </Window>
22
+ </Alloy>
23
+ ```
24
+
25
+ ```css
26
+ // Tailwind styles
27
+ 'Window': { backgroundColor: '#ffffff' }
28
+ '.h-16': { height: 64 }
29
+ '.text-center': { textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER }
30
+ '.w-11/12': { width: '91.666667%' }
31
+
32
+ // Styles with arbitrary values
33
+ '.bg-(rgba(100,200,50,0.5))': { backgroundColor: 'rgba(100,200,50,0.5)' }
34
+ '.from-(#243c5a)': { backgroundGradient: { colors: [ '#00243c5a', '#243c5a' ] } }
35
+ '.text-(rgb(100,200,50))': { color: 'rgb(100,200,50)' }
36
+ '.to-(#80243c5a)': { backgroundGradient: { colors: [ '#80243c5a' ] } }
37
+ ```
38
+
39
+ ### List of all Color Properties
40
+ - **Active Tint Color**
41
+ - active-tint-(*`hex-rgb-or-rgba-value`*)
42
+ - **Active Title Color**
43
+ - active-title-(*`hex-rgb-or-rgba-value`*)
44
+ - **Background Color**
45
+ - bg-(*`hex-rgb-or-rgba-value`*)
46
+ - **Background Gradient**
47
+ - from-(*`hex-rgb-or-rgba-value`*)
48
+ - to-(*`hex-rgb-or-rgba-value`*)
49
+ - **Background Selected Color**
50
+ - bg-selected-(*`hex-rgb-or-rgba-value`*)
51
+ - **Bar Color**
52
+ - bar-(*`hex-rgb-or-rgba-value`*)
53
+ - **Border Color**
54
+ - border-color-(*`hex-rgb-or-rgba-value`*)
55
+ - **Color**
56
+ - text-color-(*`hex-rgb-or-rgba-value`*)
57
+ - **Current Page Indicator Color**
58
+ - current-page-(*`hex-rgb-or-rgba-value`*)
59
+ - **Hint Text Color**
60
+ - placeholder-(*`hex-rgb-or-rgba-value`*)
61
+ - **Nav Tint Color**
62
+ - nav-tint-(*`hex-rgb-or-rgba-value`*)
63
+ - **Page Indicator Color**
64
+ - page-(*`hex-rgb-or-rgba-value`*)
65
+ - **Paging Control Color**
66
+ - paging-(*`hex-rgb-or-rgba-value`*)
67
+ - **Tabs Background Color**
68
+ - tabs-bg-(*`hex-rgb-or-rgba-value`*)
69
+ - **Tint Color**
70
+ - tint-(*`hex-rgb-or-rgba-value`*)
71
+ - **Title Color**
72
+ - title-(*`hex-rgb-or-rgba-value`*)
73
+ - **Touch Feedback Color**
74
+ - feedback-(*`hex-rgb-or-rgba-value`*)
75
+ - **View Shadow Color**
76
+ - shadow-(*`hex-rgb-or-rgba-value`*)
77
+
78
+ ### List of Size or Dimension Properties
79
+ - **Border Width**
80
+ - border-width-(*`any-size-value-and-unit`*)
81
+ - **Content Height**
82
+ - content-h-(*`any-size-value-and-unit`*)
83
+ - **Content Width**
84
+ - content-w-(*`any-size-value-and-unit`*)
85
+ - **Content Width & Content Height**
86
+ - content-(*`any-size-value-and-unit`*)
87
+ - **Font Size**
88
+ - text-size-(*`any-size-value-and-unit`*)
89
+ - **Height**
90
+ - grid-rows-(*`any-size-value-and-unit`*)
91
+ - h-(*`any-size-value-and-unit`*)
92
+ - **Width**
93
+ - grid-cols-(*`any-size-value-and-unit`*)
94
+ - w-(*`any-size-value-and-unit`*)
95
+ - **Top**
96
+ - mt-(*`any-size-value-and-unit`*)
97
+ - top-(*`any-size-value-and-unit`*)
98
+ - **Right**
99
+ - mr-(*`any-size-value-and-unit`*)
100
+ - right-(*`any-size-value-and-unit`*)
101
+ - **Bottom**
102
+ - bottom-(*`any-size-value-and-unit`*)
103
+ - mb-(*`any-size-value-and-unit`*)
104
+ - **Left**
105
+ - left-(*`any-size-value-and-unit`*)
106
+ - ml-(*`any-size-value-and-unit`*)
107
+ - **Top and Bottom**
108
+ - my-(*`any-size-value-and-unit`*)
109
+ - **Left and Right**
110
+ - mx-(*`any-size-value-and-unit`*)
111
+ - **Top, Right, Bottom, Left**
112
+ - m-(*`any-size-value-and-unit`*)
113
+ - **Padding Top**
114
+ - pt-(*`any-size-value-and-unit`*)
115
+ - **Padding Right**
116
+ - pr-(*`any-size-value-and-unit`*)
117
+ - **Padding Bottom**
118
+ - pb-(*`any-size-value-and-unit`*)
119
+ - **Padding Left**
120
+ - pl-(*`any-size-value-and-unit`*)
121
+ - **Padding Top and Bottom**
122
+ - py-(*`any-size-value-and-unit`*)
123
+ - **Padding Left and Right**
124
+ - px-(*`any-size-value-and-unit`*)
125
+ - **Padding Top, Right, Bottom and Left**
126
+ - p-(*`any-size-value-and-unit`*)
127
+
128
+ ### Other Properties
129
+ - **Anchor Point**
130
+ - origin-(*`x-and-y-coordinates`*)
131
+ - **Border Radius**
132
+ - rounded-(*`number-value`*)
133
+ - **Cache Size**
134
+ - cache-size-(*`number-value`*)
135
+ - **Delay**
136
+ - delay-(*`number-value`*)
137
+ - **Duration**
138
+ - duration-(*`number-value`*)
139
+ - **Font Weight**
140
+ - font-(*`valid-font-font-weight-value`*)
141
+ - **Max Zoom Scale**
142
+ - max-scale-(*`number-value`*)
143
+ - **Min Zoom Scale**
144
+ - min-scale-(*`number-value`*)
145
+ - **Opacity**
146
+ - opacity-(*`number-value`*)
147
+ - **Paging Control Alpha**
148
+ - paging-(*`alpha-value-from-0-to-1`*)
149
+ - **Repeat**
150
+ - repeat-(*`number-value`*)
151
+ - **Rotate**
152
+ - rotate-(*`number-value`*)
153
+
154
+
155
+ ## Color opacity modifiers
156
+ Now you can add a **color 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 with a slash.
157
+
158
+ ### In your XML files
159
+
160
+ ```xml
161
+ <Label class="w-11/12 h-8 text-center bg-sky-500/50 text-purple-900/75">My Button</Label>
162
+ ```
163
+
164
+ ```css
165
+ // Tailwind styles
166
+ 'Window': { backgroundColor: '#ffffff' }
167
+ '.h-8': { height: 32 }
168
+ '.text-center': { textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER }
169
+ '.w-11/12': { width: '91.666667%' }
170
+
171
+ // Styles with color opacity modifiers
172
+ '.bg-sky-500/50': { backgroundColor: '#800ea5e9' }
173
+ '.text-purple-900/75': { color: '#bf581c87' }
174
+ ```
175
+
176
+ ### In the `apply` directive
177
+ You can also use color opacity modifiers in the `apply` directive in your `config.js` file.
178
+
179
+ ```js
180
+ module.exports = {
181
+ theme: {
182
+ extend: {
183
+ colors: {
184
+ primary: '#ce10cc'
185
+ }
186
+ },
187
+ '.main-banner': {
188
+ apply: [
189
+ 'bg-primary/35',
190
+ 'border-primary/75'
191
+ ]
192
+ }
193
+ }
194
+ }
195
+ ```
196
+
197
+
198
+ ```css
199
+ // Custom Styles and Resets
200
+ '.main-banner': { backgroundColor: '#59ce10cc', borderColor: '#bfce10cc' }
201
+
202
+ // backgroundColor Property
203
+ '.bg-primary': { backgroundColor: '#ce10cc' }
204
+ ```
205
+
206
+ ### List of color properties whose opacity can be adjusted
207
+
208
+ - **Active Tint Color**
209
+ - active-tint-{color}/opacity-value
210
+ - **Active Title Color**
211
+ - active-title-{color}/opacity-value
212
+ - **Background Color**
213
+ - bg-{color}/opacity-value
214
+ - **Background Gradient**
215
+ - from-{color}/opacity-value
216
+ - to-{color}/opacity-value
217
+ - **Background Selected Color**
218
+ - bg-selected-{color}/opacity-value
219
+ - **Bar Color**
220
+ - bar-{color}/opacity-value
221
+ - **Border Color**
222
+ - border-{color}/opacity-value
223
+ - **Color**
224
+ - text-{color}/opacity-value
225
+ - **Current Page Indicator Color**
226
+ - current-page-{color}/opacity-value
227
+ - **Hint Text Color**
228
+ - placeholder-{color}/opacity-value
229
+ - **Nav Tint Color**
230
+ - nav-tint-{color}/opacity-value
231
+ - **Page Indicator Color**
232
+ - page-{color}/opacity-value
233
+ - **Paging Control Color**
234
+ - paging-{color}/opacity-value
235
+ - **Tabs Background Color**
236
+ - tabs-bg-{color}/opacity-value
237
+ - **Tint Color**
238
+ - tint-{color}/opacity-value
239
+ - title-{color}/opacity-value
240
+ - **Touch Feedback Color**
241
+ - feedback-{color}/opacity-value
242
+ - **View Shadow Color**
243
+ - shadow-{color}/opacity-value
package/index.js CHANGED
@@ -779,6 +779,8 @@ function buildCustomTailwind(message = 'file created!') {
779
779
 
780
780
  configFile.theme.currentPageIndicatorColor = combineKeys(configFile.theme, base.colors, 'currentPageIndicatorColor', true);
781
781
 
782
+ configFile.theme.cacheSize = {};
783
+
782
784
  // pagingControlHeight
783
785
  delete base.height['fit'];
784
786
  delete base.height['max'];
@@ -998,6 +1000,7 @@ function buildCustomTailwindClasses(key, value) {
998
1000
  case 'autocapitalization': return helpers.autocapitalization();
999
1001
  case 'autoLink': return helpers.autoLink();
1000
1002
  case 'borderStyle': return helpers.borderStyle();
1003
+ case 'cacheSize': return helpers.cacheSize();
1001
1004
  case 'editable': return helpers.editable();
1002
1005
  case 'ellipsize': return helpers.ellipsize();
1003
1006
  case 'enableCopy': return helpers.enableCopy();
@@ -1222,8 +1225,8 @@ function purgeTailwind(uniqueClasses) {
1222
1225
 
1223
1226
  (fs.existsSync(customTailwindFile)) ? logger.info('Purging', chalk.yellow('Custom Tailwind'), 'styles...') : logger.info('Purging Default Tailwind styles...');
1224
1227
 
1225
- let opacityValues = [];
1226
1228
  let cleanUniqueClasses = [];
1229
+ let classesWithOpacityValues = [];
1227
1230
  let arbitraryValues = '\n// Styles with arbitrary values\n';
1228
1231
 
1229
1232
  uniqueClasses.forEach((className, index) => {
@@ -1232,13 +1235,14 @@ function purgeTailwind(uniqueClasses) {
1232
1235
  if (cleanClassName.includes('(')) {
1233
1236
  let line = formatArbitraryValues(cleanClassName);
1234
1237
  if (line) arbitraryValues += helpers.checkPlatformAndDevice(line, className);
1235
- } else if (cleanClassName.includes('shadow-') && cleanClassName.includes('/')) {
1238
+ } else if (helpers.checkColorClasses(cleanClassName)) {
1239
+ // Set opacity to color properties
1236
1240
  let decimalValue = cleanClassName.split('/')[1];
1237
1241
  let transparency = Math.round(decimalValue * 255 / 100).toString(16);
1238
1242
  if (transparency.length === 1) transparency = '0' + transparency;
1239
- let originalClass = uniqueClasses[index];
1243
+ let classNameWithTransparency = uniqueClasses[index];
1240
1244
  let className = cleanClassName.substring(0, cleanClassName.lastIndexOf('/'));
1241
- opacityValues.push({ decimalValue, transparency, originalClass, className });
1245
+ classesWithOpacityValues.push({ decimalValue, transparency, className, classNameWithTransparency });
1242
1246
  } else {
1243
1247
  cleanUniqueClasses.push(className);
1244
1248
  }
@@ -1294,19 +1298,25 @@ function purgeTailwind(uniqueClasses) {
1294
1298
  }
1295
1299
  });
1296
1300
 
1297
- // add opacity values
1298
- if (opacityValues.length > 0) {
1299
- purgedClasses += '\n// Shadow Colors with opacity values\n';
1300
- opacityValues.forEach(opacityValue => {
1301
- let opacityIndex = _.findIndex(tailwindClasses, line => line.includes(opacityValue.className));
1301
+ // Styles with color opacity modifiers
1302
+ if (classesWithOpacityValues.length > 0) {
1303
+ purgedClasses += '\n// Styles with color opacity modifiers\n';
1304
+ classesWithOpacityValues.forEach(opacityValue => {
1305
+ let opacityIndex = _.findIndex(tailwindClasses, line => line.startsWith(`'.${opacityValue.className}`));
1302
1306
 
1303
1307
  if (opacityIndex > -1) {
1304
- let defaultHexValue = tailwindClasses[opacityIndex].match(/\#[0-9a-f]{6}/i)[0];
1308
+ let defaultHexValue;
1309
+ if (tailwindClasses[opacityIndex].includes('from')) {
1310
+ defaultHexValue = tailwindClasses[opacityIndex].match(/\#[0-9a-f]{6}/g)[1];
1311
+ } else {
1312
+ defaultHexValue = tailwindClasses[opacityIndex].match(/\#[0-9a-f]{6}/i)[0];
1313
+ }
1314
+
1305
1315
  let classWithoutDecimalOpacity = `${tailwindClasses[opacityIndex].replace(defaultHexValue, `#${opacityValue.transparency}${defaultHexValue.substring(1)}`)}`;
1306
1316
  let defaultTextValue = tailwindClasses[opacityIndex].match(/'[^']*'/i)[0];
1307
1317
  defaultTextValue = defaultTextValue.substring(1, defaultTextValue.length);
1308
1318
  let finalClassName = `${classWithoutDecimalOpacity.replace(defaultTextValue, `.${defaultTextValue.substring(1, defaultTextValue.length - 1)}/${opacityValue.decimalValue}'`)}`;
1309
- purgedClasses += helpers.checkPlatformAndDevice(finalClassName, opacityValue.originalClass);
1319
+ purgedClasses += helpers.checkPlatformAndDevice(finalClassName, opacityValue.classNameWithTransparency);
1310
1320
  }
1311
1321
  });
1312
1322
  }
@@ -1323,41 +1333,44 @@ function cleanClassNameFn(className) {
1323
1333
 
1324
1334
  const arbitraryValuesTable = {
1325
1335
  // Check if they are really needed
1326
- 'font': '{ fontWeight: {value} }',
1327
- 'max-scale': '{ maxZoomScale: {value} }',
1328
- 'min-scale': '{ minZoomScale: {value} }',
1329
- 'content-w': '{ contentWidth: {value} }',
1330
- 'content-h': '{ contentHeight: {value} }',
1331
- // 'bg-selected': '{ backgroundSelectedColor: {value} }',
1332
- 'content': '{ contentWidth: {value}, contentHeight: {value} }',
1333
- // 'shadow': '{ viewShadowOffset: { x: 0, y: 0 }, viewShadowRadius: 1, viewShadowColor: {value} }',
1334
-
1335
- 'anchorPoint': '{ anchorPoint: { x: {value}, y: {value1} } }',
1336
+ 'active-tint': '{ activeTintColor: {value} }',
1337
+ 'active-title': '{ activeTitleColor: {value} }',
1338
+ 'bar': '{ barColor: {value} }',
1339
+ 'bg-selected': '{ backgroundSelectedColor: {value} }',
1336
1340
  'bg': '{ backgroundColor: {value} }',
1337
1341
  'border-color': '{ borderColor: {value} }',
1338
1342
  'border-width': '{ borderWidth: {value} }',
1339
1343
  'bottom': '{ bottom: {value} }',
1344
+ 'cache-size': '{ cacheSize: {value} }',
1345
+ 'content-h': '{ contentHeight: {value} }',
1346
+ 'content-w': '{ contentWidth: {value} }',
1347
+ 'content': '{ contentWidth: {value}, contentHeight: {value} }',
1348
+ 'current-page': '{ currentPageIndicatorColor: {value} }',
1340
1349
  'delay': '{ delay: {value} }',
1341
1350
  'duration': '{ duration: {value} }',
1342
1351
  'feedback': '{ touchFeedback: true, touchFeedbackColor: {value} }',
1352
+ 'font': '{ fontWeight: {value} }',
1343
1353
  'from': '{ backgroundGradient: { colors: [ {value1}, {value} ] } }',
1354
+ 'grid-cols': '{ width: Alloy.Globals.cols_{value} }',
1355
+ 'grid-rows': '{ height: Alloy.Globals.rows_{value} }',
1344
1356
  'h': '{ height: {value}}',
1345
1357
  'left': '{ left: {value} }',
1346
1358
  'm': '{ top: {value}, right: {value}, bottom: {value}, left: {value} }',
1359
+ 'max-scale': '{ maxZoomScale: {value} }',
1347
1360
  'mb': '{ bottom: {value} }',
1361
+ 'min-scale': '{ minZoomScale: {value} }',
1348
1362
  'ml': '{ left: {value} }',
1349
1363
  'mr': '{ right: {value} }',
1350
1364
  'mt': '{ top: {value} }',
1351
1365
  'mx': '{ right: {value}, left: {value} }',
1352
1366
  'my': '{ top: {value}, bottom: {value} }',
1367
+ 'nav-tint': '{ navTintColor: {value} }',
1353
1368
  'opacity': '{ opacity: {value} }',
1354
-
1355
- 'page': '{ pageIndicatorColor: {value} }',
1356
- 'paging': '{ pagingControlColor: {value} }',
1357
- 'cache-size': '{ cacheSize: {value} }',
1358
-
1359
- 'current-page': '{ currentPageIndicatorColor: {value} }',
1369
+ 'origin': '{ anchorPoint: { x: {value}, y: {value1} } }',
1360
1370
  'p': '{ padding: { top: {value}, right: {value}, bottom: {value}, left: {value} } }',
1371
+ 'page': '{ pageIndicatorColor: {value} }',
1372
+ 'paging-alpha': '{ pagingControlAlpha: {value} }',
1373
+ 'paging-color': '{ pagingControlColor: {value} }',
1361
1374
  'pb': '{ padding: { bottom: {value} } }',
1362
1375
  'pl': '{ padding: { left: {value} } }',
1363
1376
  'placeholder': '{ hintTextColor: {value} }',
@@ -1370,11 +1383,11 @@ const arbitraryValuesTable = {
1370
1383
  'rotate': '{ rotate: {value} }',
1371
1384
  'rounded': '{ borderRadius: {value} }',
1372
1385
  'shadow': '{ viewShadowColor: {value} }',
1386
+ 'tabs-bg': '{ tabsBackgroundColor: {value} }',
1373
1387
  'text-color': '{ color: {value} }',
1374
1388
  'text-size': '{ font: { fontSize: {value} } }',
1375
1389
  'tint': '{ tintColor: {value} }',
1376
- 'grid-col': '{ width: Alloy.Globals.cols_{value} }',
1377
- 'grid-row': '{ height: Alloy.Globals.rows_{value} }',
1390
+ 'title': '{ titleColor: {value} }',
1378
1391
  'to': '{ backgroundGradient: { colors: [ {value} ] } }',
1379
1392
  'top': '{ top: {value} }',
1380
1393
  'w': '{ width: {value} }'
@@ -1393,20 +1406,24 @@ function formatArbitraryValues(arbitraryValue) {
1393
1406
  let value = splitedContent[1].match(/(?<=\().*(?=\))/).pop();
1394
1407
 
1395
1408
  if (rule === 'text') {
1396
- rule = (value.includes('#')) ? 'text-color' : 'text-size';
1409
+ rule = (value.includes('#') || value.includes('rgb')) ? 'text-color' : 'text-size';
1397
1410
  }
1398
1411
 
1399
1412
  if (rule === 'border') {
1400
- rule = (value.includes('#')) ? 'border-color' : 'border-width';
1413
+ rule = (value.includes('#') || value.includes('rgb')) ? 'border-color' : 'border-width';
1414
+ }
1415
+
1416
+ if (rule === 'paging') {
1417
+ rule = (value.includes('#') || value.includes('rgb')) ? 'paging-color' : 'paging-alpha';
1401
1418
  }
1402
1419
 
1403
1420
  let properties = arbitraryValuesTable[rule];
1404
1421
 
1405
1422
  if (rule === 'from') {
1406
- properties = _.replace(properties, new RegExp("{value1}", "g"), helpers.addTransparencyToHex(helpers.parseValue(value, sign)));
1423
+ properties = _.replace(properties, new RegExp("{value1}", "g"), helpers.addTransparencyToHex(helpers.parseValue(value)));
1407
1424
  }
1408
1425
 
1409
- if (rule === 'anchorPoint') {
1426
+ if (rule === 'origin') {
1410
1427
  // anchorPoint
1411
1428
  let value1 = (value.includes(',')) ? value.split(',')[1] : value;
1412
1429
 
@@ -50,6 +50,7 @@ if (!fs.existsSync('./dist')) {
50
50
  convertedStyles += helpers.borderStyle();
51
51
  convertedStyles += helpers.borderWidth(defaultTheme.borderWidth);
52
52
  convertedStyles += helpers.bounce();
53
+ convertedStyles += helpers.cacheSize();
53
54
  convertedStyles += helpers.clipMode();
54
55
  convertedStyles += helpers.currentPageIndicatorColor(combinedColors);
55
56
  convertedStyles += helpers.displayCaps();
package/lib/helpers.js CHANGED
@@ -75,6 +75,24 @@ function barColor(modifiersAndValues) {
75
75
  }
76
76
  exports.barColor = barColor;
77
77
 
78
+ function cacheSize() {
79
+ let modifiersAndValues = {
80
+ 1: 1,
81
+ 2: 2,
82
+ 3: 3,
83
+ 4: 4,
84
+ 5: 5,
85
+ 6: 6,
86
+ 7: 7,
87
+ 8: 8,
88
+ 9: 9,
89
+ 10: 10,
90
+ };
91
+
92
+ return processModifiersAndProperties('cacheSize', { 'cache-size': '{ cacheSize: {value} }' }, modifiersAndValues);
93
+ }
94
+ exports.cacheSize = cacheSize;
95
+
78
96
  function tabsBackgroundColor(modifiersAndValues) {
79
97
  return processModifiersAndProperties('tabsBackgroundColor', { 'tabs-bg': '{ tabsBackgroundColor: {value} }' }, modifiersAndValues);
80
98
  }
@@ -217,6 +235,18 @@ function linearGradient() {
217
235
  convertedStyles += `'.bg-linear-to-l': { backgroundGradient: { type: 'linear', startPoint: { x: '0%', y: '0%' }, endPoint: { x: '100%', y: '0%' }, backfillStart: true } }\n`;
218
236
  convertedStyles += `'.bg-linear-to-tl': { backgroundGradient: { type: 'linear', startPoint: { x: '0%', y: '0%' }, endPoint: { x: '100%', y: '100%' }, backfillStart: true } }\n`;
219
237
 
238
+ convertedStyles += '\n';
239
+
240
+ convertedStyles += `'.bg-gradient': { backgroundGradient: { type: 'linear', startPoint: { x: '50%', y: '100%' }, endPoint: { x: '50%', y: '0%' }, backfillStart: true } }\n`;
241
+ convertedStyles += `'.bg-gradient-to-t': { backgroundGradient: { type: 'linear', startPoint: { x: '0%', y: '0%' }, endPoint: { x: '0%', y: '100%' }, backfillStart: true } }\n`;
242
+ convertedStyles += `'.bg-gradient-to-tr': { backgroundGradient: { type: 'linear', startPoint: { x: '100%', y: '0%' }, endPoint: { x: '0%', y: '100%' }, backfillStart: true } }\n`;
243
+ convertedStyles += `'.bg-gradient-to-r': { backgroundGradient: { type: 'linear', startPoint: { x: '100%', y: '0%' }, endPoint: { x: '0%', y: '0%' }, backfillStart: true } }\n`;
244
+ convertedStyles += `'.bg-gradient-to-br': { backgroundGradient: { type: 'linear', startPoint: { x: '100%', y: '100%' }, endPoint: { x: '0%', y: '0%' }, backfillStart: true } }\n`;
245
+ convertedStyles += `'.bg-gradient-to-b': { backgroundGradient: { type: 'linear', startPoint: { x: '100%', y: '100%' }, endPoint: { x: '100%', y: '0%' }, backfillStart: true } }\n`;
246
+ convertedStyles += `'.bg-gradient-to-bl': { backgroundGradient: { type: 'linear', startPoint: { x: '0%', y: '100%' }, endPoint: { x: '100%', y: '0%' }, backfillStart: true } }\n`;
247
+ convertedStyles += `'.bg-gradient-to-l': { backgroundGradient: { type: 'linear', startPoint: { x: '0%', y: '0%' }, endPoint: { x: '100%', y: '0%' }, backfillStart: true } }\n`;
248
+ convertedStyles += `'.bg-gradient-to-tl': { backgroundGradient: { type: 'linear', startPoint: { x: '0%', y: '0%' }, endPoint: { x: '100%', y: '100%' }, backfillStart: true } }\n`;
249
+
220
250
  return convertedStyles;
221
251
  }
222
252
  exports.linearGradient = linearGradient;
@@ -1194,6 +1224,7 @@ function applyProperties(twStyles) {
1194
1224
 
1195
1225
  if (indexOfModifier !== -1) {
1196
1226
  let compoundClasses = [];
1227
+ let classesWithOpacityValues = [];
1197
1228
  _.each([...value], searchClass => {
1198
1229
  // let cleanClass = searchClass.replace('open:', '').replace('close:', '');
1199
1230
  //! Needs to handle open, close and complete states...
@@ -1202,6 +1233,15 @@ function applyProperties(twStyles) {
1202
1233
  if (theClass) {
1203
1234
  compoundClasses.push(formatArbitraryValues(searchClass));
1204
1235
  }
1236
+ //! Process transparency values
1237
+ } else if (checkColorClasses(searchClass)) {
1238
+ // Set opacity to color properties
1239
+ let decimalValue = searchClass.split('/')[1];
1240
+ let transparency = Math.round(decimalValue * 255 / 100).toString(16);
1241
+ if (transparency.length === 1) transparency = '0' + transparency;
1242
+ let originalClass = searchClass;
1243
+ let classNameWithTransparency = searchClass.substring(0, searchClass.lastIndexOf('/'));
1244
+ classesWithOpacityValues.push({ decimalValue, transparency, originalClass, classNameWithTransparency });
1205
1245
  } else {
1206
1246
  let indexOfClass = findIndexOf(`'.${searchClass}': `, twStylesArray);
1207
1247
 
@@ -1214,6 +1254,28 @@ function applyProperties(twStyles) {
1214
1254
  }
1215
1255
  });
1216
1256
 
1257
+ // Handle opacity values
1258
+ if (classesWithOpacityValues.length > 0) {
1259
+ classesWithOpacityValues.forEach(opacityValue => {
1260
+ let opacityIndex = _.findIndex(twStylesArray, line => line.startsWith(`'.${opacityValue.classNameWithTransparency}`));
1261
+ if (opacityIndex > -1) {
1262
+ let defaultHexValue;
1263
+ if (twStylesArray[opacityIndex].includes('from')) {
1264
+ defaultHexValue = twStylesArray[opacityIndex].match(/\#[0-9a-f]{6}/g)[1];
1265
+ } else {
1266
+ defaultHexValue = twStylesArray[opacityIndex].match(/\#[0-9a-f]{6}/i)[0];
1267
+ }
1268
+
1269
+ let classWithoutDecimalOpacity = `${twStylesArray[opacityIndex].replace(defaultHexValue, `#${opacityValue.transparency}${defaultHexValue.substring(1)}`)}`;
1270
+ let defaultTextValue = twStylesArray[opacityIndex].match(/'[^']*'/i)[0];
1271
+ compoundClasses.push(classWithoutDecimalOpacity
1272
+ .replace(`${defaultTextValue}: `, '')
1273
+ .replace(/{(.*)}/, '$1')
1274
+ .trim());
1275
+ }
1276
+ });
1277
+ }
1278
+
1217
1279
  twStylesArray[indexOfModifier] = _.replace(twStylesArray[indexOfModifier], new RegExp("{_applyProperties_}"), fixDuplicateKeys(compoundClasses).join(', '));
1218
1280
  }
1219
1281
  });
@@ -1222,6 +1284,31 @@ function applyProperties(twStyles) {
1222
1284
  }
1223
1285
  exports.applyProperties = applyProperties;
1224
1286
 
1287
+ function checkColorClasses(cleanClassName) {
1288
+ return (
1289
+ cleanClassName.startsWith('active-tint-') ||
1290
+ cleanClassName.startsWith('active-title-') ||
1291
+ cleanClassName.startsWith('bar-') ||
1292
+ cleanClassName.startsWith('bg-') ||
1293
+ cleanClassName.startsWith('bg-selected-') ||
1294
+ cleanClassName.startsWith('border-') ||
1295
+ cleanClassName.startsWith('current-page-') ||
1296
+ cleanClassName.startsWith('feedback-') ||
1297
+ cleanClassName.startsWith('from-') ||
1298
+ cleanClassName.startsWith('nav-tint-') ||
1299
+ cleanClassName.startsWith('page-') ||
1300
+ cleanClassName.startsWith('paging-') ||
1301
+ cleanClassName.startsWith('placeholder-') ||
1302
+ cleanClassName.startsWith('shadow-') ||
1303
+ cleanClassName.startsWith('tabs-bg-') ||
1304
+ cleanClassName.startsWith('text-') ||
1305
+ cleanClassName.startsWith('tint-') ||
1306
+ cleanClassName.startsWith('title-') ||
1307
+ cleanClassName.startsWith('to-')) &&
1308
+ cleanClassName.includes('/');
1309
+ }
1310
+ exports.checkColorClasses = checkColorClasses;
1311
+
1225
1312
  function findIndexOf(_substring, _array) {
1226
1313
  return _array.findIndex(element => element.includes(_substring));
1227
1314
  }
@@ -1266,7 +1353,9 @@ function fixDuplicateKeys(compoundClasses) {
1266
1353
  cleanedStyles.push(`font: { ${fontObject.sort().join(', ')} }`);
1267
1354
  }
1268
1355
 
1269
- if (backgroundGradientObject.length === 2) {
1356
+ if (backgroundGradientObject.length === 1) {
1357
+ cleanedStyles.push(`backgroundGradient: { ${backgroundGradientObject} }`);
1358
+ } else if (backgroundGradientObject.length === 2) {
1270
1359
  let toColor = backgroundGradientObject[1].replace('colors: ', '').replace(/[\[\]']+/g, '').trim().split(',');
1271
1360
  let fromToColors = backgroundGradientObject[0].replace('colors: ', '').replace(/[\[\]']+/g, '').trim().split(',');
1272
1361
  fromToColors[0] = toColor[0];
@@ -1278,41 +1367,45 @@ function fixDuplicateKeys(compoundClasses) {
1278
1367
 
1279
1368
  const arbitraryValuesTable = {
1280
1369
  // Check if they are really needed
1281
- 'font': 'font: { fontWeight: {value} }',
1282
- 'max-scale': 'maxZoomScale: {value}',
1283
- 'min-scale': 'minZoomScale: {value}',
1284
- 'content-w': 'contentWidth: {value}',
1285
- 'content-h': 'contentHeight: {value}',
1286
- // 'bg-selected': 'backgroundSelectedColor: {value}',
1287
- 'content': 'contentWidth: {value}, contentHeight: {value}',
1288
- // 'shadow': 'viewShadowOffset: { x: 0, y: 0 }, viewShadowRadius: 1, viewShadowColor: {value}',
1289
1370
 
1290
- 'anchorPoint': 'anchorPoint: { x: {value}, y: {value1}',
1371
+ 'active-tint': 'activeTintColor: {value}',
1372
+ 'active-title': 'activeTitleColor: {value}',
1373
+ 'bar': 'barColor: {value}',
1374
+ 'bg-selected': 'backgroundSelectedColor: {value}',
1291
1375
  'bg': 'backgroundColor: {value}',
1292
1376
  'border-color': 'borderColor: {value}',
1293
1377
  'border-width': 'borderWidth: {value}',
1294
1378
  'bottom': 'bottom: {value}',
1379
+ 'cache-size': 'cacheSize: {value}',
1380
+ 'content-h': 'contentHeight: {value}',
1381
+ 'content-w': 'contentWidth: {value}',
1382
+ 'content': 'contentWidth: {value}, contentHeight: {value}',
1383
+ 'current-page': 'currentPageIndicatorColor: {value}',
1295
1384
  'delay': 'delay: {value}',
1296
1385
  'duration': 'duration: {value}',
1297
1386
  'feedback': 'touchFeedback: true, touchFeedbackColor: {value}',
1387
+ 'font': 'font: { fontWeight: {value} }',
1298
1388
  'from': 'backgroundGradient: { colors: [ {value1}, {value} ] }',
1389
+ 'grid-cols': 'width: Alloy.Globals.cols_{value}',
1390
+ 'grid-rows': 'height: Alloy.Globals.rows_{value}',
1299
1391
  'h': 'height: {value}',
1300
1392
  'left': 'left: {value}',
1301
1393
  'm': 'top: {value}, right: {value}, bottom: {value}, left: {value}',
1394
+ 'max-scale': 'maxZoomScale: {value}',
1302
1395
  'mb': 'bottom: {value}',
1396
+ 'min-scale': 'minZoomScale: {value}',
1303
1397
  'ml': 'left: {value}',
1304
1398
  'mr': 'right: {value}',
1305
1399
  'mt': 'top: {value}',
1306
1400
  'mx': 'right: {value}, left: {value}',
1307
1401
  'my': 'top: {value}, bottom: {value}',
1402
+ 'nav-tint': 'navTintColor: {value}',
1308
1403
  'opacity': 'opacity: {value}',
1309
-
1310
- 'page': 'pageIndicatorColor: {value}',
1311
- 'paging': 'pagingControlColor: {value}',
1312
- 'cache-size': 'cacheSize: {value}',
1313
-
1314
- 'current-page': 'currentPageIndicatorColor: {value}',
1404
+ 'origin': 'anchorPoint: { x: {value}, y: {value1} }',
1315
1405
  'p': 'padding: { top: {value}, right: {value}, bottom: {value}, left: {value} }',
1406
+ 'page': 'pageIndicatorColor: {value}',
1407
+ 'paging-alpha': 'pagingControlAlpha: {value}',
1408
+ 'paging-color': 'pagingControlColor: {value}',
1316
1409
  'pb': 'padding: { bottom: {value} }',
1317
1410
  'pl': 'padding: { left: {value} }',
1318
1411
  'placeholder': 'hintTextColor: {value}',
@@ -1324,11 +1417,12 @@ const arbitraryValuesTable = {
1324
1417
  'right': 'right: {value}',
1325
1418
  'rotate': 'rotate: {value}',
1326
1419
  'rounded': 'borderRadius: {value}',
1420
+ 'shadow': 'viewShadowColor: {value}',
1421
+ 'tabs-bg': 'tabsBackgroundColor: {value}',
1327
1422
  'text-color': 'color: {value}',
1328
1423
  'text-size': 'font: { fontSize: {value} }',
1329
1424
  'tint': 'tintColor: {value}',
1330
- 'grid-col': 'width: Alloy.Globals.cols_{value}',
1331
- 'grid-row': 'height: Alloy.Globals.rows_{value}',
1425
+ 'title': 'titleColor: {value}',
1332
1426
  'to': 'backgroundGradient: { colors: [ {value} ] }',
1333
1427
  'top': 'top: {value}',
1334
1428
  'w': 'width: {value}'
@@ -1347,20 +1441,24 @@ function formatArbitraryValues(arbitraryValue) {
1347
1441
  let value = splitedContent[1].match(/(?<=\().*(?=\))/).pop();
1348
1442
 
1349
1443
  if (rule === 'text') {
1350
- rule = (value.includes('#')) ? 'text-color' : 'text-size';
1444
+ rule = (value.includes('#') || value.includes('rgb')) ? 'text-color' : 'text-size';
1351
1445
  }
1352
1446
 
1353
1447
  if (rule === 'border') {
1354
- rule = (value.includes('#')) ? 'border-color' : 'border-width';
1448
+ rule = (value.includes('#') || value.includes('rgb')) ? 'border-color' : 'border-width';
1449
+ }
1450
+
1451
+ if (rule === 'paging') {
1452
+ rule = (value.includes('#') || value.includes('rgb')) ? 'paging-color' : 'paging-alpha';
1355
1453
  }
1356
1454
 
1357
1455
  let properties = arbitraryValuesTable[rule];
1358
1456
 
1359
1457
  if (rule === 'from') {
1360
- properties = _.replace(properties, new RegExp("{value1}", "g"), addTransparencyToHex(parseValue(value, sign)));
1458
+ properties = _.replace(properties, new RegExp("{value1}", "g"), addTransparencyToHex(parseValue(value)));
1361
1459
  }
1362
1460
 
1363
- if (rule === 'anchorPoint') {
1461
+ if (rule === 'origin') {
1364
1462
  // anchorPoint
1365
1463
  let value1 = (value.includes(',')) ? value.split(',')[1] : value;
1366
1464
 
@@ -1828,6 +1926,9 @@ function defaultColors(color) {
1828
1926
 
1829
1927
  function addTransparencyToHex(color, transparency = '00') {
1830
1928
  if (color.includes('#')) {
1929
+ if (color.includes('\'')) {
1930
+ color = color.replace(/'/g, '');
1931
+ }
1831
1932
  switch (color.length) {
1832
1933
  case 4:
1833
1934
  color = `#${transparency}${color[1]}${color[2]}${color[3]}`
@@ -1841,6 +1942,6 @@ function addTransparencyToHex(color, transparency = '00') {
1841
1942
  }
1842
1943
  }
1843
1944
 
1844
- return color;
1945
+ return `'${color}'`;
1845
1946
  }
1846
1947
  exports.addTransparencyToHex = addTransparencyToHex;
@@ -1,2 +1,2 @@
1
- // Tailwind CSS v3.0.0: A utility-first CSS framework for rapidly building custom designs. ( https://tailwindcss.com )
1
+ // Tailwind CSS v3.0.7: A utility-first CSS framework for rapidly building custom designs. ( https://tailwindcss.com )
2
2
  // Created by Adam Wathan ( https://twitter.com/adamwathan ).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "purgetss",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "description": "An extension for Titanium SDK that generates a set of Tailwind-like classes and values to easily and quickly create beautifully designed mobile apps.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -60,7 +60,7 @@
60
60
  "path": "^0.12.7",
61
61
  "prompts": "^2.4.2",
62
62
  "read-css": "^0.3.0",
63
- "tailwindcss": "^3.0.1",
63
+ "tailwindcss": "^3.0.7",
64
64
  "traverse": "^0.6.6",
65
65
  "update-notifier": "^5.1.0",
66
66
  "xml-js": "^1.6.11"
Binary file