Cross-Browser CSS in Seconds with Prefixr

Cross-Browser CSS in Seconds with Prefixr

Tutorial Details
  • Tool - Prefixr
  • Usage - Automatically update CSS3 properties.

A couple weeks ago, as I began to manually update my stylesheet with all of the various browser prefixes for the new CSS3 properties, I thought to myself, “This is such a waste of time. Surely, there’s an easier way.


Video Overview

Tools like Compass, or even a TextMate bundle are tremendously helpful – I use them often, actually. But, for many projects, they aren’t available. As a result, we’re left in the position of having to copy and paste over, and over…and over.


Introducing Prefixr.com (Alpha)

Prefixr.com

I built Prefixr to do all this tedious work for me. Simply paste in your stylesheet, press Prefixize (or hit Control + Enter), and Prefixr will filter through the applicable CSS3 properties and dynamically update them.

Can’t remember if Opera provides a prefixed version of, say, the transition property (o-transition)? Don’t worry about it; that’s already coded into Prefixr!

With Prefixr, you only code your stylesheets using the official W3C-recommended markup. When ready for deployment, run the stylesheet through Prefixr, and be done with it!


Use the API

Even better than visiting Prefixr.com is using its API from directly within your favorite code editor. Many editors, like TextMate, offer the ability to execute shell scripts. To automatically update your stylesheet in TextMate, create a new command, and paste in:

curl -sSd "css=$TM_SELECTED_TEXT" "http://prefixr.com/api/index.php"
TextMate Screenshot

Now, select your stylesheet, and type the shortcut that you assigned. It will then be filtered through Prefixr, and dynamically updated. (See video above for more details.)


Squash Those Bugs

This is officially an Alpha release, which means that there are still some bugs to squash. All the kinks should be ironed out within this next week. If you find any yourself, there’s a Feedback button on the left-hand side of Prefixr.com that you can use to notify me.

I hope this tool will be of help to you! Be sure to bookmark it!

Tags: CSS
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • Filipe Torres

    Hi Jeffrey,
    do you plan turn Prefixr API an open source project? Available in Github and open to new developers help to improve it and the users post issues?
    This could accelerate Prefixr development and solve bugs.

    Filipe Torres

  • http://tricksmash.com Sidharth

    Actually I didn’t know what is cross browser till now. This article helped me to learn the features of this awesome browser. Thanks.

  • http://www.esylhet.com/directory directory

    what a easy method…………….

  • Col

    Can anyone advise on how to add the curl request into Visual Studio?

  • http://www.advicehow.com vishymedia

    Cross browser css issues are more in IE compared to any other browsers, why is it so?

  • hippie

    What i nice surprise i found today …

    Tks man !!!

    Cheers fom Portugal

    :-)

  • http://www.idesignit.co.il/ Elron

    Played Jeffrey!
    if there is a way to make it work in dreamweaver as well it’ll be great.

  • http://www.coolmathforkids.biz/ Cool math for kids

    What do you often spend your time in free days? Let join to play free games to relax. They will help you feel that life is more interesting if we respect it, it’s also connect everyone to understand more about each other .

  • http://www.disneycars.biz/ disney cars

    Thank you for your information, I was introduced this website by my friend. At the first time, I have no interest but my curious make me feel more and excited. Now I often play free online games because it’s quite interesting, let try it.

  • question

    i was using the prefixr plugin for sublime text today for the first time and i used it for a css3 gradient and all it would do is add the prefix but wouldn’t change the syntax for the specific browser.

  • http://wpsites.net/ Brad Dalton

    Great idea but doesn’t always work

  • Apaz

    Please release this open source =(