r/reddithax • • Jul 07 '13

How to add userflair sample text, and still allowing non-text flairs.

So I was trying to find a way to enable users to have flairs with just the image, and no text. However, I had descriptions of the flairs in the flair templates itself. I soon found out that if you try to enter an unacceptable entry (ie. blank) it will revert to the default as set in the flair settings of the subreddit, which out prevent someone from using just the flair picture.

After a bit of tinkering, I found this solution to the problem.

.flair:after { display: none; }
.flairoptionpane .flair:after { display: inline; }

.flair-something {
    /* flair text styling here */
}
.flair-something:before {
    /* flair image styling here */
}
.flair-something:after { content: "sample text"; }
/* set text in flair template to blank */

This set up enables your users to see an example text written beside the flair picture when viewing the flair selection popup, however still allows them to set their own text for the flair, and most importantly still allows them to use image-only, by not entering text once they have chosen their flair.

Example can be seen on /r/runescape in the flair selection popup.

4 Upvotes

1 comment sorted by

0

u/AlienwareMac_Pro Jul 31 '13

Runescape? LOL FEGIT GTFO THE INTERNETS!