Skip to content
This repository was archived by the owner on Aug 5, 2020. It is now read-only.

Latest commit

 

History

History

hide-text

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Hide Text

Hides text in an element so you can see the background, but still leaves it visible to screen readers.

This is based on Scott Kellum's Image Replacement technique but uses 110% for better coverage.

Note: This only works on block or inline-block elements and works best when a width is set.

@include hide-text($direction);

Parameters

$direction [string]

Default: right

Takes a value of either right or left to apply different types of text replacement. See the source for the different techniques.

Usage

.element {
    @include hide-text();
}

Output

.element {
    text-indent: 110%;
    white-space: nowrap;
    overflow: hidden;
}