Loading...

dev-extensions@lists.mozilla.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Any Point To class and style on XUL iframe? Jonathan Protzenko Wed Feb 22 08:01:53 2012

I guess https://github.com/protz/GMail-Conversation-View/wiki/Fonts applies to your case, since the Conversations UI also comes inside a XUL iframe.

The interface of Thunderbird is styled to use sans-serif, and when outputting a message, we add special CSS classes ("moz-txt-plain" for instance) so that the message displays in sans-serif, but the contents of a XUL iframe remain a *web page*, and therefore, are subject to the same restrictions that any web page in, say, Firefox : the default font is that chosen in the font preferences dialog. (Preferences > Display > Formatting > Advanced). Web pages style their contents with CSS such as:

html {
 font-family: sans-serif;
}

If you want the same for you iframe, you need to explicitly say so, or have your addon flip the default font preferences (that's a bad idea, though).

jonathan

On Wed 22 Feb 2012 04:40:17 PM CET, [EMAIL PROTECTED] wrote:
alta88[nntp] wrote:



---On 2012.Feb.21 5:42 PM, [EMAIL PROTECTED] wrote:
My addon has an iframe in a dialog in which I am displaying an xhtml
help file that is located in the contents folder.

I have tried specifying a class attribute on the iframe in an effort to
style the xhtml (for example the font-family to use). I get no joy.
So I
alternatively tried specifying a style attribute on the iframe to reach
the same result. Again no joy.

Are these attributes basically ignored? If so, is there some way to
communicate this style information into the iframe by my addon?

Thanks

your xhtml needs something like:

<head>
..
<link rel="stylesheet" type="text/css" media="all"
href="chrome://myext/skin/mycss.css"/>
..
</head>

nothing on the iframe will apply to the iframe's document. plus,
using a style attribute is poor form (imo).

Well that works and gets me part of the way there. Perhaps you can
tell me how to over come this...

The font family used by TB in the XUL elements also on the dialog
which includes the iframe show up in a font that is sans-serif. I am
guessing this comes somehow from OS settings as the remainder of the
TB interface is in sans-serif (which I prefer). But for some reason,
the xhtml in the iframe is rendered using a serif font of some sort. I
don't know why this is. What I really want is to have the xhtml get
rendered in whatever font is used for the rest of the dialog. It looks
rather strange to have just this one widget displaying a different
font. ANy ideas? Thanks
_______________________________________________
dev-extensions mailing list
[EMAIL PROTECTED]
https://lists.mozilla.org/listinfo/dev-extensions
_______________________________________________
dev-extensions mailing list
[EMAIL PROTECTED]
https://lists.mozilla.org/listinfo/dev-extensions