Sha256: 6d0639b0e13dc268d24f60f277413cea7060662d0d1e7df5a2a992b5eb5b5f12

Contents?: true

Size: 1.16 KB

Versions: 48

Compression:

Stored size: 1.16 KB

Contents

// Hides html text and replaces it with an image.
// If you use this on an inline element, you will need to change the display to block or inline-block.
// Also, if the size of the image differs significantly from the font size, you'll need to set the width and/or height.
//
// Parameters:
//
// * `img` -- the relative path from the project image directory to the image.
// * `x` -- the x position of the background image.
// * `y` -- the y position of the background image.
@mixin replace-text($img, $x: 50%, $y: 50%) {
  @include hide-text;
  background: {
    image: image-url($img);
    repeat: no-repeat;
    position: $x $y;
  };
}

// Like the `replace-text` mixin, but also sets the width
// and height of the element according the dimensions of the image.
@mixin replace-text-with-dimensions($img, $x: 50%, $y: 50%) {
  @include replace-text($img, $x, $y);
  width: image-width($img);
  height: image-height($img);
}

// Hides text in an element so you can see the background.
@mixin hide-text {
  $approximate_em_value: 12px / 1em;
  $wider_than_any_screen: -9999em;
  text-indent: $wider_than_any_screen * $approximate_em_value;
  overflow: hidden;
  text-align: left;
}

Version data entries

48 entries across 45 versions & 5 rubygems

Version Path
frontsau-0.0.3 lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss
frontsau-0.0.3 lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_replacement.scss
frontsau-0.0.2 lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_replacement.scss
frontsau-0.0.2 lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss
frontsau-0.0.1 lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss
frontsau-0.0.1 lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_replacement.scss
concen-0.2.9 app/assets/stylesheets/concen/compass/typography/text/_replacement.scss
concen-0.2.8 app/assets/stylesheets/concen/compass/typography/text/_replacement.scss
radiant-1.0.0 ruby-debug/ruby/1.8/gems/compass-0.11.7/frameworks/compass/stylesheets/compass/typography/text/_replacement.scss
compass-0.12.rc.1 frameworks/compass/stylesheets/compass/typography/text/_replacement.scss
compass-0.12.rc.0 frameworks/compass/stylesheets/compass/typography/text/_replacement.scss
concen-0.2.7 app/assets/stylesheets/concen/compass/typography/text/_replacement.scss
compass-0.11.7 frameworks/compass/stylesheets/compass/typography/text/_replacement.scss
compass-0.12.alpha.4 frameworks/compass/stylesheets/compass/typography/text/_replacement.scss
compass-0.12.alpha.3 frameworks/compass/stylesheets/compass/typography/text/_replacement.scss
compass-0.11.6 frameworks/compass/stylesheets/compass/typography/text/_replacement.scss
concen-0.2.6 app/assets/stylesheets/concen/compass/typography/text/_replacement.scss
compass-0.12.alpha.2 frameworks/compass/stylesheets/compass/typography/text/_replacement.scss
compass-0.12.alpha.1 frameworks/compass/stylesheets/compass/typography/text/_replacement.scss
concen-0.2.5 app/assets/stylesheets/concen/compass/typography/text/_replacement.scss