Using Sass with Titanium Alloy Style Sheets


Today, using CSS frameworks and preprocessors, like LESS and Sass, is an important part of efficient frontend development workflow. These new approaches allow us to use things like variables, mixins, inheritance and imports to make our CSS more flexible, more DRY, and more modular. In short, it makes writing CSS less of a pain.

What if you’re a Titanium developer? How can you harness the power of these CSS tools when styling your app using Alloy TSS?

STSS to the rescue!

STSS is a NPM package that brings the power of Sass into Titanium, allowing you to use all those sexy Sass features in your Titanium apps.

Getting started is easy:

npm install -g stss

I installed the package globally on my machine, but you can it locally in your project if you want. If you install globally like I did, add an Alloy pre-compile hook so that Titanium will compile the STSS files into TSS files before building the project.

To get that pre-compile hook set up, go to your project directory and do this:

stss --jmk

Once you’ve done that, you’re in business! Start naming your Alloy style sheets with a `.stss’ extension, and enjoy the wonderful power of Sass in your Titanium apps!

For more information, check out the official NPM package here. To learn about Sass and all the ways it’ll change your life, check out their site.

Related Posts

Required Reading for All Couples

If you're married, about to get married, or just committed to someone for a long period of time, these three books are absolutely required reading.

I Launched a New Podcast, and I Want You to Call In

I just launched a new podcast called Design By Committee, dedicated to answering your questions about UX, product design, content, strategy and anything else tech.

Shitty Sales Have Made Product Development Harder

Shitty, one-sided sales processes have made product development much more difficult for early stage startups.

Why I'm Cold Emailing You

You might have gotten a cold email from me. Tasteless? Some people think so. Here's why I'm doing it.

How I Found Your Email

I've been cold emailing a lot of people, and many folks are surprised that I found their email. Here's where I dug it up.

Sales is User Research, Undercover

Announcement: The Most Exciting Thing I've Done

Today, I'm announcing the most exciting project I've been involved with. It's called CrowdSync, and it helps to automate paperwork, communication and logistics when dealing with groups of people. Read on for why this is so big.

Three Ways to Start Talking to Users

How to Post to Private Slack Channels from Zapier

If you automate posting to Slack via Zapier, you might need to post to a private channel. It's not entirely obvious how to do it, but actually pretty damn easy.

A Peek Inside our UX Process