r/csshelp • • Sep 10 '11

Replace "+ frontpage" with "subscribe" and "- frontpage" with "unsubscribe"

Any help is appreciated.

8 Upvotes

12 comments sorted by

3

u/OTACON120 Sep 10 '11

My shot at it:

.option.active {
	padding: 1px !important;
}

.option.active.add {
	color: #7BB850;
}

.option.active.remove {
	color: #CF6165;
}

.option.active:after {
	color: #FFF;
	margin-left: -5.4em;
	margin-right: 1.35em;
}

.option.active.add:after {
	content: "subscribe";
}

.option.active.remove:after {
	content: "unsubscribe";
}

2

u/IAmAnAnonymousCoward Sep 10 '11

Thanks! Not sure if I did it the proper way, but I managed to also remove the green / red background:

.fancy-toggle-button .remove {
background-image: none !important
}
.fancy-toggle-button .add {
background-image: none !important
}
.option.active {
    padding: 1px !important;
}
.option.active.add {
    color: white;
}
.option.active.remove {
    color: white;
}
.option.active:after {
    margin-left: -5.4em;
    margin-right: 1.35em;
}
.option.active.add:after {
    color: black;
    content: "subscribe";
}
.option.active.remove:after {
    color: grey;
    content: "unsubscribe";
}

2

u/IAmAnAnonymousCoward Sep 10 '11 edited Sep 10 '11

Final version, which leaves the green background, but removes the red one and also removes the border around "unsubscribe" and removes it's boldness property.

/* REPLACE +frontpage / -frontpage */
/* remove red background, border */
.fancy-toggle-button .remove {
background-image: none;
border: 0px
}
.option.active {
    padding: 1px !important;
    
}
/* make invisible */
.option.active.add {
    color: #7BB850;
}
.option.active.remove {
    color: white;
}
.option.active.add:after {
    margin-left: -5.4em;
    margin-right: 1.35em;
    color: white;
    content: "subscribe";
}
.option.active.remove:after {
    margin-left: -5.4em;
    margin-right: .7em;
    color: grey;
    font-weight: normal;
    content: "unsubscribe";
}

1

u/eri_pl Sep 10 '11

I didn't want to use solid color, I was afraid it would be visible on the gradient. But it looks ok, except for the left margin.

When I test it in Stylish it needs the color declarations to be !important to work. But in page CSS it may be ok without.

1

u/[deleted] Sep 10 '11

Now, while this is potentially do-able in modern browsers... Why?

I understand the want for customization, however you're affecting usability. Users on reddit are trained to use a specific button, and you want to change it?

Odds are, you'll just prevent people from front-paging your subreddit.

That being said, if you have a logical reason behind it I will investigate for you.

6

u/IAmAnAnonymousCoward Sep 10 '11

you're affecting usability

I try to restore usability. The current button is confusing for new users, while I don't think anyone would be confused by "subscribe" and "unsubscribe".

Odds are, you'll just prevent people from front-paging your subreddit.

I'd be happy to run this experiment.

2

u/[deleted] Sep 18 '11

Thanks for the css! I would prefer people go out of their way to visit the subreddit instead of just viewing it on the front page. So I labeled mine, "Follow this reddit" instead. The word "subscribe" kind of reminded me too much of those door-to-door magazine subscriptions, where you get stuck with constant advertisements and magazines you don't want.

2

u/IAmAnAnonymousCoward Sep 18 '11

Lol, yeah. A lot of websites use it though, I guess I was inspired by YouTube.

1

u/eri_pl Sep 10 '11 edited Sep 10 '11
.option.active
{
font-size: 0 !important;
padding-top: 11px !important; /* controls box size */
padding-bottom: 4px !important;
}

.option.active:after
{
font-size: 10px;
}

.option.active.remove:after
{
content: "unsubscribe";
}

.option.active.add:after
{
content: "subscribe";
}

Works in my Firefox. Unfortunetely it uses absolute font size.

edit OK, I have a better one: .option.active { color: transparent !important; }

.option.active:after
{
color: #fff !important;
margin-left: -4.5em;
}

.option.active.remove:after
{
content: "unsubscribe";
}

.option.active.add:after
{
content: "subscribe";
}

2

u/OTACON120 Sep 10 '11 edited Sep 10 '11

Wouldn't that CSS in your edit return a validation error since "transparent" isn't a valid value for "color"?

1

u/eri_pl Sep 10 '11

Sorry, too much Firefox. In which browser it doesn't work, BTW? (It's a CSS3 thing, but quite old, I think.)

RGBA(0,0,0,0) should probably work in all modern browsers.

1

u/OTACON120 Sep 10 '11

Well, I didn't actually check it in any browser other than FF 6.0.2. I was referring to the fact that reddit would throw up a validation error. I didn't think about checking RGBA, though. I'd think that should work. :)