To help your add-on look and feel like Google Sheets,
Docs, or Forms, link in the CSS package below to apply Google styling to fonts,
buttons, and form elements. For a sample of the CSS package in use, see the
add-ons quickstart. To use the CSS package, just
include the following at the top of each HTML file:
Note that the style for form elements cannot be completely controlled in all
browsers. In particular, <select> elements display some visual artifacts in
Firefox and Internet Explorer, although they still work properly. To see what
the styles look like in a given browser, simply load this page in that browser.
Use Arial for all text, in the following styles depending on use:
Use and appearance
Markup with CSS package
<h1>Titles and headers</h1>
<b>Bold text</b>
Normal text
<a href="">Links</a>
<span class="current">Current navigation selection</span>
<span class="error">Form input errors</span>
<span class="gray">Gray text</span>
<span class="secondary">Secondary text</span>
Buttons
You can use any of the standard types of buttons — <button>,
<input type="button">, or <input type="submit">, as well as
<a class="button">. Buttons that are horizontally adjacent will space
themselves out automatically. There are several colors available, for various
uses:
Sidebars can be tricky to style because while the height is variable, many
add-ons need to include a branding area that does not scroll. Below is a
simplified copy of the sidebar from the
add-on for Google Docs quickstart. If you drag
the bottom-right corner of the text area to make the content taller than the
sidebar, you'll see that the content area automatically scrolls, but the
branding at the bottom does not.
As you'll see, the example uses the sidebar class to apply the correct padding
and the bottom class to force the branding area to the bottom. A local class,
branding-below, then defines the area that the main area of the sidebar should
leave clear from the bottom.