Git Product home page Git Product logo

sublime-text-compass's Introduction

Compass Build System for Sublime Text

Works with Sublime Text 2 and Sublime Text 3.

Adds a Build System for Compass Watch when opening SASS Files. (Sublime-Text-2-SASS-Package or similar SASS Package needed).

Create a project and place the Sublime Text Project file in your project's folder root. Example: yourproject/project.sublime-project

A Sublime Text Project File in the root of your project is necessary.

PREREQUISITES

Ruby and the Compass Gem have to be installed. Important: This package is not going to add syntax highlighting for SCSS/SASS.

INSTALLATION

With Package Control plugin

I recommend this method If you want the Compass Build System always up-to-date.

  1. Install the Package Control Plugin for Sublime Text 2 or 3. Follow the instructions and restart Sublime Text.
  2. Use Preferences > Package Control or Command+Shift+P (OS X) / Control+Shift+P (Linux/Windows) and select "Package Control: Install Package". Wait while repositories are loading.
  3. When the command form appears type "Compass" and you'll find the Compass Build System. Select to install.

Package Control

Build

Open one of your .sass files and press CTRL + B (or Tools > Build). If you have more than one Build System that is able to compile SASS, change the Build System to Compass under Tools > Build.

Troubleshoot

How to configure Compass build with rbenv in Sublime Text 2?

See topic on Stackoverflow

Sprite mixins from Compass don't work. What can I do?

You'll have to edit the sprite importer from Compass. Take a look at the issue and the original fix in the Compass repository.

Error folder was unexpected at this time

This is a Windows only issue and means, you have special chars in your project path. To get it working, remove special chars in your folder names. There mustn't be any single special char in the whole path down to the project. See support thread, #59.

sublime-text-compass's People

Contributors

attila avatar cristinasolana avatar davidlwatsonjr avatar drwlrsn avatar graphical-iain avatar johnmave126 avatar renestalder avatar romulof avatar steriley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sublime-text-compass's Issues

Der Befehl "compass" ist entweder falsch geschrieben oder konnte nicht gefunden werden.

Hi

I have installed your plugin on another machine (windows) and now I have following error message:

Der Befehl "compass" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

C:\Users\user\AppData\Roaming\Sublime Text 2\Packages\Compass>pause
[Decode error - output not utf-8]

On my first computer (windows) it's working and I found no differencem between the two computers.

Do you have any idea why this error appears?
Thank you for your help!

No such file or directory @ rb_sysopen Sublime Text 3

Hey there,

I'm running this plugin alongside the SublimeOnSaveBuild plugin on Win8 SublimeText3. When I save/build, I'm getting a Errno::ENOENT error:

Errno::ENOENT: No such file or directory @ rb_sysopen - C:/Users/[USER]/AppData/Roaming/Sublime Text 3/Packages/Compass/.sass-cache/75fcaf1b4852ceb732871195e41567cc2a7d8997/C%058/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/compass-core-1.0.1/stylesheets/compass/utilities/general/_hacks.scssc20150119-4476-8chy0e

When I run compass watch in command line, I'm not running into this issue.

I already had ruby, sass, and compass installed on my machine. I then installed your plugin, created a project file in my root directory, and tried to build. Am I missing a step here?

command not found in arch linux

I get this issue in Arch Linux with the lastest version of sublime-text-2-compass-build-system:

"
/bin/sh: compass: no se encontró la orden
[Finished in 0.0s with exit code 127]
"

In the terminal compass work fine. I have this code in .bashrc:

"export PATH=$PATH:/home/mi_user/.gem/ruby/1.9.1/bin"

Can u help me?

'compasswatch.bat' is not recognized as an internal or external command,

I am getting this error whenever i try to build the project. I am using window

I install the compass using package control and copy the compass build folder to my project directory but still shows an error every time i hit the ctrl + B ..

'compasswatch.bat' is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.0s with exit code 1]

Compass will not build (exit code 255)

