Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS software to find unused class/ID selectors

    Sometimes I find in my CSS file I have unused selectors in my "core" CSS files. Does anyone know of some software that you can give it a CSS file and then it will search the desired directory for any unused selectors?

  • #2
    New to the CF scene
    Join Date
    Jan 2009
    Location
    Montreal area
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    List of freeware from university site

    Found this today looking for a was to find redundancies and unused CSS rules in my code. I have adopted a technique they call divide and conquer. Split all my CSS rules up into different categories and separate them from my pages. I use import in the head of my pages.

    http://www.d.umn.edu/itss/support/Tr...ign/tools.html

    Scroll down a bit to the "Cascading Style Sheet Tools" section and you'll find stuff for validation, cleaning, optimizing, file reduction very handy resources.

    You'll have to sort out what is useful and not, also note that some links are dead. :-(

    Have fun!

  • #3
    Regular Coder
    Join Date
    Dec 2008
    Location
    Tannhäuser Gate
    Posts
    286
    Thanks
    7
    Thanked 58 Times in 57 Posts
    If you have IE with developer toolbar, under View there's an option called CSS Selector Matches. It will show you your style rules and tell you how many elements are matched by each rule.

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,669
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    I've never found anything that will find them all at once.
    I've used DreamWeaver with some success:
    • with all .html pages open
    • click Edit/Find And Replace
    • click the little box at the top that says Find in Open Documents
    • in the Find box type/paste the selector your checking
    • click Find Next


    I'm sure you could do the same with NotePad or most any other editor.

    I know it's only one selector at a time but it works.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,669
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    2 year old thread. I wonder if the FireFox plugin was made back then... I don't know the name of it but there is one. Pretty sure it's an ff plugin.

    I had it at one time... Worked well for what you want to do.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #6
    Regular Coder
    Join Date
    Jul 2002
    Location
    Kansas, USA
    Posts
    477
    Thanks
    0
    Thanked 51 Times in 50 Posts
    This one? CSS Usage It's still on the Firefox add-ons site but it looks like the developer forgot to renew his domain name as the add-on's homepage has gone missing. This is a Firebug plug-in.

  • #7
    Regular Coder
    Join Date
    Dec 2010
    Location
    California
    Posts
    201
    Thanks
    30
    Thanked 8 Times in 8 Posts
    BEWARE!! The link that Loup0999 added is ok, but links on that page have malware. Surf at your own risk!!!!!!!

  • #8
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I personally use a tool called Unsed-CSS. I find it easier. You don't even have to install an extension and it works on any browser.

  • #9
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,950
    Thanks
    9
    Thanked 724 Times in 718 Posts
    I use a FF plugin called Dust-Me Selectors which will allow you to run a check for a whole site.

    Silly name though...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •