[TxMt] [ANN] CSS Preview command

Brad Choate bchoate at gmail.com
Fri May 12 18:17:58 UTC 2006


A couple of days ago I checked in a new CSS bundle command for doing  
a preview.  You can find this in the macromates.com subversion  
repository:

	http://anon:anon@macromates.com/svn/Bundles/trunk/Bundles/ 
CSS.tmbundle/Commands/Preview.plist

The goal was to generate a preview HTML page from the CSS rules  
declared.  It's not perfect, but it's a first stab at it.  I've seen  
similar functionality in TopStyle (for Windows) and a single-item  
preview in CSSEdit (for Mac). The command is bound to Ctrl+Option+Cmd 
+P.  Note that since it is scoped to source.css, hitting this key  
within an HTML document with the caret inside a CSS block will also  
invoke the CSS Preview.  If this happens, it will submit the contents  
of the CSS block as the input to the command (using the new 'Scope'  
input option). The command also works on a selection; so if you have  
a few CSS rules you want to preview, you can select them first.

Feedback as always is appreciated-- there are still some rough edges  
(ie, how to handle absolute-positioned rules or floats), but it's  
pretty useful to me already.

-Brad




More information about the textmate mailing list