3

I'm a friend clean GUI's. Unfortunately I need to overwrite the "chrome://global/skin" stylesheets for some reason.

What's the best method, to implement different os-based stylesheets into xul-documents - eg. for GUI's like windows xp, windows aero or macosx aqua (overlay-aero.css, overlay-aqua.css...).

Does Mozilla provide any standards for os-based stylesheet-implementing?

Paolo Forgia
  • 6,572
  • 8
  • 46
  • 58
mate64
  • 9,876
  • 17
  • 64
  • 96

2 Answers2

5

Without really knowing how you intend to overlay the styles: yes, the usual approach would be using manifest flags. For example, if you define a style overlay in your extension's chrome.manifest file, you would do it like this:

style chrome://browser/content/browser.xul chrome://myExtension/skin/overlay-win.css os=WINNT
style chrome://browser/content/browser.xul chrome://myExtension/skin/overlay-osx.css os=Darwin
style chrome://browser/content/browser.xul chrome://myExtension/skin/overlay-linux.css os=Linux

You can also use Mozilla-specific media features to distinguish between different themes of one OS in your stylesheet. For example:

@media all and (-moz-windows-classic)
{
  ...
}
@media all and (-moz-windows-theme: aero)
{
  ...
}
@media all and (-moz-windows-compositor)
{
  ...
}
Wladimir Palant
  • 56,865
  • 12
  • 98
  • 126
0

Sounds to me like you want to create your own Firefox Theme (essential an extension made up of CSS files and images that replace the standard look of the browser). There's a whole section about this on Mozilla Development Center: https://addons.mozilla.org/en-US/developers/docs/how-to/theme-development

Matthew Gertner
  • 4,487
  • 2
  • 32
  • 54
  • thank you, Matthew. You're wrong, I do not want to create "another theme". It's for a complex extension. For example: I display two groupboxes in aero in a simple row `(display: table-cell;)` - but this solution looks stupid in macosx. How can I implement a aero.css-file only for aero users? – mate64 Sep 06 '11 at 06:35