emmetio / livestyle-sublime-old

Live bi-directional CSS edit of new generation
http://livestyle.emmet.io
260 stars 23 forks source link

Disabling and enabling rules using checkboxes changes their order in CSS #145

Open franciscolourenco opened 9 years ago

franciscolourenco commented 9 years ago

When you temporarily disable a rule using the checkboxes in the web inspector, livestyle deletes the rule and adds it to the end of rules in the css file.

checkboxes --> css

This reveals itself to be a problem when there are order sensitive rules, and your css might get broken just by poking around, and you got no idea why.

Previously, Livestyle would comment rules who got disabled in the web inspector instead of deleting them. It seemed a superior solution because:

  1. You didn't have the rule re-ordering problem like now.
  2. Non destructive. You wouldn't accidentally delete your css just by disabling / enabling css rules.
  3. You could still actually delete rules from the web inspector and they would disappear in the CSS.

The (un)comment behaviour seems a solid metaphor for the web inspector's checkboxes enable/disable action, could we possibly go back to it?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9169769-disabling-and-enabling-rules-using-checkboxes-changes-their-order-in-css?utm_campaign=plugin&utm_content=tracker%2F305388&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F305388&utm_medium=issues&utm_source=github).
sergeche commented 9 years ago

LiveStyle never commented out rules. It’s pretty complex behaviour to implement. Anyway, I think about it.

franciscolourenco commented 9 years ago

Then I was probably referring to when I was using Tincr instead. I don't know how it was implemented but maybe it was saving the modifications chrome does itself when you use the checkboxes:

https://i.imgur.com/fqXe6bZ.png

Would it be simpler to just keep the order of the rules without commenting?

Other case not covered, however minor, is when there are rules already commented the code, and chrome presents them in the inspector as disabled. If you enable them in the inspector, nothing happens in the code.

sergeche commented 9 years ago

This is Chrome DevTools feature. Anyway, I agree it’s a big issue so I’ll think about it

ghost commented 9 years ago

I agree with the OP. LiveScript's behavior in this regard is not what I expect or desire. Cheers.