Working through how layouts work in a subtheme it seems that "drush omega-guard subtheme" watches the top level files in the subtheme folder but doesn't (can't ?) know about the files in the layouts folder for that subtheme.

My solution was to open another shell and run "compass watch" in my layout folder.

If I had multiple layouts that I was working with it seems I would need to run "compass watch" in each.

I am not sure if there is a better way.

Comments

fubhy’s picture

Yes, optimally (and omega will probably advocate for doing so eventually) you would not have a config.rb file per direcetory but instead a "layouts" folder in the main /sass folder in your theme where you place top level .scss files (no partials [note: partials are the underscore-prefixed files that are only considered by Sass when you @import them]). Those would then turn into /css/layouts/your-layout.css which you can then include from withing the foo.layout.inc file like so:

stylesheets[all][] = ../../css/layouts/your-layout.css

It does look slightly ugly in the .info file but I might even change that so the assets declared in a layouts .info file are relative to the theme root instead. Not sure about that yet though (might be a bit weird for the developer experience). Anyways... that strategy (one config.rb that handles it all) is what I use currently. That also works for custom panels templates that I create (I place the .scss for them in a sass/panels/foo-panel folder).

fubhy’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

caspercash’s picture

Hi!

I am sorry to open up this thread again but I have encountered errors when running the drush omega-guard name_of_subtheme command. Below are the errors it displayed, can somebody tell me whats wrong with it and how to fix it? Thank you very much!

C:\www\drupal\sites\all\themes\drupal>drush omega-guard drupal
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard/interactor.rb:8:in 'require': cannot load such file -- pry (LoadError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard/interactor.rb:8:in '< class:Interactor >'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard/interactor.rb:6:in '< module:Guard >'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard/interactor.rb:1:in '< top (required) >'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard/dsl.rb:38:in 'require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard/dsl.rb:38:in '< class:Dsl >'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard/dsl.rb:34:in '< module:Guard >'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard/dsl.rb:1:in '< top (required) >'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard.rb:10:in 'require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard.rb:10:in ' < module:Guard >'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard.rb:8:in '< top (required) >'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-1.8.0/bin/guard:3:in 'require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/guard-1.8.0/bin/guard:3:in '< top (required) >'
from C:/Ruby200-x64/bin/guard:23:in 'load'
from C:/Ruby200-x64/bin/guard:23:in '< main >'

I am running on Windows 7. Installed Ruby 2.0.0-p0 (x64). Also has this ruby devkit -> DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe. Below was also the output when I run the bundle install command. I did run this command before running the drush omega-guard drupal above.

C:\www\drupal\sites\all\themes\drupal>bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using addressable (2.3.4)
Using chunky_png (1.2.8)
Using fssm (0.2.10)
Installing sass (3.2.9)
Using compass (0.12.2)
Using blend-mode (0.0.1)
Using breakpoint (2.0.5)
Using color-schemer (0.2.3)
Using compass-normalize (1.4.3)
Using compass-rgbapng (0.1.1)
Using compass-validator (3.0.1)
Using css_parser (1.3.4)
Using em-websocket (0.5.0)
Using formatador (0.2.4)
Using rb-fsevent (0.9.3)
Using rb-inotify (0.9.0)
Using rb-kqueue (0.2.0)
Installing listen (1.1.1)
Using lumberjack (1.0.3)
Using thor (0.18.1)
Using guard (1.8.0)
Using guard-compass (0.0.6)
Using multi_json (1.7.3)
Using guard-livereload (1.4.0)
Using guard-shell (0.5.1)
Using oily_png (1.1.0)
Using rb-fchange (0.0.6)
Using sass-globbing (1.0.0)
Using sassy-strings (0.3.1)
Using singularitygs (1.0.8)
Using susy (1.0.8)
Using toolkit (1.0.0)
Using bundler (1.3.5)
Your bundle is complete!
Use 'bundle show [gemname]' to see where a bundled gem is installed.

fubhy’s picture

If "drush omega-guard" gives you errors, ignore it (at least for now) and simply use "bundle exec guard" in the theme folder directly. "drush omega-guard" is just a wrapper for that command for convenience reasons and to allow you to use the command from anywhere in your drupal installation.

caspercash’s picture

hi @fubhy, i am really sorry for posting the same comment in two different issue. I just don't know what to do with this errors. Tried searching in google but haven't found any solutions yet. I also tried "bundle exec guard" but it also displays the same errors as the "drush omega-guard". I wouldn't be able to use LiveReload in drupals omega theme if this thing is not working right?

jdflorez’s picture

dddbbb’s picture

Have just implemented the setup suggested in #1 and I have to say that it's a big improvement, workflow-wise. I'll be using it like this from now on - thanks for the suggestion.

I'd really like to see this be the standard for layouts in Omega 4.