I have this plugin installed in Sublime Text 3 and whenever I want to build I get this in the console:

\projects\website' was unexpected at this time.
[Finished in 0.1s with exit code 255]
[cmd: build.cmd "G:\projects\website\scss\modules" "G:\projects\website"]
[dir: C:\Users\Radu\AppData\Roaming\Sublime Text 3\Packages\Compass]
[path: C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\WinSCP\;C:\Ruby\bin]

This issue has been described by someone else on Stack Overflow, but with no resolution:

http://stackoverflow.com/questions/25229159/sass-compass-will-not-build-exit-code-255-sublime-text-3#comment49709536_25229159

It's worth mentioning that I am running the same configuration at home as at the office with the difference that at the office I am running on Linux Mint and at home on Windows 8.1.

Compass Build not working on Mac

On a quick look:

No build error,
No compile messages in console.

Tried removing the package and reinstalling and restarting.

I think it's not recognizing my config.rb at the root of the project.
My sass files live in subdir public/assets/styles/sass/

No such file or directory

Build breaks when there is a space in the folder name.

A project in:
file/ABC Website/

will return: find: /Users/user/Desktop/file/ABC: No such file or directory

Edit: This is on a mac running ST2

Package Control install failure

Getting an error when using Package Install...

 Unable to download Compass. Please view the console for more details.

Here's the relevant bit from the console. HTTP 400 error?

Package Control: Error downloading package. HTTP error 400 downloading https://codeload.github.com/WhatWeDo/Sublime-Text-2-Compass-Build-System/zipball/v1.0.7.
error: Package Control

sprite mixins from compass doesnt work

Hi, thx for good build system.

I found error when im trying to generate some sprites via compass, get error ...

No files were found in the load path matching "sprite-smart/*.png". Your current load paths are: C:\wamp\www\private\w-e-b-s\2014\projectname\www/assets/gfx

Code:
$sprite-smart-sprite-dimensions: true;
@import "sprite-smart/*.png";
@include all-sprite-smart-sprites;

Of course, I have directory sprite-smart with files inside.
Im using WIN 7 64bit

When Im running compass via command lind (ruby cmd) it works...

Can u help me? Build using in ST2 is better than RubyCMD.

PS. Screen where its seen that it works via RubyCMD http://i.imgur.com/W10CBua.jpg

EDIT: I found solution in previous issue here: #8

Direct link to solve the problem here: Compass/compass@58babac

Nothing to compile error.

Getting this when I run the Build. I'm on OSX.

Nothing to compile. If you're trying to start a new project, you have left off the directory argument.
Run "compass -h" to get help.
[Finished in 0.2s with exit code 1]

I usually run compass watch from this same directory and it works fine.

"[ERROR] config.rb not found." after update to 1.0.8

Hi,

I'm getting this error when trying to compile:

[ERROR] config.rb not found.
[Finished in 0.0s]

It's weird since my config.rb was not moved from the root directory.
Also, running "compass watch" on the project path through command line works fine.

Tried reinstalling the package, but no success.

Here's my config.rb file content:

# Require any additional compass plugins here.
require 'modular-scale'
require 'zurb-foundation'

# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"

I'm using ST2 build 2221 on Windows 7 64bits.

Thanks.

Output of build results not shows the last line

Initial Build Output------------------------- ------------------------- ------------------------

Dear developers making use of FSSM in your projects,
FSSM is essentially dead at this point. Further development will
be taking place in the new shared guard/listen project. Please
let us know if you need help transitioning! ^_^b

  • Travis Tilley

Compass is polling for changes. Press Ctrl-C to Stop.
Change detected at 01:29:37 to: theme.scss

First Change Output ------------------------- ------------------------- ---------------------

Dear developers making use of FSSM in your projects,
FSSM is essentially dead at this point. Further development will
be taking place in the new shared guard/listen project. Please
let us know if you need help transitioning! ^_^b

  • Travis Tilley

