Newbie tutorial of sorts?

222 views
Skip to first unread message

tominated

unread,
Apr 24, 2011, 8:27:20 AM4/24/11
to middleman-users
Hi There,

Last week I started using haml, sass and compass, and was annoyed with
re-compiling every time I made a change (more so with haml—I just used
compass watch), so I took a look at middleman. I am fairly
inexperienced with ruby (I use python for server-side code), so I have
no clue what to do.

I tried mm-init, but I don't know how to put a compass project in
there (it seems that the default mm template uses the old sass and
just importing compass). I use a custom compass framework (https://
github.com/willhw/compass-less-plugin) so I don't think I can just
import it.

Can anyone point me in the right direction?

Thanks,
Tom

Thomas Reynolds

unread,
Apr 24, 2011, 1:41:58 PM4/24/11
to middlem...@googlegroups.com
As of right now, there is no way to initialize new middleman projects from Compass projects. Our two templating systems are incompatible. However, this is something I want in the future.

Your best bet right now would be to generate two projects. One with middleman and one with compass. Then simply move the scss files from the compass project into your middleman views/stylesheets directory. You'll probably need to import the gem in the middleman config.rb (see compass.rb for how it's done).

One caveat about Middleman, we don't compile after every change either. But we do provide the ability to preview your changes in realtime (mm-server) before you do the compilation step (mm-build).

-Thomas

Janson

unread,
May 4, 2011, 1:43:55 PM5/4/11
to middleman-users
I ran into the same issue(s) with using Compass. My current project is
using middleman 1.2.4, compass, and the compass-less-plugin. I managed
to get around it by creating the middleman project first, and then
adding compass second.

$ mm-init project
$ cd project
$ compass init --sass-dir views/stylesheets/ -r compass-less-plugin --
using compass-less-plugin

A couple notes:

1) Compass doesn't like middleman's config.rb. So either create a
blank one, or just temporarily comment out what's in middleman's.
2) Compass will add a few files you won't need in middleman, so just
delete 'em.
3) To use compass and/or compass-less-plugin in your SASS, you'll need
to require the gems in config.rb
4) An older version of middleman had a naming conflict with gem
dependencies, so checkout my fork at https://github.com/janson/compass-less-plugin

Thomas Reynolds

unread,
May 4, 2011, 1:49:37 PM5/4/11
to middlem...@googlegroups.com
Does the compass-less-plugin export anything into the stylesheets folder or is the whole library contained in the gem/library? Unless they require some generated code, you should be able to just add the require line to the mm config.rb

-Thomas

Janson

unread,
May 5, 2011, 11:23:53 AM5/5/11
to middleman-users
By default it'll create a handful of partials and an example
stylesheet into --sass-dir. But yah, if you just want the mixins,
'require compass-less-plugin' in the MM config.rb

On May 4, 1:49 pm, Thomas Reynolds <tdre...@gmail.com> wrote:
> Does the compass-less-plugin export anything into the stylesheets folder or is the whole library contained in the gem/library? Unless they require some generated code, you should be able to just add the require line to the mm config.rb
>
> -Thomas
>
>
>
>
>
>
>
> On Wednesday, May 4, 2011 at 10:43 AM, Janson wrote:
> > I ran into the same issue(s) with using Compass. My current project is
> > using middleman 1.2.4, compass, and the compass-less-plugin. I managed
> > to get around it by creating the middleman project first, and then
> > adding compass second.
>
> > $ mm-init project
> > $ cd project
> > $ compass init --sass-dir views/stylesheets/ -r compass-less-plugin --
> > using compass-less-plugin
>
> > A couple notes:
>
> > 1) Compass doesn't like middleman's config.rb. So either create a
> > blank one, or just temporarily comment out what's in middleman's.
> > 2) Compass will add a few files you won't need in middleman, so just
> > delete 'em.
> > 3) To use compass and/or compass-less-plugin in your SASS, you'll need
> > to require the gems in config.rb
> > 4) An older version of middleman had a naming conflict with gem
> > dependencies, so checkout my fork athttps://github.com/janson/compass-less-plugin
Reply all
Reply to author
Forward
0 new messages