Tuesday, September 14, 2010

Damn the prefixes

So today I was playing a bit with the box shadows in CSS3, and as I was writing the code, I realized that in order for me to put some simple shadows around the a box, here is what I need to do:


-webkit-box-shadow: 0px 0px 10px #676767;
-moz-box-shadow: 0px 0px 10px #676767;
box-shadow: 0px 0px 10px #676767;


Now if you are using any browser other than IE, you can see shadows around the code block above. And if you use IE, all you see is a regular code block with just grey borders!

WAIT..... IE WHAT!?

Yes, I do need to have all these duplicate CSS code with the silly prefixes to make sure Firefox, Opera and Google-Chrome can put up some freaken shadows around the code block; and IE will simply do what IE does the best! Ignore all of them!

Am I the only one finding these pre-fixes borderline annoying? Actually I am somewhat disturbed. Or even outraged! For a simple thing like SHADOWS! You may as well split in my mouth and ask me if I can tell if you have chicken or fish for dinner!

Finally we have an easy and clean way to put shadows around a box, and all these damn browser companies can't even agree on one single simple box-shadow specification to conform to?
While I understand the prefix exists as a way for a company to claim that "silly boy who complains too much... it is only beta and it will only affect my browser only (*wink)", but come on, guys! At least figure out a way to standardize the very basic specifications and then "override-it-only-when-a-prefix-is-specified"!

While all these damn browsers are competing for the fastest speed, but at the same time, they shoot themselves in the foot by forcing users to duplicate code (and, thus, larger files to download) in order to have the multi-browser supports.

I guess what I am saying is that while I know the prefixes are useful/important for browser companies and developers who dare, but I just wish these companies can come up with a solution to reduce the repetitive CSS code due to the prefixes to get more developers to dare. And while they are at it, kill some of prefixes that just don't make sense to be prefixed anymore (if safe, of course)!

If the next United State President candidate can promise me web standard uniformity, I am voting for that person. Heck, it does not even need to be a person, it can be a possum, for I care.


function isVotingForCandidate(candidate){
    var isVoting = false;

    Ext.each(candidate.proposedPolicies, function(i, x, a){
           if (i.indexOf('the world should only use one browser only, darn it!') > -1){
               isVoting = true;
               return false;
        }
    });

    return isVoting;
}

No comments:

Post a Comment