Compass is polling for changes. Press Ctrl-C to Stop.
Change detected at 01:29:37 to: theme.scss
identical theme.css
Change detected at 01:36:47 to: theme.scss

Second and more Changes ------------------------- ------------------------- ----------

Dear developers making use of FSSM in your projects,
FSSM is essentially dead at this point. Further development will
be taking place in the new shared guard/listen project. Please
let us know if you need help transitioning! ^_^b

  • Travis Tilley

Compass is polling for changes. Press Ctrl-C to Stop.
Change detected at 01:29:37 to: theme.scss
identical theme.css
Change detected at 01:36:47 to: theme.scss
identical theme.css
Change detected at 01:39:09 to: theme.scss

Thanks for advance

Sublime compass is throwing the following error

The filename, directory name, or volume label syntax is incorrect.
Nothing to compile. If you're trying to start a new project, you have left off the directory argument.
Run "compass -h" to get help.
[Finished in 0.7s]

Package Control install failure

Getting an error when using Package Install...

 Unable to download Compass. Please view the console for more details.

Here's the relevant bit from the console. HTTP 400 error?

Package Control: Error downloading package. HTTP error 400 downloading https://codeload.github.com/WhatWeDo/Sublime-Text-2-Compass-Build-System/zipball/v1.0.7.
error: Package Control

CSS output to other directory?

My config.rb, that is in the root folder of my project together with the .sublime-project file, contains:

preferred_syntax = :scss
http_path = "/"
css_dir = "resources/css"
sass_dir = "resources/scss"

Still, the css files are created in resources/scss. I can't seem to output the css to any other folder than the scss folder. Is this expected behavior? On Windows 8, ST3.

CPU being consumed by multiple ruby instances 'whatching' for saves

A new ruby instance is being opened everytime the project is built, and they are not being closed at all. This is causing CPU and memory consumption beyond we expect from the Compass compiler.

I presume the plugin is using watch commands since Sublime Text console is writing the watch default message on every build. ( "Compass is polling for changes. Press Ctrl-C to Stop." )

Switching to the compile command should solve it, maybe.

Turn off colorized output in compasswatch.bat

You get a bit of a nasty looking output in the Sublime console window when using the compasswatch.bat I suggest the --boring switch is used to turn off the colour.

compass watch %1 --boring

Compass file build in Windows 7

Hi there!

I've reinstall Windows 7. Installed ST2, ruby, sass for ruby, compass for ruby, SASS for ST2 and compass for ST2.

I've create a new project and there is one file.sass file. When I try to build file console gives me an output:

C:\Users\Sergey\AppData\Roaming\Sublime Text 2\Packages\Compass>IF EXIST ""\config.rb (compass watch "" --boring ) 

C:\Users\Sergey\AppData\Roaming\Sublime Text 2\Packages\Compass>IF EXIST C:\Users\Sergey\Desktop\sass\config.rb (compass watch C:\Users\Sergey\Desktop\sass --boring ) 

C:\Users\Sergey\AppData\Roaming\Sublime Text 2\Packages\Compass>pause
Press any key to continue . . . 
[Finished in 0.1s]

And nothing is happened.

When I use compass from cmd it works fine.

And there is one more problem. ST2 build output does not depend on installed ruby compass or not.

Thank you.

Overwrite the "compass watch" path in project settings?

Hi

