[TxMt] Re: web preview question

Martin Kühl martin.kuehl at gmail.com
Fri Aug 20 20:18:57 UTC 2010


On Fri, Aug 20, 2010 at 22:08, Rob McBroom <mailinglist0 at skurfer.com> wrote:
> The fancy “new” web preview, not the built-in boring one. :)

I'm not sure what you mean by that, for all I know the features you're
talking about are available in the built-in web preview…

> 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?

I forgot the reason, but you need to add classes to your selectors
like `.Liberation body`.

> 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?

I think you quote individual components in CSS, not the whole value,
so it would have to be `"Liberation Sans", "Helvetica Neue",
sans-serif;`.

HTH,
Martin



More information about the textmate mailing list