Before I start reinventing the wheel here, I wonder if anyone has used AppleScript to remove redundant style calls from CSS.
The way CSS works is the file is read from top to bottom, and if there are duplicate style calls, the last one read is used. This means CSS coders can simply add a new call to the end of the file rather than find the existing call and update that.
As a result, a CSS file can become huge, with most calls redundant.
I’m thinking I could right an appleScript that would find every
.header
call in a file for example, then apply the last used value for each property.
If you know CSS, I think you know what I mean.
Has anyone done this or know of tools to do this?