I try to change the compass watch path per project but without success. :-(

I have tried to overwrite the settings in the .sublime-project file like:

"build_systems":
[
{
"name" : "Compass Test",
"cmd": "cd J:/projectX/templates ; compass watch",
"working_dir": "$packages/Compass",
"selector": "source.sass",
"shell": "true",
"windows":
{
"cmd": ["compasswatch.bat", "J:/projectX/templates"]
}
}
]

Is this possible? Can you give an example?

Thank you for this excellent plugin and your help!

EDIT: I just noticed that It works if I choose "Compass Test" in "Tools" -> "Build Systems". But is this the way you recommend? Or is there a better way?

Plugin executes "compass watch" on every build instead of running once

This is more of an annoyance than a bug: The plugin runs "compass watch" every build (or save with SublimeOnSaveBuild) instead of running just once since compass is already watching the project.

Is there a way for the plugin to detect if the command was already executed and Compass is already watching the folder? This will save 1 or 2 seconds.

Thanks in advance

Command not found ... this time in Windows

When attempting to build, I get the following output:

'compass' is not recognized as an internal or external command, operable program or batch file.
C:\Users\username\AppData\Roaming\Sublime Text 2\Packages\Compass>compass watch "[projectpath]" 

C:\Users\username\AppData\Roaming\Sublime Text 2\Packages\Compass>pause
Press any key to continue . . . 
[Finished in 0.1s]

I've triple-checked my path variable. Opening a command prompt and typing compass totally works. The package folder is called Compass not Compass Build and none of the package files seem to be out of whack name-wise.

I'd love to use this package, but at present it isn't working.

NOTE: The project path is really where [projectpath] is.

Problem with subl on Windows

I want to create the new file hello.html (subl public/hello.html), but git gave me an error subl: Command not found. Help me!

Change default build path

Hi René.

Thanks for extension. Can u just a little update it by adding in readme instruction for changing cmd-path?

I, for example, wanna compile to .tmp folder where styles tidied w/ grunt commands.

My project structure looks like
.tmp/
    /css
    /js
    /img
app
    /sass
       /bootstrap
       main.sass
    …
and so on.

Thx in advance for your help

Can't Seem to Compile

Maybe it's just me, but I'm having a hard time getting Compass to compile at all. In contrast, I've installed the SASS compiler and had no issues with it.

I've selected Compass from Tools > Build System and selected Tools > Build and nothing happens.

I do have a sublime-project file created. Any ideas?

ST2/Win7 Problems

Consistently fails with "'compass' is not recognized as an internal or external command, operable program or batch file."

'compass compile' works correctly with ruby-console. All needed conditions are set (compass-created folder structure, ST2 project is at root, Ruby/SASS/Compass all install and working, Tools>Build>Compass set in ST2). I tried several variations noted (netaustin, .bat file tweaks), but the problem persists. Too bad because it would a be nice ST2 feature. Issue should remain open.

The new build.cmd neglect the lowest level directory

for %%F in ("%fileDir%\..") do if not exist "%%~fF\config.rb" (
  if %fileDir% neq %%~fF (
    set "fileDir=%%~fF"
    goto :loop
  ) else set "fileDir="
) else set "fileDir=%%~fF"

The first search position will be the upper level of %fileDir%, so if the config.rb is there, the search will fail

Compass load path confusion

Well following up my problem in #4 ...

Now the problem is the load path of the assets used by Compass.

Specifically, i'm using the sprites mixins do manage my sprites. But, when I try to build I get the following error:

>>> Change detected at 01:30:03 to: screen.scss
Compass::SpriteException on line ["84"] of C: No files were found in the load path matching "social/*.png". Your current load paths are: D:\@Projetos\@@danca-pequena/images
Run with --trace to see the full backtrace

Look at the path. It's mixing slashes and backslashes, so it does not find my image folder because it's looking in an unexisting /images folder while it should look at \image. It then frozes the script and my stylesheet is not compiled at all!

I know this is very annoying, but compass works flawlessly outside sublime text. How could we solve this ?

Thanks

Not watching just compile once

Compass build not watching anymore? All my files on mac or pc just compile once, after hit cmd/ctrl+b, i need do it after every singe save. How to fix it? in sublime console i see only this:
overwrite screen.css
[Finished in 1.8s]

Thanks.


Oh, sorry i see changelog of 1.0.8v changed watch to compile, so should i use smthing like "onsavebuil" or here is another solution?

command not found

I'm getting this error:

/bin/sh: compass: command not found [Finished in 0.1s with exit code 127]

compass watch works perfectly when I start it from Terminal though.

After Update to 1.0.6 Build System Broken: [Decode error - output not utf-8]

I run into a problem after upgrading to the current Version (1.0.6).
Compiling does not work any more, I get the following error: "[Decode error - output not utf-8]".

I have tried several things (like charset encoding, quote replacement etc) but wihtout success.

Plattform is WIndows 8 64bit

For now I can fix it with a roleback to Version 1.0.4, which was working for me.

Path appended to

Every time I run a build, the path gets prefixed with /usr/local/bin, leading to an every increasingly long path...

[path: /usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/nthompson/bin]

[ERROR] compass not found. Make sure it exists in your PATH.

I'm on Sublime Text 3 on OSX 10.8.5
When Compass was installed on system ruby the CSS compiling was successful. Yesterday I uninstalled the Compass gem from system ruby and installed it to 1.9.3-p194 (I'm using rbenv to manage ruby versions). Since then when I try to build a .scss file from ST3 I get this error:

[ERROR] compass not found. Make sure it exists in your PATH.
[Finished in 0.0s]

And no longer have been able to compile from ST3.

The rbenv shims path has been added to PATH in .zshrc

~  echo $PATH
/usr/local/var/rbenv/shims:~/.rbenv/shims

I'm sure Compass is installed:

➜  htdocs git:(develop) ✗ which compass
/usr/local/var/rbenv/shims/compass

Indeed, Compass still works via command line.

I see that the error is thrown in build.sh:

COMPASS=`which compass`;

if [ -z "$COMPASS" ]; then
  echo "[ERROR] compass not found. Make sure it exists in your PATH.";
  exit;
fi

Shouldn't COMPASS return the same value as above instead of null?

Error in Windows

When trying to build .scss file. The following error shows in the console:

Running compasswatch.bat 
Traceback (most recent call last):
  File ".\sublime_plugin.py", line 337, in run_
  File ".\exec.py", line 146, in run
WindowsError: 

SO -> Windows 7 Ultimate. Compass runs normally from within any folder if called direct from de command prompt. Runy is properly installed.

Thanks

UnicodeEncodeError

When I try to build on linux (well, on virtual machine on windows), i've got this in console:

Traceback (most recent call last):
  File "./sublime_plugin.py", line 337, in run_
  File "./exec.py", line 130, in run
UnicodeEncodeError: 'ascii' codec can't encode characters in position 20-26: ordinal not in range (128)

Any help?

Build compressed

Hello,
Thanks for his great plugin.
Is it possible to make another build system ? like the Sass plugin, with the choice "normal" & "compressed" ?

Sorry for my english...I'm french ^^

Set the css library for compass

When I use the build command in sublime, the css files are saved in the same directory as the sass files.
My project looks like this:
Project-folder/
| sass/
| css/
| my.sublime-project
| my.sublime-workspace
| config.rb

In the config.rb is written
css_dir = "css"
sass_dir = "sass"

I can go to the command line and type "compass watch" and it'll watch and compile to the css dir. correctly - but that shouldn't be necessary right? So how do I tell Sublime Compass Build System to compile to the css dir?

[ERROR] config.rb not found

Trying to get the plugin to work, but no luck here on Win 8.1 + Sublime 3.

Every time I try to build I get:

The system cannot find the path specified.
[ERROR] config.rb not found.
[Finished in 0.1s]

When I have Compass watch the folder, Compass buids fine.

I've tried different setups, with config.rb and SCSS in root project and sub folders, but the error is the same every time.

My config.rb:
preferred_syntax = :scss
http_path = "/"
css_dir = "css"
sass_dir = "scss"
@import "compass" # I also tried without this line.

My project.sublime-project:
{
"folders":
[
{
"follow_symlinks": true,
"path": "."
}
]
}

I have a sublime-project.scss in the same folder as the other .scss files.

Apologies if this is a user error, but I feel I've done my best to rule that out.

README OSX instructions

The cd path should be changed in the instructions to:

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages

Look forward to using this today. Thanks. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.