Labs/Ubiquity/Skins/

From MozillaWiki
< Labs‎ | Ubiquity
Revision as of 03:37, 21 November 2008 by Abimanyuraja (talk | contribs) (Replaced old css with the new default skin css)
Jump to navigation Jump to search

Introduction

Skinning Ubiquity is easy. Firefox supports CSS3, which also adds a great number of features to make styling dependent on CSS alone easier.

Ubiquity styles are managed by a single CSS file that also contains metadata.

A set of elements and their descriptions from each is listed below.

Metadata

 /*
   =skin=
   @name Default
   @author Mozilla Labs
   @homepage http://labs.mozilla.com
   @email abimanyuraja@gmail.com
   @license MPL/LGPL/GPL
   =/skin=
 */

Anywhere in your CSS file, you should describe the metadata in a format like above. All fields are optional but if you choose not to name your skin, the user will see a randomized name (and may never figure out which skin is yours).

CSS Elements

#cmd-panel

Formatting for the actual popup layer.

#cmd-entry-container

Container for the entry box. Padding properties for around the box, for the most part.

#cmd-entry

Actual entry box. Fonts, padding, backgrounds, etc. All controlled here.

#cmd-preview

The container for the rest of the items, i.e. verb suggestions + preview pane.


#ubiquity-preview

As of now, contains the width of the preview window.

div#ubiquity-preview .gresult
Manages each Google search result.
div#ubiquity-preview .gresult a
The anchor properties of the Google search results, in this case, the title of the page.
div#ubiquity-preview .gresult-url
The properties for the URL showed under the description.
div#ubiquity-preview .gresult-content
The description properties for the Google result.

div#ubiquity-preview #preview-pane

The properties of the pane itself, such as borders, etc.

div#ubiquity-preview .hilited-text
Manages the currently selected verb/function's text property.
div#ubiquity-preview .hilited
Manages the currently selected verb/function's area; think of this as a hover property.
div#ubiquity-preview .suggested
The properties for the list of functions (i.e. google, wikipedia), those not selected.
div#ubiquity-preview .needarg
The property that manages the variables of different verb/functions. For example, the (message) and (to contact) areas in the "email" verb.
div#ubiquity-preview .cmdicon
The properties for the icon division, such as Google's "g."
div#ubiquity-preview img
The properties per icon image.

Example Skin


/*
  =skin=
  
  @name Default
  @author Yatrik Solanki
  @homepage http://www.yatriksolanki.com
  @email yatriksolanki@gmail.com
  @license MPL/LGPL/GPL
  
  =/skin=
*/


/* Formatting for the Ubiquity Pop-Up */


#cmd-panel {
  padding: 0px;
  margin: 10px;
  background: rgba(0%, 0%, 0%, 0.8);
  -moz-border-radius: 20px;
  -moz-border-radius-topleft: 0px;
}

#cmd-entry-container {
  margin: 8px;
  padding: 3px;
  font-size: 14pt;
  border: 0px solid #aaa;
  -moz-border-radius: 0px;
  background: transparent;
  font-family: Calibri, Helvetica, Verdana, Arial;
}

#cmd-entry {
  -moz-appearance: none;
  background: transparent;
  border: none;
  font-size: 18pt;
  color: #ffffff;
  width: 100%;
  font-weight: bold;
  font-family: Calibri, Helvetica, Verdana, Arial;
}

#cmd-preview {
  -moz-appearance: none;
  border: none;
  margin: 10px;
  overflow: hidden;
}


body#previewbody {
    margin: 0;
    padding: 0;
    color: #BBB;
}

#ubiquity-preview {
    width: 500px;
}

/* Formatting for the Preview box */

div#ubiquity-preview .help {
  font-family: Calibri, Helvetica, Verdana, Arial;
  font-size: 11pt;
  color: #FFF;
}

div#ubiquity-preview .gresult {
  margin-bottom: 10px;
}

div#ubiquity-preview .gresult a {
  color: #FFFFFF;
  text-decoration: underline;
  font-size: 14pt;
  font-family: Calibri, Helvetica, Verdana, Arial;
  cursor: pointer;
}
div#ubiquity-preview .gresult-url {
  font-size: x-small;
  font-family: Calibri, Helvetica, Verdana, Arial;
  color: #777;
}
div#ubiquity-preview .gresult-content {
  margin-right: 10px;
  font-family: Calibri, Helvetica, Verdana, Arial;
  font-size: small;  
}

div#ubiquity-preview.img {
    padding: 5px;
}

/* Formatting for the Preview Pane and Verb/Command suggestion list */

div#ubiquity-preview #preview-pane {
    color: #ffffff;
    background: transparent;
    padding-left: 15px;
    padding: 7px;
    border-top: 1px solid #333;
    margin-top: 5px;
    font-family: Calibri, Helvetica, Verdana, Arial;
    font-size: 11pt;
} 


div#ubiquity-preview .hilited-text {
    font-color: #FFF;
    font-family: Calibri, Helvetica, Verdana, Arial;
}

div#ubiquity-preview .hilited {
    padding: 5px;
    margin: 2px;
    background: rgba(100%, 100%, 100%, 0.3);
    -moz-border-radius: 5px;
    color: #FFF;
}


div#ubiquity-preview .suggested {
    margin: 2px;
    padding: 5px;
    border-left: solid 10px transparent;
    font-family: Calibri, Helvetica, Verdana, Arial;
    color: #FFF;
}

div#ubiquity-preview .needarg {
    font-style: oblique;
    color: #999999;
}
div#ubiquity-preview .cmdicon {
    display: inline-block;
    width: 16px;
}
div#ubiquity-preview .cmdicon img {
    vertical-align: middle;
    width: 16px;
    height: 16px;
}


Skins and the Herd

As of now, there are plans to implement skin listing in the Herd. Updates will follow as they happen.