Rule #57 of Liferay Theme Design (for non-theme guys like me)

Have you ever had a super freakish problem with the Liferay CSS Not doing what you expected? I mean I love Liferay's new Minifier, it's fast and efficient. But, it's no fun when you have problems.

Suppose you have some css:

.something-a .something-b,
.something-c .something-d,
.ie6 .something-e {
  ... do this ...
}

.something-g {
  ... do that ...
}

Looks innocent enough, right?

NOPE!

 

It's not innocent! Inside there lies a develish beast that is waiting to bite your earlobes off. But really he's supposed to be your friend... he just needs to be handled with certain amount of firmness, tough love so to speak. You have to set and keep some rules. Otherwise, he'll misbehave.

He'll reduce the above css on a non-ie6 browser to this:

.something-a .something-b,
.something-c .something-d,
.something-g {
  ... do that ...
}

which is NOT what you wanted at all, am I right?

Rule #57 of Liferay Theme Design is: Never, ever, ever mix browser css selectors with non-browser selector css definitions! Always break them out like this:


.something-a .something-b,
.something-c .something-d
{
  ... do this ...
}


.ie6 .something-e {

  ... do this ...
}

.something-g {
  ... do that ...
}

There, now you have laid down the law! Mr. Minifier will handle your css appropriately.

Blogs
This sounds more like a bug report than a rule. I would tell folks to forget the rule and tell Mr. Minifier to fix the bug.

You should be able to do anything you can do with regular CSS, period.

Good CSS form is one thing; it's something I regularly encourage to the outside and demand internally, but ultimately (bugs aside) we shouldn't force people to write themes any other way than they know they already can, especially elsewhere --- where would Wordpress be if they forced their themes to be well written? 3000 themes look better than 30 to John Regular User. :-D
It's not so much a bug as an unexpected side effect of certain performance tuning, and yes, we do, can and should enforce certain conventions.

Since browser selectors are fairly unique to Liferay (apart from most other CMS/portals/etc), it's also not unreasonable to have certain guidelines when dealing with them.

And this convention is much easier to enforce (and much better for long term maintenance) than to try to imagine and parse every possible way in which a user could potentially write their CSS. Not to say it won't be fixed, but as a general rule, your browser specific hacks should not be too entangled into non-hacky code.
ugg,boots shoes,ugg boots,buy ugg boots,argyle knit,knit argyle,mini boots,buy leather boots,boots on sale,boots sale,2010 ugg boots,ugg boots 2010,boots store,classic crochet,classic crochet boots,womens boots on sale,boots for sale,boots in sale,short boots,classic boots,ugg australia,classic tall,discount ugg boots,ugg 2010,ugg company,ugg discount boots,ugg bailey button,cheap womens boots,discount womens boots,womens boots,cheap leather boots,discount leather boots,leather boots,ugg australia boots ,uggstore,kids snow boots,snow boots for kids,uggs 2010,uggs,ugg boots discount,cheap ugg boots,classic knit,ugg 5879,classic argyle knit,classic argyle knit boots,ugg classic argyle knit,classic mini boot,classic sheepskin,classic mini,cheap winter boots,discount winter boots,classic mini for sale,buy classic mini,classic sheepskins,comfortable boots,short leather boots,best winter boots,knee high boots,boat shoes,blue boots,boots online,womens boot,furry boots for women,cheap tall boots,girls boots,thigh boots,thigh high boots,fur boots cheap,waterproof boots,thigh high boots for women,cheap furry boots,full fur boots,ugg classic crochet 5833,ugg 5833 boots,crochet boot,fur boots on sale,cheap crochet boots,crochet boots,ugg 5833,boots uk,green ankle boots,where to buy boots,classic crochet tall,cheap fashion boots,cheap flat boots,flat boots,classic boot,over the knee boots,short boot,boots on line,black leather boots,ugg 5825 boots,short sand,high leather boots,pink in boots,knee boots,ugg classic short 5825,ugg 5825,short classics,classic short 5825,boots usa,australia classic short boots,winter boots,winter boots for women on sale,winter boots on sale,boot shop,knitted boots for women,classic cardy 5819,australia classic cardy boots,australia classic cardy,classic cardy black,australia cardy classic boot,ugg 5819,ugg 5819 boots,ugg classic cardy 5819,grey cardy boots,cream boots,white boots,black cardy boots,classic tall sand,red back boots,red boots,ugg 5815 boots ,pink boots for women,ugg classic tall 5815,classic tall 5815,leggings and boots,ugg 5815,waterproof leather boots,waterproof sheepskin boots,classic tall metallic,cheap fur boots,waterproof winter boots,golden boot,gold boots,gold ankle boots,bailey button boot,pink fur boots,snow boot,bailey button 5803,bailey button chocolate,ugg bailey button 5803,ugg 5803,black knit boots,shop for boots,woman boots on sale,womens shoes boots,boots shop,classic sheepskin boots,boots to buy,buy boots,fur boots for women,green boots,boots with fur,female boots,real fur boots,cheap snow boots,ugg 5359,furry boot,cheap grey boots,cheap brown boots,cozy bootswoman boots,long black boots,black shoe boots,big boots,boot for women,cheap over the knee boots,boot on sale,lace up boots,boot for sale,ankle boots,cheap thigh high boots,cheap knee high boots,boots that are in style,style boots,tall sheepskin boot,boots and all,tall boots,tall boots on sale,snow wear,fall boots,boots shoe stores,patent boots,patent leather boots,love from australia,boot uk,hot boots,shoes australia,kid classic,new boots,boots with the fur,grey boots for women,grey boots on sale,boots on sales,boots sales,boots and more,womens boots and shoes,long boots,button boot,pink boots,leather boots on sale,long leather boots,cheap ankle boots,grey boot,grey boots,boot chocolate,black boots,fashion boots,fur boots,