Skip to content

Instantly share code, notes, and snippets.

@ChristopheB
ChristopheB / compact_expand_css_command.py
Last active June 4, 2016 09:31 — forked from vitaLee/compact_expand_css_command.py
SublimeText command for compacting/expanding CSS rules, handles nested for media queries, handles comments, and some race conditions
import sublime
import sublime_plugin
import re
class CompactExpandCssCommand(sublime_plugin.TextCommand):
def run(self, edit, action='compact'):
rule_starts = self.view.find_all('\{')
rule_ends = self.view.find_all('\}')