<p>I have a couple CSS files with overlapping CSS selectors that I'd like to programmatically merge (as in not just appending one file to the end of the other). Is there any tool to do this online? or a Firefox extension perhaps?</p>

[{'answer_id': 16765, 'author': 'Nick Berardi', 'author_id': 17, 'author_profile': 'https://Stackoverflow.com/users/17', 'pm_score': 2, 'selected': False, 'text': '<p>No I wish there was but the programming effort seems too much since there are multiple ways to reference a single element.  The best that you can do is use a runtime like FireBug to find duplicates.</p>\n'}, {'answer_id': 16797, 'author': 'M. Dave Auayan', 'author_id': 2007, 'author_profile': 'https://Stackoverflow.com/users/2007', 'pm_score': 5, 'selected': False, 'text': '<p>I found <a href="http://zamez.org/factorcss" rel="noreferrer">Factor CSS</a> - complete with source code, but I think it does way more than I\'d need. I really just want to combine CSS blocks that have the same selectors. I\'ll check out the source code and see if it can be converted to something usable as a TextMate bundle. That is, unless someone else manages to get to it before me.</p>\n\n<p>EDIT: Even better - here\'s <a href="http://sixrevisions.com/css/css_code_optimization_formatting_validation/" rel="noreferrer">a list of web-based tools for checking/formatting/optimizing css</a>.</p>\n'}, {'answer_id': 11005246, 'author': 'Ben23', 'author_id': 1452316, 'author_profile': 'https://Stackoverflow.com/users/1452316', 'pm_score': 1, 'selected': False, 'text': '<p>I wrote a Perl utility to do this several years ago.</p>\n\n<p>As well as merging one or more stylesheets into a single coherent sorted output (complete with comments to show which file(s) each property appeared in, and warnings when a property has conflicting values), you can also <em>selectively</em> search or merge based on the selector, the property or both. </p>\n\n<p>These are handled intelligently so that, for example, if you search for the property <code>font</code> you also get <code>font-size</code>, <code>font-weight</code> etc (still presented inside CSS blocks with the relevant selectors that they were taken from). Likewise, selector searching tries to Do The Right (ie generally most useful) Thing. If you search for, say, the element <code>a</code>, it will match any block whose selector is <code>a</code>, <code>a:hover</code>, <code>a.extlink</code>, <code>a#mylink</code>, <code>.foo a</code>, <code>#bar a</code>, <code>p a</code>, <code>pre &gt; a</code>, <code>a + p</code>, <code>a img</code>... (the last two don\'t <em>directly</em> affect the styling of the <code>a</code> itself but of an adjacent or descendent element, which it is often useful to know about in such a search), without matching <code>#a</code>, <code>.a</code>, etc. Of course this behaviour is optional, you can also search for an exact selector. Or a regex. </p>\n\n<p>Apart from perl itself the only dependency is <a href="http://search.cpan.org/search?query=css%3A%3Atiny&amp;mode=module" rel="nofollow">CSS::Tiny</a></p>\n\n<p>It\'s free software, and you can get it here: <a href="http://src.qolc.net/cat/software/cssmerge" rel="nofollow">cssmerge</a> </p>\n'}]
['https://Stackoverflow.com/questions/16762', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2007/']