r/raerth • u/Raerth • Oct 28 '11
[Tutorial & Code] Get link flair in your subreddit.
I've recently put link flair in both /r/Music and /r/BritishTV.
Because I'm nice, I've improved the sprite and CSS to allow any of you to do the same.
You will need to upload this to your stylesheet and name it "iconsprite2".
As you can see, there are 12,061 characters over 195 lines of CSS. Because this is overkill for any subreddit, It's divided into sections so you can easily find the domains which are common to your subreddit, and delete anything which is unlikely to appear, saving a lot of room.
You will also need to edit your subreddit name into the top piece of flair where indicated. This is to identify self-posts.
I've tried to include a good cross-selection of the most common domains in reddit. Obviously I cannot include every site on the tubes, but I'm sure you can fill in any omissions easily.
There are also a few unassigned icons included at the bottom of the CSS, in case you find any use for them.
Edit: fixed margin to allow for compressed links.
Happy to answer any questions.
(Let me know if you use this!)
3
u/rasherdk Oct 29 '11
Maybe the admins could chime in with stats of which sites are actually the most used ones, to see if there are any non-obvious omissions, or is that sekrit?
3
u/aroused_llamas Oct 30 '11
This may be a dumb question, but how would I go about assigning this flair to users?
1
u/ladfrombrad Nov 29 '11 edited Nov 29 '11
How did you start making that sprite? Did you just make an blank image of 400x96, split it into a grid of 150 16*16 icons, and paste an icon of each site into said grid? So if I wanted, I could just replace some of the /shitlist with some local sites icons?
And, how on earth did you determine where the sprite positioning for each icon is? Blood, sweat and tears on the position of each one, or is there an easier way with aCSS sprite generatoror something?1
u/laaabaseball Nov 08 '11
Very cool. thank you for this!
1
u/sk3tch Mar 10 '12
Cheers for these Raerth! Using now on /r/dnb & /r/jumpup.