diff --git a/Commands/Save to CSS.tmCommand b/Commands/Save to CSS.tmCommand index aea5128..6b21c6d 100644 --- a/Commands/Save to CSS.tmCommand +++ b/Commands/Save to CSS.tmCommand @@ -6,8 +6,8 @@ saveActiveFile command #!/usr/bin/env ruby -file = STDIN.read[/lessc: ([^*]+\.less)/, 1] || ENV["TM_FILEPATH"] -system("lessc --verbose \"#{file}\"") +file = STDIN.read[/lessc: ([^*])+\.less/, 1] || ENV["TM_FILEPATH"].chomp(File.extname(ENV["TM_FILEPATH"])) +system("lessc --verbose \"#{file}.less\" \"#{file}.css\"") input document keyEquivalent diff --git a/Commands/Save to minified CSS.tmCommand b/Commands/Save to minified CSS.tmCommand new file mode 100644 index 0000000..7d6690e --- /dev/null +++ b/Commands/Save to minified CSS.tmCommand @@ -0,0 +1,22 @@ + + + + + beforeRunningCommand + saveActiveFile + command + #!/usr/bin/env ruby +file = STDIN.read[/lessc: ([^*])+\.less/, 1] || ENV["TM_FILEPATH"].chomp(File.extname(ENV["TM_FILEPATH"])) +system("lessc -x --verbose \"#{file}.less\" \"#{file}.css\"") + input + document + name + Save to minified CSS + output + showAsTooltip + scope + source.css.less + uuid + 448D3A8D-260E-4949-BA33-654886ECDCAF + + diff --git a/DragCommands/Insert inline Image.tmDragCommand b/DragCommands/Insert inline Image.tmDragCommand new file mode 100644 index 0000000..21ce88f --- /dev/null +++ b/DragCommands/Insert inline Image.tmDragCommand @@ -0,0 +1,38 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env php +<?php +$path = getenv('TM_DROPPED_FILE'); +$path_parts = pathinfo($path); +$info = getimagesize($path); +list($width, $height) = $info; +$mime = $info['mime']; +$contents = base64_encode(file_get_contents($path)); + +echo "@gfx-{$path_parts['filename']}: \"data:{$mime};base64,{$contents}\";\n"; +echo "@gfx-{$path_parts['filename']}-width: {$width}px;\n"; +echo "@gfx-{$path_parts['filename']}-height: {$height}px;"; + draggedFileExtensions + + png + jpeg + jpg + gif + + input + selection + name + Insert inline Image + output + insertAsSnippet + scope + source.css.less + uuid + 7B0CA307-CC1C-4EE2-9F63-4825800ACDA7 + +