[TxMt] web preview question

Rob McBroom mailinglist0 at skurfer.com
Fri Aug 20 20:08:43 UTC 2010


The fancy “new” web preview, not the built-in boring one. :)

I'm trying to create my own theme for the web preview and I have a couple of questions. I've got CSS in `~/Library/Application Support/TextMate/Themes/Webpreview/Liberation/style.css`. Among other things, it contains this:

    body {
      background: #FAF4DC;
      font-family: "Liberation Sans";
    }
    pre, code {
      font-family: "Liberation Mono";
    }

So, my first question is: Why does this font get applied to all themes and not just when I select “Liberation” from the drop-down?

Second question…

I'm a plain-text e-mail guy, but on occasion, I'll want to copy and paste something out of the web preview (generated using Markdown) to send to Windows/Outlook-using coworkers that don't care about standards. Since they probably won't have the Liberation fonts, I tried to add some fallbacks like this:

    body {
      background: #FAF4DC;
      font-family: "Liberation Sans, Helvetica Neue, sans-serif";
    }
    pre, code {
      font-family: "Liberation Mono, Consolas, monospace";
    }

This causes the font to be ignored completely and everything reverts to Times (again, in all themes). That should be valid CSS, so why does it break? Isn't this just being parsed by the system's WebKit?

Can I do what I'm trying to do? Thanks.

-- 
Rob McBroom
<http://www.skurfer.com/>




More information about the textmate mailing list