Najam Sikander Awan

covering web stack along with microsoft technologies

CSS Diet Plan - First Step to Object Oriented Css

| Comments

I was wondering how to count the rules of my style sheets after little googling i discovered two ways one is through vim and second is through a command line tool called grep.

If you are a vim user and your css file is loaded into vim in command mode enter following command

:%s/font-size//gn

output will be the number of type font-size is used in your css file.

for grep open your command line and enter

cat style.css | grep -c font-size

output will be the count of font-size occurrences in style.css.

you can use *.css as well for all the css files in current directory.

Other then these methods I am really interested to use a tool which will take a file and list all the rules along with their count in code.

Comments