From 94083e82e1a67b305981981ef204f4b71511802e Mon Sep 17 00:00:00 2001 From: Andrew Vit Date: Thu, 2 Oct 2008 11:47:01 -0700 Subject: [PATCH] Introduced replace-text mixin for showing images in place of HTML text. --- Manifest | 1 + .../compass/stylesheets/compass/utilities/_text.sass | 1 + .../stylesheets/compass/utilities/text/_replacement.sass | 8 ++++++++ 3 files changed, 10 insertions(+) create mode 100644 frameworks/compass/stylesheets/compass/utilities/text/_replacement.sass diff --git a/Manifest b/Manifest index 748cc957..4b45ac3c 100644 --- a/Manifest +++ b/Manifest @@ -80,6 +80,7 @@ frameworks/compass/stylesheets/compass/utilities/lists/_horizontal_list.sass frameworks/compass/stylesheets/compass/utilities/lists/_inline_list.sass frameworks/compass/stylesheets/compass/utilities/tables/_alternating_rows_and_columns.sass frameworks/compass/stylesheets/compass/utilities/text/_nowrap.sass +frameworks/compass/stylesheets/compass/utilities/text/_replacement.sass frameworks/compass/templates/project/grid.png frameworks/compass/templates/project/ie.sass frameworks/compass/templates/project/print.sass diff --git a/frameworks/compass/stylesheets/compass/utilities/_text.sass b/frameworks/compass/stylesheets/compass/utilities/_text.sass index c7e0c6c4..6d130f32 100644 --- a/frameworks/compass/stylesheets/compass/utilities/_text.sass +++ b/frameworks/compass/stylesheets/compass/utilities/_text.sass @@ -1 +1,2 @@ @import text/nowrap.sass +@import text/replacement.sass diff --git a/frameworks/compass/stylesheets/compass/utilities/text/_replacement.sass b/frameworks/compass/stylesheets/compass/utilities/text/_replacement.sass new file mode 100644 index 00000000..c645ee69 --- /dev/null +++ b/frameworks/compass/stylesheets/compass/utilities/text/_replacement.sass @@ -0,0 +1,8 @@ +// Hides html text and replaces it with an image. +=replace-text( !img, !x = "50%", !y = "50%" ) + :display block + :text-indent -9999em + :overflow hidden + :background-image = url(!img) + :background-position = !x !y + :background-repeat no-repeat