Why does Mozilla look different on some apps?

Why does Mozilla look different on some apps?

Why does Mozilla look different to other GNOME and Gtk-based applications?

    Requires Free Membership to View

    When you register, my team of editors will also send you resources covering Linux administration and management; integration and interoperability between Linux, Windows and Unix; securing Linux and mixed-platform environments; and migrating to Linux.

    Cathleen A. Gagne, Senior Editorial Director

    By submitting your registration information to SearchEnterpriseLinux.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchEnterpriseLinux.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

Any X11 and Gtk-based program can set the colours used in its windows. If a program wants to fit in with the rest of the desktop, though, then it has to use the system of theme engines that Gtk supports. A theme engine serves up skinning information to any program smart enough to take advantage of it. Since the skinning information is the same for all theme-engine enabled programs, all such programs have some common visual elements.

In the Mozilla case, two theme engines are at work. There's the Gtk system, and then there's Mozilla's own skinning system, also called themes. The Mozilla theme engine is responsible for Mozilla-specific skins like Classic and Modern, as well as third party skins like SkyPilot. Each of these skins uses a generally fixed set of colours and images. To the Gtk theme engine, these Mozilla skins look like static information, so the theme engine adds nothing.

Mozilla's themes are built using CSS, and Mozilla has a new CSS style property called -moz-appearance. This extension forces Mozilla to consult the native theme engine (on Linux, the Gtk one) for skin information. By creating a Mozilla skin that makes use of this extension, the native theme information can "shine through" into Mozilla windows. In fact, the Classic skin uses -moz-appearance in several places, particularly in form elements and in scrollbars.

The Classic skin also sets some colours and images directly, in order to be familiar to older Netscape 4.x users. So there isn't a skin that perfectly shows the underlying Gtk theme yet. In fact, native theme support is only 95% ready in Mozilla at this time. We're not far away, though, from being able to create a Transparent skin that uses -moz-appearance across the whole range of GUI widgets. Mozilla currently relies on the Gtk 1.2 libraries. Many GNOME programs use Gtk 1.2, so that's not a big deal. When Gtk 2.0 is supported though, Mozilla will come even closer to the look and feel of other GNOME tools.

This was first published in March 2004