0
votes

Is there a tool to convert something like

font:bold 1.9em "Book Antiqua",Verdana,Tahoma,"Trebuchet MS",sans-serif;

to

font-weight: bold; font-size: 1.9em; font-family: "Book Antiqua",Verdana,Tahoma,"Trebuchet MS",sans-serif

in CSS files?

BTW, I am not sure what to call this process.

2
Just for curiosity, what would you need to do this for?Ben Dauphinee
Because I have css files and the same font family is mentioned in many selectors which is redundant and a waste of space and bandwidth. If the font-family is in its own separate attribute, I can delete it.Tony_Henrich

2 Answers

0
votes

Elbow grease, unfortunately.

More helpfully, I suppose that if your strings are always going to be in the same format (font weight first, size next, fonts 3rd, etc) it's possible that you could write a helper function to parse those strings, but it will be intense...

0
votes

If you use Chrome (or this would work with firebug as well) you can bring up the CSS properties for an element in the developer window (ctrl-shift-J), choose the elements tab and click on an element.

Even if the CSS applied to the element is short-form the browser will expand that out to long-form and you can copy/paste right from the "Computed Style" sidebar.

Chrome Dev CSS http://img2.imageshack.us/img2/2649/chromedevcss.png