info
PurgeTSS is a toolkit for building mobile apps with the Titanium framework. It adds practical utilities for styling and setup work.
It includes utility classes, icon font support, an Animation module, a simple grid system, and the shades command for generating custom colors.
If you build UI-heavy screens, PurgeTSS keeps you from hand-writing long TSS files.
What it does:
- 23,300+ utility classes for colors, spacing, typography, layout, and more.
- Parses XML files and writes an
app.tsswith only the classes you use. - Customizable through
config.cjs, with arbitrary values for one-off sizes and colors. - Icon fonts for Buttons and Labels: Font Awesome, Material Icons, Material Symbols, and Framework7-Icons.
build-fontscommand generatesfonts.tsswith class definitions andfontFamilyselectors for any font you drop in.shadescommand generates color palettes from a hex value.- Animation module with 2D transforms, draggable views with collision detection, sequential animations, and position utilities.
- Grid system for aligning and distributing elements in rows and columns.
Table of Contents
- Installation
- Commands
- App Assets
- Customization
- The UI Module
- Best Practices
- Grid System
Changelog
v7.10.2
- Configs written before v7.7.0 (the
brand:regroup) now auto-migrate in memory on every run. The legacy flat layout (brand.padding: <number>,brand.iosPadding,brand.bgColor,brand.darkBgColor, top-levelbrand.notification/brand.splash) used to crash auto-purge withTypeError: Cannot create property 'ios' on number '15';getConfigFile()now normalizes them to the grouped layout (brand.padding.{ios, androidLegacy, androidAdaptive},brand.android.*,brand.ios.darkBackground,brand.colors.background) before applying defaults. When both legacy and new keys coexist, the new key wins. A one-time deprecation notice per session lists the migrated keys. See Upgrading from pre-7.7.0 configs. - Internal fix:
logger.warningandlogger.successare now defined. Acrossbrand,images,cleanup-legacy, andsvg-utils, ~30 callsites oflogger.warningand ~10 oflogger.successreferenced methods that did not exist on the logger object — any opt-in command path that hit one of those calls used to throwTypeError: logger.warning is not a function. The auto-purge entry point most users hit did not reach those callsites, so the bug stayed latent until commands likepurgetss brandorpurgetss imageswere run.
v7.10.1
- User-visible references to "Tailwind" in copy that did not document a functional integration were dropped. The Class Syntax Error block now reports
'Square brackets "[ ]" are not supported'instead of'Tailwind-style brackets "[ ]" are not supported'; the promotional<Label>injected into new projects bypurgetss createchanged from"Tailwind-inspired utility classes for Titanium/Alloy"to"Utility-first styling for Titanium/Alloy". All functional integrations stay: thetailwindcss@3dependency installed byinstall-dependencies(drives both thedefaultColors/defaultThemepalette base AND the VSCode IntelliSense extension), the--tailwindflag onpurgetss shades, and the recommendedTailwind CSS IntelliSense/Tailwind Raw Reorder (v4)VSCode extensions.
v7.10.0
purgetss imagesgot three CLI-only flags.--opacity <n>(integer0-100) multiplies the alpha channel of every generated density byn/100— useful for placeholder or default ImageView images that render at reduced opacity.--padding <n>(integer0-40) shrinks the rendered image inside each density canvas by symmetric percentage borders, preserving canvas size with transparent fill — useful for breathing room around an unpadded logo.--output <relpath>overrides the basename and subpath relative to each platform'simages/root, so a logo frompurgetss/brand/can be written asimages/logos/loading.pngacross all densities in a single command. Combines naturally for "transparent placeholder with padding under a custom path". See Multi-density images — opacity, padding, output.purgetss brandnow generatesMarketplaceArtworkFeature.png(1024×500 Google Play Feature Graphic) alongside the existing iTunesConnect and MarketplaceArtwork submission assets. Auto-discoverspurgetss/brand/logo-feature.{svg,png}or reuses the master logo if not provided. Default vertical padding is12%; override with--feature-graphic-padding <n>(range0-40), configbrand.padding.featureGraphic, or CLI--feature-logo <path>for a dedicated source. Submission artwork only — written to project root for upload to the Play Console, not bundled into the APK.- Arbitrary nesting depth in
config.cjsthemeobjects. Property emission now walks nested values recursively instead of stopping at level 2, sotheme.extend.colors.brand.primary.500flattens tobrand-primary-500instead of being silently dropped. Same forbackgroundGradientandbackgroundSelectedGradient. Default modifier keys (default,global,DEFAULT) collapse without contributing to the suffix. - Fix:
apply:now resolves built-in icon font classes (fas,fab,fa-*,mi-*,ms-*,f7-*) fromdist/for projects that don't runbuild-fonts. Previously those classes were silently dropped from generated rules —apply: 'fas fa-times-circle wh-12 ...'produced everything except the FontAwesome family and the icon glyph. - Fix:
borderRadius: [...]arrays no longer get truncated when combined with other utilities in anapply:string. The post-merge dedup step (from v7.9.0) tracked depth on{}only, soborderRadius: [0, 0, 0, 16](emitted by directionalrounded-{t,b,l,r,tl,tr,bl,br}-*utilities) was split on its internal commas. The depth tracker now respects[]alongside{}. - Fix:
brand --padding <n>shortcut now applies to BOTH Android paddings as the help text always promised. Previously the shortcut only fedandroidAdaptivePaddingwhileandroidLegacyPaddingfell through to its own config value, sopurgetss brand --padding 17actually producedandroidAdaptive=17, androidLegacy=10.
v7.9.0
- Opacity modifiers now work on classes that resolve to a semantic color. Writing
bg-surface/65(or any other opacity modifier on a class mapped to a name insemantic.colors.json) produces a working rule with Light/Dark switching preserved. PurgeTSS derives a new<originalKey>_<alphaPercent>entry with the originallight/darkhex values and the requested alpha for both modes, writes it back tosemantic.colors.json, and emits the rule against the derived key. Re-runs are idempotent; manual edits with conflicting values halt the build with aConflicterror. New alpha entries require one full Titanium build to be picked up — Liveview hot-reload alone does not refreshsemantic.colors.json. See Semantic Colors. - Several fixes around semantic colors, gradients, and Ti Element defaults: the
semantictonal palette was inverting Light and Dark; the gradientfrom/tocolor order was position-dependent and could swap aftersort(); thebg-gradient-to-Xdirection was silently dropped when combined withfrom-X to-Ycolors in the sameapplystring;theme.Window/theme.View/theme.ImageViewno longer leak the framework presets (white background,Ti.UI.SIZE, iOShires: true) when defined at the top level (replace mode), so a Window declared attheme.Windowwith abackgroundGradientno longer ghosts on top of a defaultbackgroundColor: '#FFFFFF'.theme.extend.Windowkeeps merging with the defaults as before. See Apply directive — extend mode vs replace mode. - Breaking: the user-facing glossary output path was renamed from
purgetss/experimental/tailwind-classes/topurgetss/glossary/tailwind-classes/. Any tooling or CI that reads from the old path needs to be updated on upgrade — no transition shim was added on purpose. The--glossaryflag and command surface are unchanged.
v7.8.0
imagesnow has a--width <n>flag. It pins Androidmdpi(= iPhone@1x) to a specific pixel width, for examplepurgetss images logo.svg --width 256. Larger scales derive at ×1.5, ×2, ×3, and ×4, with height staying proportional to the source's aspect ratio. Use this for SVG sources from vector editors with disproportionate viewBoxes, such as Affinity or Illustrator. Without the flag, every scale derives from the source's viewBox as a 4× master, which can produce unpredictable sizes when the viewBox does not match the intended display size. When you pass an SVG without--width, the command prints a one-time hint and then falls back to the legacy 4× behavior. This is CLI-only; there is no matchingimages:config property because the right width is per-asset.- Class syntax pre-validation now stops
purgetsswith a structuredClass Syntax Errorblock (file + line + suggested fix) when it detects known class-name mistakes: inverted negative sign (top-(-10)→-top-(10)), Tailwind-style brackets (top-[10px]→top-(10px)), empty parentheses (wh-()), whitespace inside parentheses (wh-( 200 )), and redundantpxunit (top-(10px)→top-(10)). All offenders are reported in one run. Generic unknown classes, such as typos, vendor utilities not enabled, or custom classes not declared yet, are not flagged. They still flow into the// Unused or unsupported classesblock inapp.tss. - The arbitrary-value parser no longer crashes on negative values inside parentheses. Classes like
top-(-10),mt-(-5), andorigin-(-10,-20)used to trigger aCannot read properties of null (reading 'pop')exception. The parser now extracts the(...)portion first, so a-inside the value does not break the split.
v7.7.0
- The
brandconfig was cleaned up before stabilizing. Branding settings now live under grouped sections:brand.logos,brand.padding,brand.android,brand.ios, andbrand.colors. brandcan now use separate Android inputs: one logo for the general brand set, another for Android launcher icons, and another for Android 12+ splash artwork. Usebrand.logos.androidLauncher/--icon-logoandbrand.logos.androidSplash/--splash-logo, or droplogo-icon.*andlogo-splash.*intopurgetss/brand/.purgetss brandnow regenerates the legacy Android splash fallback:app/assets/android/default.pngin Alloy projects andResources/android/default.pngin Classic projects.cleanup-legacyno longer removesdefault.png, because that file can still matter on older Titanium Android splash paths.- The branding docs now explain what uses
ic_launcher, what usessplash_icon.png, and what still falls back todefault.png.
v7.6.2
- The
semanticcommand now works in Classic Titanium projects. It writes toResources/semantic.colors.json; Alloy keeps writing toapp/assets/semantic.colors.json. Existing unrelated entries, such as the defaultbackgroundColor/textColorvalues that ship with Classic templates, are preserved in both project types. See Semantic Colors - Fixed a UX bug where the "not an Alloy project" error was immediately followed by the palette preview JSON, making it look like the command half-succeeded.
v7.6.1
brandandimagesnow ask before destructive writes (y/N/afor "always"). The prompt is skipped whenstdinis not a TTY (alloy.jmk hook, CI, pipes), when-y/--yesis passed, or whenPURGETSS_YES=1is set. SetconfirmOverwrites: falseon the matching config section to silence it permanently.- SVG logos and images now get a disproportionate-viewBox warning. The command detects viewBoxes above 4096 pt on any side, common in Affinity and Illustrator exports, and rasterizes with adaptive density to stay within Sharp's pixel budget.
initnow createspurgetss/{fonts,brand,images}/subfolders.- Multi-line command output is now grouped under a single
::PurgeTSS::header with indented continuation lines. This applies acrosspurge,fonts,icon-library,brand,images, and most warnings.
v7.6.0
- The new
brandcommand generates the Titanium branding set from logos auto-discovered in./purgetss/brand/: launcher icons, adaptive icons, iOS 18+ Dark/Tinted variants, marketplace artwork, and optional notification/splash assets. Works on Alloy and Classic projects. See App icons and branding - The new
imagescommand generates multi-density UI images from sources in./purgetss/images/: Androidres-*densities and iPhone@1x/@2x/@3xscales. Subdirectories are preserved, and short paths can target individual files for re-processing. See Multi-density images brand:andimages:config sections were added topurgetss/config.cjs. Percentages can be written as'15%'strings for clarity; plain numbers are also accepted. Older configs get these sections on first run.- The new
semanticcommand generates Titanium semantic colors (Light/Dark mode) intoapp/assets/semantic.colors.json.--singleswitches between a tonal palette (one base hex → 11 shades with mirror inversion + auto config mapping) and a purpose-based color (explicit per-mode hex + optional alpha). The JSON entry and class mapping inconfig.cjsare written in one shot. Class names are derived by stripping theColorsuffix, for examplesurfaceColor→surface. Smart in-place updates run when a single name matches an existing palette shade. See Semantic Colors: generating semantic colors with thesemanticcommand
v7.5.3
- New
Appearanceexport for Light/Dark/System mode switching with persistence. Methods:init(),set(mode),get(),toggle(). See Appearance Setup - Default font family classes are generated automatically with platform-appropriate values:
font-sans,font-serif, andfont-mono. - XML validation now detects illegal
--inside XML comments during pre-validation.
v7.5.0
extendsupport for Window, View, and ImageView. Component defaults can now be customized fromtheme.extendinconfig.cjs.- Shorthand
apply:{ apply: '...' }is automatically normalized, so thedefault:wrapper is optional. - Property deduplication: applied values win over static defaults instead of duplicating.
- Automatic platform resolution: classes inside
ios:/android:blocks find their platform-specific version automatically. - Font Awesome 7.2.0
- Fixed:
extend.Windowsilently ignored, duplicatefontproperties, array-type properties missing[ ]notation
v7.4.0
Animation module expansion: 9 new methods bring the module to 15 total.
transition,pulse,sequence,swap,shake,snapTo,reorder,undraggable,detectCollisions- New utility classes:
snap-back,snap-center,snap-magnet,keep-z-index - Delta-based drag for transformed views, position normalization, property inheritance from the Animation object
See the UI Module documentation for full details.
v7.3.0
- BREAKING:
tailwind.tsswas renamed toutilities.tss. - XML syntax validation adds pre-validation for Alloy XML files with line numbers and fix suggestions.
- Classic Titanium compatibility:
deviceInfo()works without Alloy dependencies.
v7.2.7
- Security fixes for command injection in
globand prototype pollution injs-yaml. - Dependency cleanup reduced installation size by about 45MB and removed unused packages.
- Titanium SDK 13.1.0.GA: new utility classes for
navBarColor,forceBottomPosition, andmultipleWindows.
v7.2.6
- Updated Font Awesome to version 7.1.0
- Simplified flag property names in utilities.tss