Websites/Mozilla.org/One Mozilla/Documentation/Tabzilla

From MozillaWiki
Jump to: navigation, search

Tabzilla

Summary: Tabzilla is the universal tab displayed on Mozilla websites.

Available on Github: Tabzilla

Adding Tabzilla

To put Tabzilla on your site:

Add the static tab link (example below) to the top of your template

   <a href="http://www.mozilla.org/" id="tabzilla">mozilla</a>

Include the tabzilla.css CSS file either as a CSS include or built into your minified styles

   <link href="//www.mozilla.org/tabzilla/media/css/tabzilla.css" rel="stylesheet" />

Include the tabzilla.js file in your template (preferably in the footer)

   <script src="//www.mozilla.org/tabzilla/media/js/tabzilla.js"></script>

Requirements

As the universal tab does inject HTML/CSS into the DOM, some there are some requirements that must be met by including sites.

  • Background images must not be attached to the <body> element.
  • Absolutely positioned elements must not be positioned relative to the <body> element.
  • An element other than the <body> should add a 2 pixel white border to the top of the page (border-top: 2px solid #fff;)

Any background image or absolutely positioned element attached to the body element would not move with the rest of the contents when the tab slides open.

Instead, any such background or element should be attached to another HTML element in the page (a wrapper div, for example). Note that this issue does not apply to solid background colors, or backgrounds that do not vary vertically (solid vertical stripes, for example).

Testing Bookmarklet

To test the universal tab on your Mozilla website, create a new bookmark with the contents of this file as the Location. Then, click this bookmarklet while on one of your pages to see how the tab will appear on your site.

Note the following limitations of the bookmarklet:

  • The tab is aligned to the top right of the viewport, not the top-right of your layout, as it should be.
  • The tab has a float:left; which may interfere with other content on your page, or slip behind other elements and be invisible.

Roadmap

Q1 2012, Launch Tabzilla on major websites:

  • mozilla.org
  • mozilla.org/firefox
  • addons.mozilla.org
  • support.mozilla.org
  • webfwd.org
  • mozillalabs.com

Q2 2012, Refine Tabzilla

  • snippets integration
  • accessibilty improvements
  • l10n

Bugs

Bug 723562 - Add snippets functionality