More docs on the compass utilities.

This commit is contained in:
Chris Eppstein 2010-04-25 22:39:15 -07:00
parent 2475ac03e4
commit edd278cb2d
12 changed files with 82 additions and 54 deletions

View File

@ -13,4 +13,4 @@ classnames:
--- ---
- render 'reference' do - render 'reference' do
%p %p
Lorem ipsum dolor sit amet. Cross browser implementation of min-height and min-width.

View File

@ -1,5 +1,5 @@
--- ---
title: Compass Tag_cloud title: Compass Tag Cloud
crumb: Tag Cloud crumb: Tag Cloud
framework: compass framework: compass
stylesheet: compass/utilities/general/_tag-cloud.scss stylesheet: compass/utilities/general/_tag-cloud.scss
@ -11,6 +11,4 @@ classnames:
- core - core
- utilities - utilities
--- ---
- render 'reference' do = render 'reference'
%p
Lorem ipsum dolor sit amet.

View File

@ -5,6 +5,7 @@ framework: compass
stylesheet: compass/utilities/_links.scss stylesheet: compass/utilities/_links.scss
layout: core layout: core
nav_stylesheet: compass/_utilities.scss nav_stylesheet: compass/_utilities.scss
meta_description: Tools for styling anchor links.
classnames: classnames:
- reference - reference
- core - core
@ -12,4 +13,4 @@ classnames:
--- ---
- render 'reference' do - render 'reference' do
%p %p
Lorem ipsum dolor sit amet. Tools for styling anchor links.

View File

@ -4,12 +4,11 @@ crumb: Hover Link
framework: compass framework: compass
stylesheet: compass/utilities/links/_hover-link.scss stylesheet: compass/utilities/links/_hover-link.scss
layout: core layout: core
meta_description: Underline a link when you hover over it.
nav_stylesheet: compass/_utilities.scss nav_stylesheet: compass/_utilities.scss
classnames: classnames:
- reference - reference
- core - core
- utilities - utilities
--- ---
- render 'reference' do = render 'reference'
%p
Lorem ipsum dolor sit amet.

View File

@ -4,12 +4,11 @@ crumb: Link Colors
framework: compass framework: compass
stylesheet: compass/utilities/links/_link-colors.scss stylesheet: compass/utilities/links/_link-colors.scss
layout: core layout: core
meta_description: Easy assignment of colors to link states.
nav_stylesheet: compass/_utilities.scss nav_stylesheet: compass/_utilities.scss
classnames: classnames:
- reference - reference
- core - core
- utilities - utilities
--- ---
- render 'reference' do = render 'reference'
%p
Lorem ipsum dolor sit amet.

View File

@ -4,6 +4,7 @@ crumb: Unstyled Link
framework: compass framework: compass
stylesheet: compass/utilities/links/_unstyled-link.scss stylesheet: compass/utilities/links/_unstyled-link.scss
layout: core layout: core
meta_description: Make a link appear like regular text.
nav_stylesheet: compass/_utilities.scss nav_stylesheet: compass/_utilities.scss
classnames: classnames:
- reference - reference
@ -12,4 +13,4 @@ classnames:
--- ---
- render 'reference' do - render 'reference' do
%p %p
Lorem ipsum dolor sit amet. Makes a link appear like regular text.

View File

@ -4,6 +4,7 @@ crumb: Print
framework: compass framework: compass
stylesheet: compass/utilities/_print.scss stylesheet: compass/utilities/_print.scss
layout: core layout: core
meta_description: Control what elements gets printed.
nav_stylesheet: compass/_utilities.scss nav_stylesheet: compass/_utilities.scss
classnames: classnames:
- reference - reference
@ -11,5 +12,13 @@ classnames:
- utilities - utilities
--- ---
- render 'reference' do - render 'reference' do
%p :markdown
Lorem ipsum dolor sit amet. Control what gets printed. Apply the `no-print` (or `noprint`) class to any
elements that should be hidden when printing. Apply the `print-only` class
to those elements which should only appear in your printed pages.
The tricky part about `print-only` is getting the display right when you turn
an element back on in the case where both styles are applied. This mixin
uses the `elements-of-type` function to make sure that elements have the correct
display value according to the element type.

View File

@ -10,6 +10,5 @@ classnames:
- core - core
- utilities - utilities
--- ---
- render 'reference' do = render 'reference'
%p
Lorem ipsum dolor sit amet.

View File

@ -11,5 +11,20 @@ classnames:
- utilities - utilities
--- ---
- render 'reference' do - render 'reference' do
%p :markdown
Lorem ipsum dolor sit amet. **Example 1** Simple mixins:
a.twitter
+sprite-img("icons-32.png", 1)
a.facebook
+sprite-img("icons-32png", 2)
**Example 2** Sharing a common base:
a
+sprite-background("icons-32.png")
a.twitter
+sprite-column(1)
a.facebook
+sprite-row(2)

View File

@ -1,18 +1,17 @@
// Classes that are useful for controlling what gets printed. // Classes that are useful for controlling what gets printed.
// You must mix +print-utilities into your print stylesheet // You must mix `+print-utilities` into your print stylesheet
// and +print-utilities("screen") into your screen stylesheet. // and `+print-utilities(screen)` into your screen stylesheet.
// Note: these aren't semantic. // Note: these aren't semantic.
@mixin print-utilities($media: print) { @mixin print-utilities($media: print) {
@if $media == "print" { @if $media == print {
.noprint, .noprint, .no-print { display: none; }
.no-print { #{elements-of-type(block)} {
display: none; } &.print-only { display: block; }
#{elements-of-type("block")} { }
&.print-only { #{elements-of-type(inline)} {
display: block; } } &.print-only { display: inline; }
#{elements-of-type("inline")} { }
&.print-only { } @else {
display: inline; } } } .print-only { display: none; }
@else { }
.print-only { }
display: none; } } }

View File

@ -1,10 +1,16 @@
// Set all the colors for a link with one mixin call // Set all the colors for a link with one mixin call.
// Order of arguments is: // Order of arguments is:
// normal, hover, active, visited, focus //
// states not specified will inherit. // 1. normal
// Mixin like so: // 2. hover
// a // 3. active
// +link-colors(#00c, #0cc, #c0c, #ccc, #cc0) // 4. visited
// 5. focus
//
// Those states not specified will inherit.
// Mixin to an anchor link like so:
// a
// +link-colors(#00c, #0cc, #c0c, #ccc, #cc0)
@mixin link-colors($normal, $hover: false, $active: false, $visited: false, $focus: false) { @mixin link-colors($normal, $hover: false, $active: false, $visited: false, $focus: false) {
color: $normal; color: $normal;

View File

@ -1,18 +1,20 @@
//** // @doc off
// Example 1: // Example 1:
// a.twitter //
// +sprite-img("icons-32.png", 1) // a.twitter
// a.facebook // +sprite-img("icons-32.png", 1)
// +sprite-img("icons-32png", 2) // a.facebook
// ... // +sprite-img("icons-32png", 2)
//
// Example 2: // Example 2:
// a //
// +sprite-background("icons-32.png") // a
// a.twitter // +sprite-background("icons-32.png")
// +sprite-column(1) // a.twitter
// a.facebook // +sprite-column(1)
// +sprite-row(2) // a.facebook
// ... // +sprite-row(2)
// @doc on
$sprite-default-size: 32px !default; $sprite-default-size: 32px !default;