Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sublime Plugin #2

Open
jeremyworboys opened this issue Jul 10, 2012 · 6 comments
Open

Sublime Plugin #2

jeremyworboys opened this issue Jul 10, 2012 · 6 comments

Comments

@jeremyworboys
Copy link
Owner

Opening discussion for creating a Sublime Text 2 plugin.

@bgallagh3r
Copy link

Unfortunately I don't write in python, but essentially all that would be required is a command that fires on a key press.

I'm not sure how familiar you are with ST2, but you can check out these links:

So if I understand your script correctly, it looks for multiple @media queries with the same values in the .CSS files and refactors them together into one query correct? If so this would be an invaluable addition to ST2 or Sass in general.

Essentially you create the plugin to run via a command and in ST2 you can bind keyboard shortcuts to the name of the command, but the awesome part is you can attach that command to build scripts as well, so I when I am working in a Sass/Scss file, I can have it fire a build script when I save the file, in the build script it can run the command to look over the css file and run.

The biggest hurdle will be since the user will be working in the Sass file, the Sassy Media plugin would need find out where the regular css file is and run on that file instead. If you are using compass/sass you could always reference the config.rb file.

I wouldn't be opposed to just leaving it as a basic command though, like the Prefixr plugin I'd have to run it on the CSS anyways so not a huge deal I suppose.

@jeremyworboys
Copy link
Owner Author

ST2 is my primary editor. The main thing I was trying to figure out was how you would to run it.

I will take a look at the Prefixr plugin since it is a similar concept and see what I can come up with.

@bgallagh3r
Copy link

This is the "real" prefixr plugin by Will Bond. He's an ST2 genius. If anyone could help you out on this it'd be him. He's the one that wrote Package Control, SFTP/SVN and Prefixr.

https://github.com/wbond/sublime_prefixr

Prefixr just adds a keymap, and menu options in the package that allows you to bind the prefixr command to a shortcut. Simple enough I assume.

@jeremyworboys
Copy link
Owner Author

So the workflow would be:

CSS

  1. Write CSS
  2. Press shortcut to run Sassy Media
  3. Sassy Media outputs new CSS

SCSS/SASS

  1. Write SCSS/SASS
  2. Run build script
  3. Build script calls outputs CSS
  4. Build script calls Sassy Media
  5. Sassy Media outputs new CSS

How does that sound?

@bgallagh3r
Copy link

Ya the build script would be the hardest part. With just sass, the dirs are specific /sass and /stylesheets, but with Compass you can define your sass, css, fonts and js folders in the config.rb file in the root of your project. So the build script would need to figure out where the CSS is first then run on it.

@jeremyworboys
Copy link
Owner Author

You're right. I'll look into creating the basic keyboard command system first and then expand from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants