From 27cbe7f63a13fad987dc2547ef5b6f526ceb268c Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Mon, 17 Oct 2011 14:17:29 -0700 Subject: [PATCH] add abbr styles, overhaul type docs section to remove lots of verbose text and put emphasis on tables and more scannable content --- bootstrap.css | 11 +- bootstrap.min.css | 5 +- docs/assets/css/docs.css | 5 + docs/index.html | 349 ++++++++++++++++++++------------------- lib/type.less | 11 +- 5 files changed, 210 insertions(+), 171 deletions(-) diff --git a/bootstrap.css b/bootstrap.css index 3731eaf0ba..f3ff894d1a 100644 --- a/bootstrap.css +++ b/bootstrap.css @@ -6,7 +6,7 @@ * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. - * Date: Mon Oct 17 12:44:52 PDT 2011 + * Date: Mon Oct 17 14:16:58 PDT 2011 */ /* Reset.less * Props to Eric Meyer (meyerweb.com) for his CSS reset file. We're using an adapted version here that cuts out some of the reset HTML elements we will never need here (i.e., dfn, samp, etc). @@ -367,6 +367,7 @@ h5, h6 { font-weight: bold; color: #404040; + text-rendering: optimizelegibility; } h1 small, h2 small, @@ -388,7 +389,7 @@ h2 { line-height: 36px; } h2 small { - font-size: 14px; + font-size: 18px; } h3 { line-height: 27px; @@ -466,6 +467,12 @@ em { .muted { color: #bfbfbf; } +abbr { + font-size: 90%; + text-transform: uppercase; + border-bottom: 1px dotted #ddd; + cursor: help; +} blockquote { margin-bottom: 18px; border-left: 5px solid #eee; diff --git a/bootstrap.min.css b/bootstrap.min.css index 4fca75703e..86b68e44a7 100644 --- a/bootstrap.min.css +++ b/bootstrap.min.css @@ -63,9 +63,9 @@ a{color:#0069d6;text-decoration:none;line-height:inherit;font-weight:inherit;}a: .offset10{margin-left:820px;} .offset11{margin-left:900px;} p{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;margin-bottom:9px;}p small{font-size:11px;color:#bfbfbf;} -h1,h2,h3,h4,h5,h6{font-weight:bold;color:#404040;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{color:#bfbfbf;} +h1,h2,h3,h4,h5,h6{font-weight:bold;color:#404040;text-rendering:optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{color:#bfbfbf;} h1{font-size:30px;line-height:36px;}h1 small{font-size:18px;} -h2{font-size:24px;line-height:36px;}h2 small{font-size:14px;} +h2{font-size:24px;line-height:36px;}h2 small{font-size:18px;} h3{line-height:27px;font-size:18px;}h3 small{font-size:14px;} h4{font-size:16px;line-height:36px;}h4 small{font-size:12px;} h5{font-size:14px;line-height:18px;} @@ -83,6 +83,7 @@ hr{margin:20px 0 19px;border:0;border-bottom:1px solid #eee;} strong{font-style:inherit;font-weight:bold;} em{font-style:italic;font-weight:inherit;line-height:inherit;} .muted{color:#bfbfbf;} +abbr{font-size:90%;text-transform:uppercase;border-bottom:1px dotted #ddd;cursor:help;} blockquote{margin-bottom:18px;border-left:5px solid #eee;padding-left:15px;}blockquote p{font-size:14px;font-weight:300;line-height:18px;margin-bottom:0;} blockquote small{display:block;font-size:12px;font-weight:300;line-height:18px;color:#bfbfbf;}blockquote small:before{content:'\2014 \00A0';} address{display:block;line-height:18px;margin-bottom:18px;} diff --git a/docs/assets/css/docs.css b/docs/assets/css/docs.css index 2af7764e65..bbf71ab778 100644 --- a/docs/assets/css/docs.css +++ b/docs/assets/css/docs.css @@ -307,6 +307,11 @@ pre.prettyprint { max-width: 100%; } +/* Make tables spaced out a bit more */ +h2 + table { + margin-top: 10px; +} + /* Responsive Docs -------------------------------------------------- */ @media (max-width: 480px) { diff --git a/docs/index.html b/docs/index.html index ab33ea23cf..2e0036bb09 100644 --- a/docs/index.html +++ b/docs/index.html @@ -406,90 +406,130 @@

Typography Headings, paragraphs, lists, and other inline type elements

+

Headings & body copy

+
-

Headings & copy

-

A standard typographic hierarchy for structuring your webpages.

+

Typographic scale

The entire typographic grid is based on two Less variables in our preboot.less file: @baseFontSize and @baseLineHeight. The first is the base font-size used throughout and the second is the base line-height.

We use those variables, and some math, to create the margins, paddings, and line-heights of all our type and more.

-

h1. Heading 1

-

h2. Heading 2

-

h3. Heading 3

-

h4. Heading 4

-
h5. Heading 5
-
h6. Heading 6
+

Example body text

+

Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula ut id elit.

+

Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec sed odio dui.

-

Example paragraph

-

Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula ut id elit.

-

Example heading Has sub-heading…

+
+

h1. Heading 1

+

h2. Heading 2

+

h3. Heading 3

+

h4. Heading 4

+
h5. Heading 5
+
h6. Heading 6
+
+

Emphasis, address, and abbreviation

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ElementDescriptionUsage
+ <strong> + + For emphasizing a snippet of text with important + + None +
+ <em> + + For emphasizing a snippet of text with stress + + None +
+ <abbr> + + Wraps abbreviations and acronyms to show the expanded version on hover + + Include optional title for expanded text +
+ <address> + + For contact information for its nearest ancestor or the entire body of work + + Preserve formatting by ending all lines with <br> +
+
-
-

Misc. elements

-

Using emphasis, addresses, & abbreviations

-

- <strong> - <em> - <address> - <abbr> -

-
-
-

When to use

-

Emphasis tags (<strong> and <em>) should be used to indicate additional importance or emphasis of a word or phrase relative to its surrounding copy. Use <strong> for importance and <em> for stress emphasis.

-

Emphasis in a paragraph

+
+

Using emphasis

Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Maecenas faucibus mollis interdum. Nulla vitae elit libero, a pharetra augue.

-

Note: It's still okay to use <b> and <i> tags in HTML5 and they don't have to be styled bold and italic, respectively (although if there is a more semantic element, use it). <b> is meant to highlight words or phrases without conveying additional importance, while <i> is mostly for voice, technical terms, etc.

-

Addresses

-

The <address> element is used for contact information for its nearest ancestor, or the entire body of work. Here are two examples of how it could be used:

- -
-
-
- Twitter, Inc.
- 795 Folsom Ave, Suite 600
- San Francisco, CA 94107
- P: (123) 456-7890 -
-
-
-
- Full Name
- first.last@gmail.com -
-
-
- -

Note: Each line in an <address> must end with a line-break (<br>) or be wrapped in a block-level tag (e.g., <p>) to properly structure the content.

-

Abbreviations

-

For abbreviations and acronyms, use the <abbr> tag (<acronym> is deprecated in HTML5). Put the shorthand form within the tag and set a title for the complete name.

+

Note: Feel free to use <b> and <i> in HTML5, but their usage has changed a bit. <b> is meant to highlight words or phrases without conveying additional importance while <i> is mostly for voice, technical terms, etc.

-
+
+

Example addresses

+

Here are two examples of how the <address> tag can be used:

+
+ Twitter, Inc.
+ 795 Folsom Ave, Suite 600
+ San Francisco, CA 94107
+ P: (123) 456-7890 +
+
+ Full Name
+ first.last@gmail.com +
+
+
+

Example abbreviations

+

Abbreviations are styled with uppercase text and a light dotted bottom border. They also have a help cursor on hover so users have extra indication something will be shown on hover.

+

HTML is the best thing since sliced bread.

+

An abbreviation of the word attribute is attr.

+
+
+ +

Blockquotes

-
-

Blockquotes

-

- <blockquote> - <p> - <small> -

-
-
-

How to quote

+

To include a blockquote, wrap <blockquote> around <p> and <small> tags. Use the <small> element to cite your source and you'll get an em dash &mdash; before it.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.

Dr. Julius Hibbert
+
+
 <blockquote>
   <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.</p>
@@ -497,8 +537,9 @@
 </blockquote>
 
-
+
+

Lists

@@ -522,7 +563,7 @@
-

Unstyled <.unstyled>

+

Unstyled <ul.unstyled>

  • Lorem ipsum dolor sit amet
  • Consectetur adipiscing elit
  • @@ -570,120 +611,96 @@ -
    -
    -

    Code

    -

    - <code> - <pre> -

    -

    Pimp your code in style with two simple tags. For even more awesomeness through javascript, drop in Google's code prettify library and you're set.

    -
    -
    -

    Presenting code

    -

    Code, blocks of or just snippets inline, can be displayed with style just by wrapping in the right tag. For blocks of code spanning multiple lines, use the <pre> element. For inline code, use the <code> element.

    - - - - - - - - - - - - - - - + + +
    ElementResult
    <code>In a line of text like this, your wrapped code will look like this <html> element.
    <pre> + +

    Code Inline and block

    + + + + + + + + + + + + + + + - - - - + + + + - - -
    ElementResult
    <code>In a line of text like this, your wrapped code will look like this <html> element.
    <pre>
    <div>
       <h1>Heading</h1>
       <p>Something right here...</p>
     </div>
    -

    Note: Be sure to keep code within pre tags as close to the left as possible; it will render all tabs.

    -
    <pre class="prettyprint"> -

    Using the google-code-prettify library, you're blocks of code get a slightly different visual style and automatic syntax highlighting.

    +

    Note: Be sure to keep code within pre tags as close to the left as possible; it will render all tabs.

    +
    <pre class="prettyprint"> +

    Using the google-code-prettify library, you're blocks of code get a slightly different visual style and automatic syntax highlighting.

    <div>
       <h1>Heading</h1>
       <p>Something right here...</p>
     </div>
    -

    Download google-code-prettify and view the readme for how to use.

    -
    - - +

    Download google-code-prettify and view the readme for how to use.

    +
    -
    -
    -

    Inline labels

    -

    - <span class="label"> -

    -

    Call attention to or flag any phrase in your body text.

    -
    -
    -

    Label anything

    -

    Ever needed one of those fancy New! or Important flags when writing code? Well, now you have them. Here's what's included by default:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    LabelResult
    - <span class="label">Default</span> - - Default -
    - <span class="label success">New</span> - - New -
    - <span class="label warning">Warning</span> - - Warning -
    - <span class="label important">Important</span> - - Important -
    - <span class="label notice">Notice</span> - - Notice -
    -
    -
    +

    Inline labels for special attention

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    LabelsMarkup
    + Default + + <span class="label">Default</span> +
    + New + + <span class="label success">New</span> +
    + Warning + + <span class="label warning">Warning</span> +
    + Important + + <span class="label important">Important</span> +
    + Notice + + <span class="label notice">Notice</span> +
    diff --git a/lib/type.less b/lib/type.less index 28d893fb9e..4978dd7869 100644 --- a/lib/type.less +++ b/lib/type.less @@ -24,6 +24,7 @@ p { h1, h2, h3, h4, h5, h6 { font-weight: bold; color: @grayDark; + text-rendering: optimizelegibility; small { color: @grayLight; } @@ -39,7 +40,7 @@ h2 { font-size: 24px; line-height: @baseLineHeight * 2; small { - font-size: 14px; + font-size: 18px; } } h3 { @@ -134,6 +135,14 @@ em { color: @grayLight; } +// Abbreviations and acronyms +abbr { + font-size: 90%; + text-transform: uppercase; + border-bottom: 1px dotted #ddd; + cursor: help; +} + // Blockquotes blockquote { margin-bottom: @baseLineHeight;