Extending Sass

28 views
Skip to first unread message

Matija Marohnić

unread,
Mar 13, 2013, 7:02:37 PM3/13/13
to na...@googlegroups.com
Excuse me for my Ruby newbieness, but how do you extend Sass with additional functions in nanoc?

I know you need to have a Sass::Script::Functions module somewhere in the lib folder, but I don't know where and how to require it when nanoc starts. I know how Sass functions work, so I only need help with the integration in nanoc :)

Denis Defreyne

unread,
Mar 17, 2013, 12:45:12 PM3/17/13
to na...@googlegroups.com
Hi Matija,

nanoc automatically loads all files in lib/ before compilation (recursively and alphabetically). So, you can put Sass::Script::Functions somewhere in lib/. You’ll probably need to require 'sass' first though, because nanoc won’t actually load sass until the sass filter runs.

Hope this helps! (I haven’t actually tried this myself yet :)

Denis



On 14 Mar 2013, at 00:02, Matija Marohnić <matija....@gmail.com> wrote:

> Excuse me for my Ruby newbieness, but how do you extend Sass with additional functions in nanoc?
>
> I know you need to have a Sass::Script::Functions module somewhere in the lib folder, but I don't know where and how to require it when nanoc starts. I know how Sass functions work, so I only need help with the integration in nanoc :)
>
> --
> --
> You received this message because you are subscribed to the nanoc discusssion group.
>
> To post to this group, send email to na...@googlegroups.com
> To unsubscribe from this group, send email to
> nanoc+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nanoc?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups "nanoc" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to nanoc+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Matija Marohnić

unread,
Mar 18, 2013, 1:14:06 PM3/18/13
to na...@googlegroups.com
It works! Thanks :)

Tom Kenny

unread,
Apr 12, 2013, 12:26:19 AM4/12/13
to na...@googlegroups.com
Oh, wow. Giving Sass functions native access to the nanoc environment will make some stuff SO much easier, like changing url() links depending on config variables. Thanks for the heads-up.
Reply all
Reply to author
Forward
0 new messages