diff --git a/examples/compass/src/utilities.sass b/examples/compass/src/utilities.sass index 92b15031..404a8d6d 100644 --- a/examples/compass/src/utilities.sass +++ b/examples/compass/src/utilities.sass @@ -3,6 +3,7 @@ @import yui/modules/base.sass @import blueprint/modules/grid.sass @import blueprint/modules/scaffolding.sass +@import compass/utilities/text/ellipsis.sass html +yui-base @@ -67,6 +68,12 @@ h2 +outer-table-borders(2px, #151A99) +inner-table-borders(1px, #151A99) +#ellipsis + +column(8, true) + td + width: 50% + +ellipsis + #floats +column(16) .clearfix-example diff --git a/examples/compass/utilities.html.haml b/examples/compass/utilities.html.haml index 0cd663e4..2fa72ab1 100644 --- a/examples/compass/utilities.html.haml +++ b/examples/compass/utilities.html.haml @@ -139,6 +139,10 @@ %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 diff --git a/frameworks/compass/stylesheets/compass/utilities/text/_ellipsis.sass b/frameworks/compass/stylesheets/compass/utilities/text/_ellipsis.sass new file mode 100644 index 00000000..01fc3fbc --- /dev/null +++ b/frameworks/compass/stylesheets/compass/utilities/text/_ellipsis.sass @@ -0,0 +1,13 @@ +// + This technique, by [Justin Maxwell](http://code404.com/), was originally + published at http://mattsnider.com/css/css-string-truncation-with-ellipsis/ + Firefox implementation by [Rikkert Koppes](http://www.rikkertkoppes.com/thoughts/2008/6/) + +=ellipsis(!no_wrap = true) + @if !no_wrap + white-space: nowrap + overflow: hidden + text-overflow: ellipsis + -o-text-overflow: ellipsis + -ms-text-overflow: ellipsis + -moz-binding= stylesheet_url("xml/ellipsis.xml#ellipsis") diff --git a/frameworks/compass/templates/ellipsis/ellipsis.sass b/frameworks/compass/templates/ellipsis/ellipsis.sass new file mode 100644 index 00000000..47d6fe68 --- /dev/null +++ b/frameworks/compass/templates/ellipsis/ellipsis.sass @@ -0,0 +1,6 @@ +@import compass/utilities/text/ellipsis.sass + +// You can delete this sass file if you want, it's just an example of how to use the ellipsis mixin. +// By default, ellipsis text is no-wrap. Pass false as the first argument if you don't want that. +.ellipsis + +ellipsis \ No newline at end of file diff --git a/frameworks/compass/templates/ellipsis/manifest.rb b/frameworks/compass/templates/ellipsis/manifest.rb new file mode 100644 index 00000000..de28fcec --- /dev/null +++ b/frameworks/compass/templates/ellipsis/manifest.rb @@ -0,0 +1,2 @@ +file 'xml/ellipsis.xml', :like => :css +stylesheet 'ellipsis.sass' \ No newline at end of file diff --git a/frameworks/compass/templates/ellipsis/xml/ellipsis.xml b/frameworks/compass/templates/ellipsis/xml/ellipsis.xml new file mode 100644 index 00000000..3f94b6e2 --- /dev/null +++ b/frameworks/compass/templates/ellipsis/xml/ellipsis.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file