stylus / nib

Stylus mixins, utilities, components, and gradient image generation
http://stylus.github.io/nib
MIT License
1.91k stars 249 forks source link

What are hide-text() and replace-text() for? #261

Open incompl opened 10 years ago

incompl commented 10 years ago

I noticed these undocumented mixins and I wanted to add them to the docs. However, I'm not actually sure how people use them. I noticed they're copied from Compass, but their docs don't really explain the use case either. Any insights?

incompl commented 10 years ago

Same for color-image(color). What does it do?

notslang commented 9 years ago

For hide-text, see #106 for a bit of relevant discussion... the idea is if you want text to be in the element, because it belongs there for content-related reasons (like screen-readers & search-engines & text-based browsers), but in browsers you want to hide it for style reasons... like replacing it with an image (which brings me to replace-text).

For replace-text, see #107 .. It just augments hide-text with background-setting abilities. Back before we had powerful text-styling abilities (like text-shadows & easy-to-use font support), replacing text with an image was actually a common thing to do. Here's an example.

Nowadays, doing this is just about inexcusable, so we could probably deprecate replace-text. hide-text might still be useful tho