Edit Textpattern’s CSS with an external editor

Summary:

A simple workaround to edit CSS in your preferred external editor instead of the Textpattern interface.

Before I started using Textpattern, my main web authoring tool was BBEdit. One of the biggest drawbacks to using Textpattern (or, as far as I can tell, any CMS) is having to do everything in web browser textareas. Editing text in textareas feels like one of those dreams where you are trying to get somewhere quickly, but you can barely move — it’s like wading through molasses. Recently I have been on a quest to come up with easy ways to do more of my Textpattern work in my favorite text editor instead.

One area where it’s easy to break out of the textarea is CSS. I have long since kept CSS files outside the database, through the simple expedient of @import statements. My Textpattern CSS forms typically look like this, in total:

@import "/css/base.css";
@import "/css/homepage.css";

allowing me to edit the actual files with BBEdit.

Of course you can also do this by ignoring the Textpattern style tab entirely. But using the @import statements, as above, allows you to still use <txp:css /> to get section-specific stylesheets.

Posted 2008-01-30 (modified 2008-02-02)