compass/examples/compass/utilities.html.haml
Chris Eppstein 3d909ceda9 [Compass Core] Cross browser ellipsis mixin.
Since this requires the installation of an additional xml file for
firefox support, it is provided as a pattern.

To install:
compass -p ellipsis

To use:
Mix +ellipsis into a selector targeting the textual element that will
truncate via ellipsis. By default, ellipsis text is set tono-wrap. Pass
false as the first argument if you don't want that.

Note:
Firefox is the lame browser in this respect, it requires a lot of bending
over backwards and has many quirky behaviors. Please read the blog post at
http://mattsnider.com/css/css-string-truncation-with-ellipsis/ for a full
explanation of the issues. Also note that ellipsis text is white-space
sensitive in Firefox, an issue that is sure to affect Haml users more than
most.
2009-07-06 07:18:25 -07:00

190 lines
6.7 KiB
Plaintext

!!! Transitional
%html{:xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en"}
%head
%meta{'http-equiv' => "content-type", :content => "text/html;charset=UTF-8"}
%title Compass Utilities Example
%link{:rel=>"stylesheet", :href=>"stylesheets/utilities.css", :type=>"text/css", :media=>"screen, projection"}
%body
#utilities
%h1 Compass Utilities Demo
#links
.example
%h2 Link Styling
%ul
%li.normal
%a{:href => "#normal-link"} This is a link, nothing special about it.
%li.hover
%a{:href => '#hover-link'}
This is underlined when hovered because it is using the
%code.mixin +hover-link
mixin.
%li.colored
%a{:href => '#colored-link'}
This should have different colors
because it is using the
%code.mixin +link-colors
mixin.
%li.unstyled
This is some text
%a{:href => '#unstyled-link'} with a link in it.
But you shouldn't see it
because it is using the
%code.mixin +unstyled-link
mixin.
#tag-cloud
.example
%h2 Tag Cloud
%p
This tag cloud is actually an ordered list so that the markup semantics are correct.
It demonstrates the following mixins:
%ul
%li
%code.mixin +inline-list
%li
%code.mixin +tag-cloud(1em)
%li
%code.mixin +no-bullets
%ol
%li.xxs lorem
%li.xs ipsum
%li.s dolor
%li sit
%li.l amet
%li.xl consectetur
%li.xxl adipisicing
%li.xs elit
%li.s sed
%li.l eiusmod
%li.xxl tempor
%li.xxs incididunt
%li labore
%li.xs dolore
%li magna
%li.xl aliqua
#lists
.example
%h2 Lists
.p
This text contains
%ul.inline
%li a
%li list
%li that
%li is
%li completely
%li inline
so be semantic!
My favorite colors are:
%ul.comma-delimited
%li red
%li yellow
%li blue
%ol.pretty
%li
This uses the
%code.mixin +pretty-bullets
mixin.
%li Do you like them?
%li If you don't...
%li Make them yourself!
#tables
.example
%h2 Tables
%p
This table is styled using
%code.mixin +alternating-rows-and-columns(#F9E5A7,#CEFBB3,#222)
The first colors are the even/odd colors respectively
and the last argument is a shade that is subtracted from those
colors for the even columns.
%p
The borders are created using
%code.mixin +outer-table-borders(2px, #151A99)
and
%code.mixin +inner-table-borders(1px, #151A99)
%table.alternating{:cellspacing => 0, :cellpadding => 0, :border => 0}
%thead
%tr
%th  
%th.even Header #1
%th.odd Header #2
%th.even Header #3
%tr.odd
%th Row #1
%td.numeric.even 1.1
%td.numeric.odd 1.2
%td.numeric.even 1.3
%tr.even
%th Row #2
%td.numeric.even 2.1
%td.numeric.odd 2.2
%td.numeric.even 2.3
%tr.odd
%th Row #3
%td.numeric.even 3.1
%td.numeric.odd 3.2
%td.numeric.even 3.3
%tr.even
%th Row #4
%td.numeric.even 4.1
%td.numeric.odd 4.2
%td.numeric.even 4.3
%tr.odd.last
%th Row #5
%td.numeric.even 5.1
%td.numeric.odd 5.2
%td.numeric.even 5.3
%tfoot
%tr
%th Totals
%td.numeric.even 15.5
%td.numeric.odd 16.0
%td.numeric.even 17.5
#ellipsis
.example
%h2 Ellipsis
%p This long text is truncated at the end of the first line. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
#floats
.example
%h2 Floats
%p
The float helpers add fixes for the double-margin float
bug, so you don't need to remember.
%p
Floated elements will extend beyond the bottom boundary of their
parent container unless a
%code.mixin +clearfix
is applied to the parent.
%p
The regular
%code.mixin +clearfix
method uses overflow:hidden. This is a simple and reliable way to
get your box wrapped around your float elements.
.clearfix-example
.float-left-example
This div is styled with
%code.mixin +float-left
\. It is taller than its parent and it should be 20px from the left edge.
.float-right-example
This short div is styled with
%code.mixin +float-right
and it should be 20px from the right edge, even in IE6.
This div is styled with
%code.mixin +clearfix
%p
An alternate clearing method is provided for when elements need
to be positioned to hang outside the box. This is based on the
\:after content method.
.pie-clearfix-example
.float-left-example
This div is styled with
%code.mixin +float-left
\. It is taller than its parent and it should be 20px from the left edge.
.float-right-example
This short div is styled with
%code.mixin +float-right
and it should be 20px from the right edge, even in IE6.
This div is styled with
%code.mixin +pie-clearfix
.positioned-example
Using this clear method, this positioned box is not cut off.