0

I've been using the "Emmet Livestyle" plugin lately, and its been flawless. But on the last commit to my github project I noticed that the css lines were duplicated* from 1446 to 3448. I then opened chrome dev tools and confirmed that there were like 3 same styles per one element. I suspect that plugin is the culprit to this problem.

I really need to remove the duplicates. But I don't know where they start or where they end as the file is pretty large.

Could you guys happen to know any online tool or sublime plugin that could help me with this ?

Thanks.

as__
  • 77
  • 1
  • 10

2 Answers2

2

I've had this exact same problem with LiveStyle with my files being duplicate somewhere around 4 different times. One file is now 4 times as long.

In searching for a solution I found a NodeJS plugin called css-purge. It IS the solution and as far as I know, the only solution. I guarantee it.

You can find it here CSS Purge Package Install Page. Be sure to install NodeJS properly on your system first. I'm on a Mac so these were my instructions. I'm still looking for a solution for fixing Live Style. It used to work flawlessly until this new dedicated app started causing problems.

mochabcha
  • 286
  • 2
  • 9
  • Thanks for the recommendation @mochabcha, here's our latest update: http://rbtech.github.io/css-purge it does so much more now and faster ;), happy purging! :) – AEQ Nov 18 '17 at 20:40
0

If you look at Chrome's Developer Tools (other browser's do this as well), you will be able to, not only see what styles are being applied to an element, but from where those styles are coming from:

enter image description here

Once, you know the source, a simple "Find" operation in your editor will track the rule down.

Scott Marcus
  • 64,069
  • 6
  • 49
  • 71
  • There are >3000 lines of CSS thus meaning like 2x selectors for many fields. Manually searching and tracking them down is something I would never wish to do, thus I asked for your help here on StackOverflow. – as__ Mar 16 '16 at 14:08
  • If you don't have a backup copy of the file before all the duplicates got created and there's no way to regenerate the file, then I don't see what you are expecting us to be able to tell you. – Scott Marcus Mar 16 '16 at 14:12
  • I do have a commit made earlier before the lines got duplicated. – as__ Mar 17 '16 at 08:17