premailer / css_parser

Ruby CSS Parser
Other
279 stars 110 forks source link

Add support for background-size in the shorthand property #65

Closed mitio closed 8 years ago

mitio commented 8 years ago

The background property supports background size in addition to the other long-form properties. When we have a separate background-size property and when we create a shorthand version, we must include the background-size in the shorthand by preceding it with a slash: / and vice versa—when we’re parsing a shorthand property, we must look for and fetch the background-size before we extract background-position as otherwise it might be ambiguous.

This should fix premailer/premailer#252 and premailer/premailer#216.

grosser commented 8 years ago

thx, 1.4.0 is out!

mkigikm commented 8 years ago

Just fyi, I had been working on a fix for this today, and a background shorthand with size cannot be read by yahoo mail. Not sure if you guys are worried about those kind of vendor-specific issues though.

mitio commented 8 years ago

@mkigikm I think that when you "compact" a bunch of properties into their shorthand, you should try to comply with the standards, meaning that if there's a background-size, you should put it there (unless you make it important in which case it will stay as a standalone one).