r/csshelp • • Mar 08 '12

Total CSS newbie, looking for some help with getting started

Hey there! I'm a programmer with enough knowledge of HTML to get by, but I've run into a problem when attempting to start editing.

When I go to edit a stylesheet and click the "save" button (or preview button, really), I get a message telling me there are validation errors, no matter what edits I try to make. The error occurs even if I just copy the default and try to submit that, so I'm guessing there's something I need to do before I can get started. The exact error is:

[line 75] syntax error: "CSSValue: Unexpected char. [75:78: )]"
background:-webkit-gradient(linear, 0% 0%, 0% 100%, from( hsl(210, 54%, 89%)), to( hsl(210, 54%, 79%)));

I figure it's a common thing with a super easy solution and I just need to do one or two things before I can get started, but I honestly don't know how to proceed. Anyone willing to give me an easy-to-follow instruction on how to get around the error so I can get to mucking around in the stylesheet?

6 Upvotes

9 comments sorted by

4

u/jaredcheeda Mar 08 '12

certain css features are not permitted on reddit, that's one of them.

most of the stuff you can't use is CSS3. http://www.w3schools.com They have a CSS and CSS3 section. Learn both, but understand that reddit accepts most CSS2 and very little CSS3. You'll need to be creative about how you do things to work around the limitations.

gradient's aren't so bad just make them in photoshop and save as a png, then set them as your background.

2

u/[deleted] Mar 08 '12

It seems to be a part of the default stylesheet, though... I guess I'm just going to have to find away to work around it constantly?
That's ok. I like a good challenge.

4

u/jaredcheeda Mar 08 '12

the official stylesheet used on all reddit pages may contain parts of css that are not permitted for individuals to use for custom subreddit stylesheets

3

u/[deleted] Mar 08 '12

Heh, that's kinda hilarious.

Thanks for the help.

3

u/jaredcheeda Mar 08 '12

nope. just annoying and hypocritical

3

u/gavin19 Mar 08 '12

You can use linear (vendor-specific) gradients like

-webkit-linear-gradient(left,#aaa,#bbb,#ccc)  

Stuff like hsl, rgba etc are a no-no (yet).

2

u/[deleted] Mar 08 '12

Bah, alright. Guess I'll just have to work around it for now.

2

u/jaredcheeda Mar 08 '12

whenever it gives you those errors in the future. check first for typos, then you can try it out in a sandbox like http://jsfiddle.net if they work in the sandbox, then they're just not permitted on reddit and you have to remove that line from the css before you can save.

2

u/SystemOutPrintln Mar 08 '12

It looks like you are trying to make something with a gradient. The best way to work around this would probably be making a PNG that has the gradient you want in GIMP or Photoshop then set that as the background image but I'm not sure what you are trying to put a gradient on. Care to share the surrounding code?

Also, although Reddit can't use the webkit commands (in sub CSS stylesheets) on other sites that will only affect webkit based browsers so Chrome / Safari.